// SOURCE CODE FOR TURINGS ASSEMBLY LINE // PLATO SYSTEMS // http://WWW.AND-OR.CH/turingsal // http://turingsal.and-or.ch // THE TUTOR CODE // BLOCK A: GAMELOGIC ------------------------------------------------------------ unit game * ----------- www.and-or.ch ----------------- define disp=n10,pos=n11 define id=n12,name=n13,year=n14 define tasks=n15,errors=n16,end=n17 define done=n18 calc done⇦0 calc tasks⇦0 calc errors⇦0 calc end⇦0 calc id⇦0 define ev1=n1,ev2=n2,ev3=n3 calc disp⇦0 calc pos⇦0 calc ev1⇦-1 calc ev2⇦0 calc ev3⇦1 define keyin=n149 keylist ikeys,s,x,d define dx=n148 calc dx⇦0 * -------------- VISUAL SETUP -------------- at 0,460 write 20201127 TURINGSAL.AND-OR.CH at 0,480 size 2 * write TURINGS ASSEMBLY LINE at 0,430 size 1 write UNIVERSAL MASCHINE IS CALLING! WORK! at 0,0 size 1 write * GAMEARTxELEARNING FROM AND-OR.CH (2020) FOR THE PLATO SYSTEM draw 0,420;500,420 draw 0,380;500,380 rbox 150,375;350,425 * ----------- forward & co ------------ rbox 150,320;360,360 at 200,340 write 1. FORWARD: > at 200,320 write 2. EXECUTE: s or x * --------- VEC SCENE ----------- draw 0,150;500,150 draw 0,80;500,80 draw 0,40;500,40 * --------- SHOW EVENTS ---------------- join dtal join gexec * ---------- show assembly line --------- loop . pause 0.1,keys=ikeys . keytype keyin,s,x,d . do keyin,nopit,gexec,gexec,gforward endloop * ---------- display assembly line content -------- unit dtal calc id⇦ev1 calc pos⇦0 join devent calc id⇦ev2 calc pos⇦1 join devent rbox 150,375;350,425 calc id⇦ev3 calc pos⇦2 join devent end * ----------- go forward ------------- unit gforward if done=0 . calc errors⇦errors+1 endif calc done⇦0 at 80,280 erase 100 at 150,395 erase 100 calc ev1⇦ev2 calc ev2⇦ev3 * ------------ RANDOMIZE EVENTS - UPDATE ------------ randu ev3,18 join dtal end unit gexec if done=1 . calc errors⇦errors+1 endif calc done⇦1 calc id⇦ev2 calc pos⇦3 join devent draw 150,395;350,395 calc tasks⇦tasks+1 at 400,340 erase 30 write TASKS: show tasks at 400,320 erase 20 write ERR : show errors write write (5) if errors>5 . jump gameover endif if end>0 . jump gameover endif end unit nopit end // BLOCK: CONTENT ------------------------------------------------------------ unit events * ------------ DISPLAY EVENTS ----------------- * id=0-x * pos = 0 - 1/2 - 3 -- 4 unit devent randu dx,510 at 160,400 if pos=0 . at 10,400 endif if pos=2 . at 0,280 . erase 512 . at 360,400 endif if pos=3 . at 100,280 endif erase 100 * -------------------- // BLOCK B: CONTENT ------------------------------------------------------------ unit events * ------------ DISPLAY EVENTS ----------------- * id=0-x * pos = 0 - 1/2 - 3 -- 4 unit devent randu dx,510 at 160,400 if pos=0 . at 10,400 endif if pos=2 . at 0,280 . erase 512 . at 360,400 endif if pos=3 . at 100,280 endif erase 100 * -------------------- if id=0 . if pos<3 . . write % start up . else . . write START WORKING * BE FAST * STEP BYTEP . endif endif if id=1 . if pos<3 . . write % platoiv . else . . write YOU are starting up PLATOIV 1972 . endif endif if id=2 . if pos<3 . . write // destroy planet . else . . write nothing happens. it is a comment . endif endif if id=3 . if pos<3 . . write wait(10) . else . . write YOU wait 10ms. Nothing happens. . endif endif if id=4 . if pos<3 . . write rotate(1.5) . else . . write YOU rotate serve 1.5 degree. Ready for shooting. . endif endif if id=5 . if pos<3 . . write gameloop(); . else . . write YOU process BattleTank, first 3DArcade . . draw dx,100;dx+40,160;dx+90,100 . . draw dx,100;dx+40,160;dx+90,100 . . at 100,100 . . write BATTLE TANK . endif endif if id=6 . if pos<3 . . write erase . else . . write YOU erase all . . at 0,50 . . erase 500,20 . endif endif if id=7 . if pos<3 . . write readMail(); . else . . write "GIRL CALL ME NOW 041 723 22 11" . endif endif if id=8 . if pos<3 . . write showVideo(234234234) . else . . write YOU show a hardcore-porn-video . endif endif if id=9 . if pos<3 . . write % monitoring -start . else . . write YOU start worldwide big brother. NSA + . endif endif if id=10 . if pos<3 . . write % hunt 738371022 . else . . write YOU start the hunt for SNOWDEN. . endif endif join devent1 end // BLOCK D: CONTENT1 ------------------------------------------------------------ unit content1 unit devent1 if id=11 . if pos<3 . . write draw 0,200;510,110 . else . . draw 0,200;510,110 . endif endif if id=12 . if pos<3 . . write doGUI(); . else . . write YOU wait for GUI-Input. Nothing . endif endif if id=13 . if pos<3 . . write % kkrieger . else . . write YOU start the 96kb-demo-fps . endif endif if id=14 . if pos<3 . . write b=b+10 . else . . write YOU added 10. Buffer overflow. Arianne eplodes. . . calc errors⇦errors+1 . endif endif if id=15 . if pos<3 . . write checkProductivity(); . else . . write YOU are unproductive STOP . . calc end⇦15 . endif endif if id=16 . if pos<3 . . write readNote(); . else . . randu n20,5 . . if n20=0 . . . write 'Reduce paperwork' . . endif . . if n20=1 . . . write 'Management calls data cente++r ape mountain' . . endif . . if n20=2 . . . write 'We search a new chief' . . endif . . if n20=3 . . . write 'Reduce works" . . endif . . if n20=4 . . . write 'I hate the new chief officer' . . endif . . if n20=5 . . . write 'Buy stocks, the sell us tomorrow' . . endif . endif endif if id=17 . if pos<3 . . write drawCircle(); . else . . randu n42,20 . . randu n43,400 . . randu n44,200 . . at n43,n44 . . circle n42 . endif endif join devent2 end // BLOCK E: CONTENT 2 ------------------------------------------------------------ unit devent2 if id=18 . if pos<3 . . write sendTweet(); . else . . randu n42,7 . . if n42=0 . . . write 'FoxNews daytime is virtually unwatchable, especially ...' . . endif . . if n42=1 . . . write '911 911 911' . . endif . . if n42=2 . . . write 'You can't read this tweet' . . endif . . if n42=3 . . . write 'She is tough, but she is worth it' . . endif . . if n42=4 . . . write 'Never not' . . endif . . if n42=5 . . . write 'I love to eat this' . . endif . . if n42=6 . . . write 'The mother of all demos still something to look at' . . endif . . if n42=7 . . . write 'register at cyber1.org' . . endif . endif endif end // BLOCK F: GAMEOVER ------------------------------------------------------------ unit gameover size 2 at 0,480 write TURINGS ASSEMBLY LINE at 0,0 size 1 write * GAMEARTxELEARNING FROM AND-OR.CH (2020) FOR THE PLATO SYSTEMS draw 0,420;510,420 draw 0,390;510,390 at 20,395 size 2 write GAME OVER at 20,350 size 1 if end=0 . write TOO MUCH ERRORS . at 20,320 . write SHUTDOWN ... endif if end=15 . write Unproductive . at 20,320 . write YOU were deleted. endif at 20,280 write TASKS: show tasks at 20,260 write ERRORS: show errors at 20,240 write FATAL ERROR: if end>0 . write YES else . write NO endif at 20,100 write PRESS NEXT TO CONTINUE