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.

120 LET R::R+l125 LET W=j130 LET Z=ll*Z135 PRINT R;n RIGHT SO FARn140 GOTO 30145 PRINT nyou HAD •;R;n RIGHTn150 PRINT •LETS START OVER"155 GOTO 1044 Number Reverser IThis program generates a series of random numbersand then adds them up. Then it reverses the order of thedigits in the total. Creates a very strange random number!Lines 20-40 generate three random single-digitnumbers. Line 50 is a trap to make sure they are between1 and 9 with no zeros showing up.Line 60 changes the number values into strings sothey can be tied together as three digits at line 75'. Line 85takes those three-digit strings from line 75 and turns themback into numerical values.Line 10 5, is a time delay loop to stall a moment beforeline 110 pushes action back up to line 10 for a new start.Program Listing10 CLS20 LET J=INT(lO*RND)30 LET K=INT(lO*RND)40 LET L=INT(lO*RND)50 IF J

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

Saved successfully!

Ooh no, something went wrong!