Sonnenmulde Website | Sonnenmulde Archive

Welcome to #MARCHintosh 2024!

Celebrating classic Macs in March.

marchintosh-logo


        

10 PRINT CHR$(205.5+RND(1)); : GOTO 10

A Commodore 64 Screen with startup message, the 10 PRINT program typed in and a developing maze
            from running the program.

A Commodore 64 Screen with startup message, the 10 PRINT program typed in and a developing maze from running the program. (full image)

This short and somewhat cryptic line of BASIC made famous by the release of the similarily named 2012 10 PRINT book has become an icon of generative computer art. The lone, simple line of recursive code for Commodore BASIC creates an ever changing, astonishingly complex maze on the screen of Commodore Computers from the beginning of the personal computer era.


Jump to top >

10 PRINT on Macintosh

For this year's #MARCHintosh I asked myself, why should only the 8-bitters have all the fun? Sure, the Mac promised to not ever bother users with all that cryptic commandline stuff. But hey, that has been long ago and I don't care anyway ;-)

So 10 PRINT for Mac it shall be. The first step is getting a BASIC interpreter. I took the easiest route and chose the one that I considered to be the quickest to learn and use: Chipmunk Basic. It is still developed today, available for multiple platforms and most importantly, runs on Macs starting from System 6 up to the most modern OS releases.


Jump to top >

The Oneliner

        

10 PRINT CHR$(47+(INT(RND(1)*2)*45)); : GOTO 10

Compact Macintosh black & white screen showing the output of a Macintosh version of the 10 PRINT
            program within a window.

Compact Macintosh black & white screen showing the output of its version of the 10 PRINT program within a window. (full image)

The image above shows the output of the 10 PRINT program written in Chipmunk Basic on Macintosh. The difference can easily be spotted - it is missing the original's striking appearance. The reason for this is, that the original uses characters from Commodore's PETSCII character set that are not available on other platforms. This is not only true for Chipmunk Basic on the Mac, but also for many other systems, including even the Apple II.

Therefore the characters are approximated by using forward as well as backslashes, characters available on virtually any system that runs BASIC. For this reason this variant of 10 PRINT is very portable and already mentioned in the original 10 PRINT book

Solving this issue would only be possible by replacing the characters in use with custom made ones. Chipmunk Basic does not support this, but other BASIC dialects might.


Jump to top >

Making it look nice

Download the Code and rename to moreprint.bas: moreprint.txt


Compact Macintosh black & white screen showing output that looks much more like the original
            10 PRINT program. Notice part of the system RAM visible to the right.

Compact Macintosh black & white screen showing output that looks much more like the original 10 PRINT program. Notice part of the system RAM visible to the right. (full image)

This looks more like it, but it is by no means a one line program anymore. 22 lines of BASIC (not counting comments) were used to manually draw the diagonal lines. They could surely be condensed a bit more, but why bother if it won't be a onleliner anyway. Line for line drawing is also much slower than just writing text. On a 8 Mhz Macintosh Classic it is creepingly slow, faster 68k Macs, especially 68040 based ones are pretty quick though.

One more thing can be seen at the right edge of the output window. It seems that a Mac Classic with 4 MB of RAM does not have enough memory for the window's content. A bit of memory is mapped into the visible area! There is another part just "below" the visible window that even shows acitivty while BASIC is drawing its lines.

A Mac II with 8 MB of RAM does not show this behaviour (image below), making the "too little RAM theory" plausible.


Macintosh II colour screen showing output that looks much more like the original 10 PRINT program.
        Notice there is no system RAM visible to the right.

Macintosh II colour screen showing output that looks much more like the original 10 PRINT program. Notice there is no system RAM visible to the right. (full image)

Download

Download both versions as compressed/binhexed Stuffit Archive ready to transfer to real old Macintosh hardware: 10print.sit.hqx


Jump to top >



Except where otherwise noted, all content on this site has been created
by me, Andreas Schreiner and is licensed under a
Creative Commons Attribution 4.0 International License.

I can be found on the 68mkla.org forums
and in the Fediverse: https://fed.sonnenmulde.at/profile/andi

#MARCHintosh Event Logo concept and design by Javier Rivera
YouTube: #https://www.youtube.com/channel/UC550QsLjbk-zxUv4u717EJQ
Twitter: #@javierivera

The "Made with a Mac" badge has been made by someone too for sure.
But who did it has probably been lost to history. *shrug*

Made with a Mac animated badge

Let iCab smile badge


Jump to top >