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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Line 20 generates the numbers. Line 40 selects thetenth number from each set.Program Listing10 LET T=J15 LET V=J20 LET T=INT(lOOO*RND)30 LET V=V+l40 IF (V/lO)=INT(V/10) THEN PRINT V,T50 GOTO 2062 Random SamplerThis program strengthens your confidence in the ran•dom number generator built into your TIMEX computer.It generates 100 numbers between zero and 100 andtells you how many of those are above 49 and how manyare below 50. See the sample RUN for several sets ofresults in our recent test.Program Listing10 LET N=Jj15 LET X=J20 LET Y=J25 FOR L=l TO 10030 LET X=INT(lOO*RND)35 IF X49 THEN LET N=N+l45 NEXT L50 PRINTY;• YES"55 PRINT N;" NO"60 PRINT65 GOTO 1078

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

Saved successfully!

Ooh no, something went wrong!