11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

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.

THE STEP COMMANDThe computer was counting by one's in the above programs. To make it count by two's,change line 30 to this:30 FOR 1=10 TO 30 STEP 2Assignment 17A:1. Have the computer count by five's from zero to 100.COUNT DOWN LOOPSYou can make the computer count down by using a negative STEP.Try this: 10 REM ** APOLLO 11 **15 POKE 53281,1520 PRINT'clr"30PRINT" T MINUS 12 SECONDS AND COUNTING"35 FOR 1=1 TO 750:NEXT I40 FOR T=11 TO 0 STEP -150 PRINT "clrdn";T60 FOR 1=1 TO 750:NEXT I:REM TIMING LOOP70 NEXTT80 PRINT "clr dn red ALL ENGINES RUNNING, LIFT OFF."81 FOR 1=1 TO750:NEXTI82 PRINT "clr dn grn WE HAVE A LIFT OFF."83 FOR 1=1 TO 750:NEXT I84 PRINT "clr dn blu 32 MINUTES PAST THE HOUR."85 FOR 1-1 TO 750:NEXT I86 PRINT "clr dn cyn LIFT OFF ON APOLLO 11."90 POKE 53281,0Line 60 is the timing loop for counting seconds. Lines 35,81, 83 and 85 slow down theprinting to "speaking speed."NESTED LOOPSIn this program, we have one loop inside another.The outside loop starts in line 40 and ends in line 70.The inside loop is in line 60.These are "nested loops." It is like the baby's set of toy boxes which fit inside each other.100

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

Saved successfully!

Ooh no, something went wrong!