Here - 1000 BiT

Here - 1000 BiT Here - 1000 BiT

11.07.2015 Views

TO REACH A SPOT ON THE SCREEN:1. Start your PRINT line with a home cursor, "hm", or a clear screen, "clr".2. Then move the cursor down as far as you want.3. Then PRINT right CRSR characters to move over as far as you want. (Or you can usespaces instead of "rt" characters.)4. Then PRINT what you want.A MOVING PICTURETry this program: 10REM ::: BIRD:::20 PRINT'clr dn dn dn dn dn dn";25 PRINT'Vt rt rt rt rt rt rt Dur";30 PRINT1 ***-* If If lf";:REM WINGS DOWN40 FOR T=1 TO 200.-NEXTT50 PRINT" ^•-* If If lf';:REM WINGS UP60 FOR T=1 TO 200:NEXTT70 GO TO 30Here "If If If' means three left CRSR characters (remember to use the SHIFT key). Weuse "rt rt rt" for right CRSR characters.Do you remember what to do when you see "pur"? If you forgot, look at Lesson 2.Which lines are the delay loops?If you do it correctly, you will get a single purple bird slowly flapping its wings in themiddle of the screen. If you get a lot of birds, check that you have the ";" at the ends ofthe PRINT lines, and that lines 30 and 50 have the birds, three left CRSR characters, andno spaces.How does it work?Read lines 30 and 50 character by character.Line 30 prints left wing, body, right wing. Now the invisible PRINT cursor is to the rightof the bird, so three "If CRSR characters bring the cursor back over the leftwing of the bird.

Line 40 waits for you to see this bird with its wings down.Line 50 prints a bird with wings up, on top of the first bird. Then it moves the cursorback over the left wing of the bird.Line 60 waits for you to see this bird with its wings up. Then the cycle repeats.ERASING OLD PICTURESIn "BIRD" we erased the "down wing" bird by writing an "up wing" bird over it.Suppose we want the bird to fly away?We must erase the old bird with spaces before we print the new bird.Change lines 10,20,25,45 and 65 in "BIRD":10REM FLYAWAY20 PRINT'clr dn dn dn dn ... dn"; (22 of them)25 PRINT"pur";30 PRINT" "-•-* If If If"; :REM PRINT DOWN WINGS40 FOR T=1 TO 200:NEXT T :REM DELAY LOOP45 PRINT'sp sp sp If If up";:REM ERASE BIRD, GO UP50 PRINT' ^-9^ If If If"; :REM PRINT UP WINGS60 FOR T=1 TO 200:NEXT T65 PRINT'sp sp sp If If up";70 GOTO 30Assignment 16:1. Write a program which makes a ball move across the screen, from left to right. Be sureto erase the old ball before printing the new ball. Then change the program so the ballmoves from right to left.2. Write a program to make your first name print on the screen red, then blink to green,back to red, etc. The name doesn't move on the screen.97

Line 40 waits for you to see this bird with its wings down.Line 50 prints a bird with wings up, on top of the first bird. Then it moves the cursorback over the left wing of the bird.Line 60 waits for you to see this bird with its wings up. Then the cycle repeats.ERASING OLD PICTURESIn "BIRD" we erased the "down wing" bird by writing an "up wing" bird over it.Suppose we want the bird to fly away?We must erase the old bird with spaces before we print the new bird.Change lines 10,20,25,45 and 65 in "BIRD":10REM FLYAWAY20 PRINT'clr dn dn dn dn ... dn"; (22 of them)25 PRINT"pur";30 PRINT" "-•-* If If If"; :REM PRINT DOWN WINGS40 FOR T=1 TO 200:NEXT T :REM DELAY LOOP45 PRINT'sp sp sp If If up";:REM ERASE BIRD, GO UP50 PRINT' ^-9^ If If If"; :REM PRINT UP WINGS60 FOR T=1 TO 200:NEXT T65 PRINT'sp sp sp If If up";70 GOTO 30Assignment 16:1. Write a program which makes a ball move across the screen, from left to right. Be sureto erase the old ball before printing the new ball. Then change the program so the ballmoves from right to left.2. Write a program to make your first name print on the screen red, then blink to green,back to red, etc. The name doesn't move on the screen.97

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

Saved successfully!

Ooh no, something went wrong!