Advertisement
plirof2

ZX Spectrum BASIC CLASSROOM lesson #B v003c

Feb 16th, 2022 (edited)
521
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ________UNIT 1.1 ______
  2. 10 PRINT "HELLO";
  3. 40 GO TO 10
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. ________UNIT 1.2 ______
  13. 10 PRINT "HELLO";
  14. 20 PAPER 4
  15. 40 GO TO 10
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. ________UNIT 1.3 ______
  24. 10 PRINT "HELLO";
  25. 20 PAPER RND*7
  26. 40 GO TO 10
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. ________UNIT 1.4 ______
  35. 10 PRINT "HELLO";
  36. 20 PAPER RND*7
  37. 30 BORDER RND*7
  38. 40 GO TO 10
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. ________UNIT 1.5 ______
  47. 10 PRINT "HELLO";
  48. 20 PAPER RND*7
  49. 30 BORDER  RND*7
  50. 40 GO TO 20
  51.  
  52.  
  53.  
  54.  
  55.  
  56. ________UNIT 1.5b ______
  57. 5 INPUT "Type your name(s)";A$
  58. 10 PRINT "HELLO ";A$
  59. 20 PAPER RND*7
  60. 30 BORDER  RND*7
  61. 40 GO TO 20
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ________UNIT 1.6 ______
  71. 10 PRINT "HELLO";
  72. 20 PAPER RND*7:CLS
  73. 30 BORDER  RND*7
  74. 40 GO TO 20
  75. 50 REM Shift+Space
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. ________UNIT 1.7 ______
  88. 10 PRINT "Your names--";
  89. 20 PAPER RND*7
  90. 30 BORDER  RND*7
  91. 40 GO TO 20
  92.  
  93.  
  94.  
  95.  
  96. _______________________________________________________
  97.  
  98. ________UNIT 2.1 ______
  99. 10 LET A = 123
  100. 20 PRINT "Apple price A="; A
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. ________UNIT 2.2 ______
  109.  
  110. 10 LET A = 123
  111. 15 LET T$="Apple price A="
  112. 20 PRINT T$; A
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120. ________UNIT 2.3 ______
  121.  
  122. 10 LET A = 123
  123. 15 LET T$="Apple price A="
  124. 20 PRINT T$; A
  125. 30 LET A = A + 1
  126. 40 PRINT "New ";T$;A
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. ________________________________________________
  135. ________UNIT 3.1 _IF____
  136. 10 LET A = 123
  137. 20 IF A = 124 THEN PRINT "TO 'A' EINAI ISO ME 124"
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145. ________UNIT 3.2 ______
  146. 5 REM >  <   =   <>  >=  <=  
  147. 10 LET A$ = "YES"
  148. 20 IF A$ = "YES" THEN PRINT "APANTHSES 'NAI'"
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. ________________________________________________
  158. ________UNIT 4.1 _LOOPS_____
  159. 10 LET I = 1
  160. 20 PRINT "I = "; I
  161. 30 LET I = I + 1
  162. 40 IF I <= 10 THEN GOTO 20
  163.  
  164.  
  165. //20 PRINT "The value of I = "; I
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174. ________UNIT 4.2 ______
  175. 10 FOR I = 1 TO 10
  176. 30 PRINT "I = "; I
  177. 50 NEXT I
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. ________UNIT 4.2 ______
  188. 10 FOR I = 1 TO 10 STEP 2
  189. 30 PRINT "I = "; I
  190. 50 NEXT I
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ________UNIT 4.3 ___NESTED LOOPS___
  203. 10 FOR I = 1 TO 10
  204. 20 FOR K = 1 TO 10
  205. 30 PRINT X;"*";K;"=";X*K
  206. 40 NEXT K
  207. 50 NEXT I
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219. ________UNIT 4.4 ______
  220.  
  221. 10 FOR I = 100 TO 0 STEP -5
  222. 30 PRINT "The value of I = "; I
  223. 50 NEXT I
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238. ________________________________________________
  239. _______UNIT 5.1 udg____(COPY/PASTE THIS)__________
  240. 10 GO SUB 1000
  241. 20 LET x=15
  242. 30 LET y=10
  243. 40 LET b$=INKEY$
  244. 50 IF b$="d" AND x<26 THEN LET x=x+1
  245. 60 IF b$="a" AND x>1 THEN LET x=x-1
  246. 70 IF b$="w" AND y>1 THEN LET y=y-1
  247. 80 IF b$="s" AND y<20 THEN LET y=y+1
  248. 90 PRINT AT y,x;CHR$ 157
  249. 100 GO TO 40
  250. 1000 FOR c=0 TO 7
  251. 1010 READ n
  252. 1020 POKE USR ("n")+C,n
  253. 1030 NEXT c
  254. 1040 DATA BIN 00000000
  255. 1050 DATA BIN 01100110
  256. 1060 DATA BIN 01100110
  257. 1070 DATA BIN 00000000
  258. 1080 DATA BIN 00000000
  259. 1090 DATA BIN 01100110
  260. 1100 DATA BIN 00111100
  261. 1110 DATA BIN 00000000
  262. 1120 RETURN
  263.  
  264.  
  265. ___mod :__
  266. 90 PRINT INK RND*6;AT a,b;CHR$ 157
  267.  
  268.  
Advertisement
RAW Paste Data Copied
Advertisement