Advertisement
Shaun_B

50th Anniversary of BASIC programming

May 2nd, 2014
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XBasic 2.33 KB | None | 0 0
  1. 0 poke 53265,peek(53265) and 239:poke 53280,6:poke 53281,6:dim a(3):a(0)=2
  2. 1 print chr$(147);".this is one of my favourite 'routines' which celebrates";
  3. 2 print" the 50th anniversary of the programming language basic. it has been written ";
  4. 3 print"for the supercpu, and will work with other ";
  5. 4 print"accelerator devices that support the famous c64. why not just use 1mhz, you";
  6. 5 print" may ask? well, i don't see the point, and with a bit more processing ";
  7. 6 print"grunt, i can be lazy and write very unoptimised";
  8. 7 print" basic. it runs very slow @ 20mhz anyway! greetings ";
  9. 8 print"go out to mike d, allan b, nigel p, peter b, wayne w";
  10. 9 print" and my biggest fan...mum! happy birthday basic, and happy birthday ";
  11. 10 print"scpu (slightly early, i know). keep programming. read micro";
  12. 11 print" mart. and send me abuse on twitter @shaunbebbers. byez...*"+chr$(142)+chr$(8);
  13. 12 sc=1024:m=49152:a(1)=-80:a(2)=-2:a(3)=80:wl=160:hl=32:for i=0 to 39:poke 56256+i,3:next
  14. 13 poke m,peek(sc):if peek(sc)<>42 then sc=sc+1:m=m+1:goto 13
  15. 14 sc=1024:a=sc+81:for i=0 to 959:poke 55296+i,14:poke sc+i,32:next:for x=0 to 23
  16. 15 for i=sc to sc+38:poke i,160:next i:sc=sc+40:next x:sc=1024:poke a,4:poke 53265,peek(53265)or 16
  17. 17 j=int(rnd(1)*4):x=j
  18. 18 b=a+a(j):if peek(b)=wl then poke b,j:poke a+a(j)/2,hl:a=b:goto 17
  19. 19 j=(j+1)*-(j<3):if j<>x then 18
  20. 20 j=peek(a):poke a,hl:if j<4 then a=a-a(j):goto 17
  21. 21 poke a,81:j=2
  22. 22 b=a+a(j)/2:if peek(b)=hl then poke b,81:poke a,hl:a=b:j=(j+2)+4*(j>1)
  23. 23 j=(j-1)-4*(j=0):m=49152:i=peek(m)
  24. 24 m=m+1:if peek(m)<>42 then poke m-1,peek(m):goto 24
  25. 25 poke m-1,i:poke m,42:for i=0 to 36:poke 1985+i,peek(49152+i):next:goto 22
  26. 1000 rem by donkeysoft mmxiv to celebrate 50 years of basic
  27. 1001 rem for the commodore 64 + supercpu or other accelerator
  28. 1002 rem highlighted with XBasic as there was no Commodore BASIC option
  29. 1003 rem lines zero to 13 copies the message to ram after switching off the screen
  30. 1004 rem line 12 also colours the bottom row of the screen cyan
  31. 1005 rem line 14 - 15 fills the area to be used for then maze and then switches the screen back on
  32. 1006 rem line 17 - 20 generates the maze
  33. 1007 rem lines 21 - 23 moves the lost ball around the maze to the boundaries
  34. 1008 rem lines 23 - 24 shuffles the scrolly message in ram
  35. 1009 rem line 25 outputs the first 37 characters of the scrolly and loops back to 22
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement