Hacker News new | comments | show | ask | jobs | submit login

Is it the same as this C snippet?

  main() { while (1) printf("%c", rand()%2 ? '/' : '\\'); }
Edit: Golfed my original snippet down, then put back original after mmphosis's identical translation.



Small variant:

void main() { while (1) printf("%c", "/\\"[rand()%2] ); }


yes.

  #include <stdio.h>
  main() { for(;;) printf(rand()%2 ? "/" : "\\"); }




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: