žunny poems program IE next few pages show you how to write a program which can compose (ol poems A version of this program frst appeared m the Usborne Guide me, puters That book showed how to make a "paper computer" which da simple version of this program. Here you can find out how iurite !he same program in BASIC. Datalines A YOUNG MAN FROM program tells you which to select. The number spinner is a random number ET B-B.] I—————— rine 60 kospa comt of the number ci data words KE N—INT(RND(1)a441) ]———— Givesa -id Gives a random number between | and 4 "ni data vrords trom row B s: j ji pb; 14 ib—3 THEN GOTO 60 Lines 90 and 100 send it back to select another ad Hm GOTO 60 data line. STO — L BACI LAK izensy to tranalate storing and picking out the data hnesand ; Ene lines 50 and 80 are more words which are needed for each line of > "€ computer needs a way of the poem. ou one >->—>—— ž—ž>-—-—— —ČOz«-—ž>hk nk— 2 Giving the computer data 50 READ A$ 180 DATA THERE WAS A YOUNG MAN FROM, WHO, HIS 190 DATA ONE NIGHT AFTER DARK, AND HE To give the computer the data lines and words you can use READ... DATA.Each variable called A$. A variable containing DATA line and stores it in the variable. e.g. READ A$(3) gives HIS." 3 EH Z km 8%. tum 5 2 Je ne dnar AA ses UI SSTU m rano AM on j | ogla) JS] rane vz ISTA kus b] J | dimensional array. Here, each data itemis arrays,too, using a number variable, referred to by the number of the row and e.g. N(5,7). 4 Putting the data in the variables 110 DATA IN THE PARK, LIKE A OUARK, FOR A LARK, WITH A BARK 120 DATA WHERE IT WENT, ITS INTENT, WHY IT WENT, WHAT IT MEANT To read each data item into the variable and aj loop for the cotumn number. Each | you need to be able to alter the numbersin timethelloop is carried cut the ] loop is | brackets after READ. You can do thiswith repeated four times - once for each olthe | loops. B$ needs nested loops as shown columns in a row. above with an | loop for the row number 39 | "Sinclair computers deal with variables in a different way and this program will not run ona | Sinclair. You can find out more about this over the page. 4m ME ma mid GO Di ME ME UE Mu vza mia —-ao -—-o—e — "——e -—ž— em 1 1 r—-—o— — o -