Hacker Newsnew | comments | show | ask | jobs | submitlogin
akkartik 589 days ago | link | parent

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.


activepeanut 589 days ago | link

Small variant:

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

-----

mmphosis 589 days ago | link

yes.

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

-----




Guidelines | FAQ | Lists | Bookmarklet | DMCA | News News | Bugs and Feature Requests | Y Combinator | Apply | Library | Contact

Search: