3 ms·
The article seems to be a a lot of hyperbole without much substance. The code itself is simple. CHR$(205.5 + RND(1)) becomes CHR$(205) or CHR$(206) depending o
by zaptheimpaler 14y ago
The article seems to be a a lot of hyperbole without much substance.
The code itself is simple. CHR$(205.5 + RND(1)) becomes CHR$(205) or CHR$(206) depending on the random number. 205 generates a \ , and 206 generates a /.
- mmphosis 14y ago10 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.
- akkartik 14y agoIs 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.
- mmphosis 14y agoyes. #include <stdio.h> main() { for(;;) printf(rand()%2 ? "/" : "\\"); }
- activepeanut 14y agoSmall variant: void main() { while (1) printf("%c", "/\\"[rand()%2] ); }
- zem 14y agoi think the key point is that / and \ do not span their character cells from corner to corner.
- oelmekki 14y agoI quite thought the same thing. Ok, it's fun, but writing a lengthy article like this for that ... Wait, a book ?