diff --git a/two-liners/README.entropy b/two-liners/README.entropy new file mode 100644 index 00000000..dd4780cc --- /dev/null +++ b/two-liners/README.entropy @@ -0,0 +1,70 @@ + Apple II Entropy Demo (128B) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + BASIC version -- Dave McKellar + 6502 Assembly Version -- Deater (Vince Weaver) + +Webpage +======= +http://www.deater.net/weave/vmwprod/entropy_demo/ + +Background +========== + +Back in the day people would challenge themselves to write one or two line +BASIC programs that did impressive things. + +One of my favorite is "Entropy" by Dave McKellar from Toronto. + +This two-line BASIC program can be found on the Beagle Brother's +Apple Mechanic Disk. + +I thought it would be interesting to see if I could convert it to 6502 +assembly language. + + +The original code looks like this: + +1 ROT=0:FOR I=1 TO 15: READ A,B: POKE A,B: NEXT: DATA + 232,252,233,29,7676,1,7678,4,7679,0,7680,18,7681,63, + 7682,36,7683,36,7684,45,7685,45,7686,54,7687,54,7688,63, + 7689,0 +2 FOR I=1 TO 99: HGR2: FOR E=.08 TO .15 STEP .01: + FOR Y=4 to 189 STEP 6: FOR X=4 to 278 STEP 6: + SCALE=(RND(1)RND_EXP ; point (Y,A) to RND value lda #