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.

zero is entered, the computer will jump out of the entry cycleand on to further action.This program totals numbers as they are added andaccumulates them in memory location B. If one of thenumbers entered is a zero alone, then line 110 will spot itand send the computer on down to line 200, breaking theentry cycle.Naturally, you can't use a zero in a string of numbersto be added since zero causes the computer to quit enteringand get on with displaying.Program Listing10 LET B=j20 PRINT nGIVE ME A NUMBER: •;100 INPUT A110 IF A=j THEN GOTO 200120 PRINT A130 LET B=B+A140 GOTO 20200 PRINT210 PRINT220 PRINT nTOTAL OF NUMBERS = ·~B29 Superior Decision MakerRemember that YES/NO Executive Decision Makerwhich was so popular? In this superior edition, a choiceof eight replies is possible.Program Listing10 DIM D$(8,16)20 RAND100 LET D$(l)=•YESn110 LET D$(2)=•FIRE SOMEONE•120 LET D$(3)= 0 PASS THE BUCKn130 LET D$(4)=•MAYBE 0140 LET D$(5)=•REORGANIZEn150 LET D$(6)=•Non43

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

Saved successfully!

Ooh no, something went wrong!