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

   10 PRINT MID$("/\",1.5+RND(1),1);:GOTO 10
Run it on another old-school computer, like an Apple II, and you won’t get the same transfixing result, for details that have to do with the Commodore 64’s character set, called PETSCII.



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 ? "/" : "\\"); }

-----


i think the key point is that / and \ do not span their character cells from corner to corner.

-----




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

Search: