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.

Program Listing10 FOR L=f.J TO 255 STEP 2120 FOR N=L TO L+2130 PRINT N,CHR$ N40 PAUSE 6050 NEXT N60 CLS70 NEXT L23 One-Time PasswordIf you don't want unauthorized use of your programs,insert a requirement that a user know a password. Thisparticular routine allows only one try at entering a correctpassword.For our password, we have selected "elephant" andstored it in line 30. You can change the password towhatever you like.If a correct attempt at entering the password ismade, program action will progress to line 100. Otherwise,action drops to line 40 and action ends.Program Listing10 PRINT "WHAT IS THE PASSWORD ?"20 INPUT A$30 IF A$="ELEPHANT" THEN GOTO 10040 STOP100 PRINT "YOU GOT IT RIGHT"110 PRINT "A PROGRAM WOULD RUN"24 Three-Tries PasswordHere the software lets you try three times to enter thecorrect password. You don't get to go forward with the39

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

Saved successfully!

Ooh no, something went wrong!