Elegant "10 PRINT" maze on the ZX81

Here’s are all the 30 classic patterns (as described by Sébastien Truchet in “Mémoire sur les combinations” in 1704) on the PET:

https://masswerk.at/pet/?prg=truchet-pet&screen=white

(Port of an original C64 program by Robin from the “8-bit Show and Tell” YT channel; press any key to advance to the next pattern. – It’s a bit nicer on the PET, since the characters are rendered at somewhat better resolution as compared to the C64, which features a bolder font.)

2 Likes

Here’s a ZX Spectrum version that scrolls infinitely:

10 FOR n=0 TO 31: PRINT " ▌▄"(1+RND);: NEXT n: POKE 23692,255: GO TO 10

And a ZX81 version that does the same:

10 PRINT AT 21,0;
20 FOR N=0 TO 31
30 PRINT " ▌▄"(1+RND);
40 NEXT N
50 SCROLL
60 GO TO 20
1 Like

Very nice. Since the TRS-80 supports RND(N) you can get away with:

0 PRINTCHR$(110+RND(2)*39);:GOTO

And throwing in GOTO defaulting to line 0 which I think will work on the C-64 as well.