12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

demonstration on how to set up a table on the videodisplay.Subroutine lines 900 and 910 generate randomnumbers in the range of zero to 99. Lines 60 and 70 findhow many times through the random number generator ittakes to get a number greater than 50. The answer isstored in A.Lines 90and 100 do it again and store the answer inB.Line 40 prints the table heading and line 110 displaysthe results.Program Listing5 RAND10 LET A='120 LET B='130 LET T='140 PRINT CHR$ 166,CBR$ 16750 GOSUB 90060 IF X>50 THEN LET A=A+l70 IF X>50 THEN GOTO 5080 GOSUB 90090 IF X>SO THEN LET B=B+l100 IF X>50 THEN GOTO 80110 PRINT A,B120 IF T=lO THEN STOP130 LET A='1140 LET B='1150 LET T=T+l160 GOTO 20900 LET X=INT(lOO*RND)910 RETURN85 Go To BlackThere are ways to black-out your screen without goingto the graphics mode. Line 150 is a freeze-frame.106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!