Chapter 3
1) Modify the first program to read "BBC BASIC" instead of "BBC".
2) Insert TABs into the print statements to print BBC BASIC starting at row 10, column 10 in the output window.
REM My first program PRINT "BBB BBB 44 W W" PRINT "B B B B 4 4 W W" PRINT "BBB BBB 4 4 W W W" PRINT "B B B B 44444 W W W" PRINT "BBB BBB 4 WW WW" END
REM My first program PRINT TAB(10,10);"BBB BBB 44 W W" PRINT TAB(10,11);"B B B B 4 4 W W" PRINT TAB(10,12);"BBB BBB 4 4 W W W" PRINT TAB(10,13);"B B B B 44444 W W W" PRINT TAB(10,14);"BBB BBB 4 WW WW" END
Chapter 4
1) Modify the area program to give the circumference of a circle 3.14159*diameter.
2) Print the area of a rectangle, when given the width and height.
REM Circumference of a circle Diameter=5 Circumference=3.14159*Diameter PRINT "The circumference is ";Circumference END
3) Assign a string variable to contain your name and output:
REM Area of a rectangle Width=5 Height=10 Area=Width*Height PRINT "The area is ";Area END
where xxxx is, of course, your name.
Hello, xxxx
Chapter 5
REM Print my name Name$="Justin Time" PRINT "Hello, ";Name$ END
2) Write a program that uses RND to simulate two six-sided dice being thrown. Print the results for each die and the total.
REM Area of a circle Radius=5 Area=PI*Radius^2 PRINT "The area of your circle is ";Area END
3) Verify that the following formula is true:
REM Tumblin' Dice Die1%=RND(6) Die2%=RND(6) PRINT "Total ";Die1%+Die2% END
The easiest way at this stage is to print the results and compare them visually.
LOG(X)=LN(X)/LN(10)
Chapter 6
REM Verify LOG(X)=LN(X)/LN(10) X=1.234 PRINT LOG(X) PRINT LN(X)/LN(10) END
All names are 4 characters in length including a space if necessary. Given a number for a day, use MID$ to extract the correct abbreviation for the day.
"Sun Mon TuesWed ThurFri Sat"
(DayNumber-1)*4+1
2) Set a string to hold your first name. Use MID$ and ASC to find the ASCII codes of the letters in the name.
REM Day name Day$="Sun Mon TuesWed ThurFri Sat " DayNum=3 DayName$=MID$(Day$,(DayNum-1)*4+1,4) PRINT "Day number ";DayNum;" is ";DayName$ END
I hope you used copy and paste for this one. You could also pull each letter out to a separate string like this:
REM ASCII Codes in My Name Name$="Peter" PRINT MID$(Name$,1,1);" has code "; PRINT ASC(MID$(Name$,1,1)) PRINT MID$(Name$,2,1);" has code "; PRINT ASC(MID$(Name$,2,1)) PRINT MID$(Name$,3,1);" has code "; PRINT ASC(MID$(Name$,3,1)) PRINT MID$(Name$,4,1);" has code "; PRINT ASC(MID$(Name$,4,1)) PRINT MID$(Name$,5,1);" has code "; PRINT ASC(MID$(Name$,5,1)) END
3) Set three strings to hold your first name, second name (if you haven't got one, make it up) and surname. Use LEFT$ to find your initials and concatenation to create a new string in the format "R. T. Russell".
Letter$=MID$(Name$,1,1) PRINT Letter$;" has code ";ASC(Letter$)
Chapter 7
REM Initials First$="Johann" Second$="Sebastian" Surname$="Bach" Name$=LEFT$(First$,1)+". " Name$=Name$+LEFT$(Second$,1)+". " Name$=Name$+Surname$ PRINT Name$ END
2) Modify the Changing colours program to produce new random colours by using three RND(255) statements in the call on lines 2 and 5.
REM Different MODES MODE 1 PRINT "Hello, World" WAIT 200 MODE 2 PRINT "Hello, World" WAIT 200 MODE 3 PRINT "Hello, World" WAIT 200 MODE 4 PRINT "Hello, World" WAIT 200 MODE 5 PRINT "Hello, World" WAIT 200 MODE 6 PRINT "Hello, World" WAIT 200 END
With the window still open, RUN this several times to get different colours.
REM Changing colours COLOUR 3,RND(255),RND(255),RND(255) REM Now we've set the colour change to it COLOUR 3 PRINT "Hello, World" COLOUR 3,RND(255),RND(255),RND(255) PRINT "Hello, World" COLOUR 0 END
2) Have a program prompt to enter your full name. Print the number of characters (including spaces) in the name.
REM Volume of a cylinder INPUT "Enter the radius " Radius INPUT "Enter the length " Length Volume=PI*Radius^2*Length PRINT "The volume is ";Volume END
Chapter 9
REM Length of name INPUT LINE "Enter your name, please " Name$ PRINT "Thank you ";Name$ PRINT "Your name has ";LEN(Name$);" characters." END
Can you write the program that produces the above screen? Allow one INPUT for each number, one INPUT for the operations. Use IF to select the correct PRINT statement and result, then another INPUT to ask for another go. Extra marks if you expand to include multiply and divide.
Enter first number: 5 Enter second number: 6 Enter 1 to add or 2 to subtract: 1 5 + 6 = 11 >RUN Enter first number: 45 Enter second number: 55 Enter 1 to add or 2 to subtract: 2 45 - 55 = -10
After this the second one is easy.
REM Basic calculator INPUT "Enter first number " Num1 INPUT "Enter second number " Num2 INPUT "Enter 1 to add or 2 to subtract: " Op% IF Op%=1 THEN PRINT Num1;" + ";Num2;" = ";Num1 + Num2 ENDIF IF Op%=2 THEN PRINT Num1;" - ";Num2;" = ";Num1 - Num2 ENDIF END
Chapter 10
REM Basic calculator INPUT "Enter first number " Num1 INPUT "Enter second number " Num2 PRINT "Enter 1 to add, 2 to subtract" INPUT " 3 to multiply, 4 to divide: " Op% IF Op%=1 THEN PRINT Num1;" + ";Num2;" = ";Num1 + Num2 ENDIF IF Op%=2 THEN PRINT Num1;" - ";Num2;" = ";Num1 - Num2 ENDIF IF Op%=3 THEN PRINT Num1;" * ";Num2;" = ";Num1 * Num2 ENDIF IF Op%=4 THEN PRINT Num1;" / ";Num2;" = ";Num1 / Num2 ENDIF IF Op%<1 OR Op%>4 THEN PRINT "Sorry, invalid operation." ENDIF END
1 - Hire a yes man 2 - Fire someone 3 - Delegate 4 - Cancel all overtime 5 - Give yourself a rise 6 - Raid the pension fund
Chapter 11
REM Decision maker PRINT "Here is your decision for the day" Dec%=RND(6) CASE Dec% OF WHEN 1 : PRINT "Hire a yes man" WHEN 2 : PRINT "Fire someone" WHEN 3 : PRINT "Delegate" WHEN 4 : PRINT "Cancel all overtime" WHEN 5 : PRINT "Give yourself a rise" WHEN 6 : PRINT "Raid the pension fund" ENDCASE END
1 * 5 = 5 2 * 5 = 10 ... 12 * 5 = 60
2) Use two nested FOR loops to draw a rectangle on the screen by using a line like PRINT TAB(X,Y);"*"
REM 5 times table FOR I%=1 TO 12 PRINT I%;" * 5 = ";I%*5 NEXT I% END
Or, instead of clearing the screen, you could just offset the rectangle:
REM Print a rectangle INPUT "Enter Width " Width% INPUT "Enter Height " Height% CLS FOR Y%=1 TO Height% FOR X%=1 TO Width% PRINT TAB(X%,Y%);"*" NEXT X% NEXT Y% END
Chapter 12
REM Print a rectangle INPUT "Enter Width " Width% INPUT "Enter Height " Height% FOR Y%=1 TO Height% FOR X%=1 TO Width% PRINT TAB(X%+5,Y%+5);"*" NEXT X% NEXT Y% END
2) Write a program that will ask for a number. Add this number to a running total. Repeat until the number entered is 0. Print the result.
REM Find the code REPEAT INPUT "Enter a string " MyString$ IF LEN(MyString$) > 0 THEN A$=LEFT$(MyString$,1) PRINT A$;" has ASCII code ";ASC(A$) ENDIF UNTIL LEN(MyString$)=0 END
Chapter 13
REM Totalizer Total=0 REPEAT INPUT "Enter a number " Num Total+=Num UNTIL Num=0 PRINT "Total entered = ";Total END
2) Make a simple drawing program. Use X% and Y% in a TAB statement to plot an 'X' on the screen. When you press the arrow keys, adjust X% or Y% according to the key pressed. For example, if you press left, decrease X%, down - increase Y%. Plot an 'X' at the new position so you can leave a trail on the screen. Restrict the area in which you can draw to a 20 * 20 grid.
REM Number filter Total$="" DP%=FALSE PRINT "Type your number or Enter to finish" REPEAT Key%=GET REM Check for numeric characters IF CHR$(Key%)>="0" AND CHR$(Key%)<="9" THEN Total$=Total$+CHR$(Key%) PRINT TAB(0,1);Total$; ENDIF REM Check for decimal point IF CHR$(Key%)="." AND NOT DP% THEN Total$=Total$+CHR$(Key%) DP%=TRUE PRINT TAB(0,1);Total$; ENDIF REM Action backspace only if there's REM something to delete IF Key%=8 AND LEN(Total$)> 0 THEN REM If last character is a point, REM reset flag the DP flag IF RIGHT$(Total$,1)="." DP%=FALSE Total$=LEFT$(Total$) REM Print string with trailing space REM to erase deleted character PRINT TAB(0,1);Total$;" "; PRINT TAB(0,1);Total$; ENDIF UNTIL Key%=13 PRINT '"You entered: ";VAL(Total$) END
Here is the solution using INKEY. If you coded it this way, you probably discovered the importance of a WAIT command to stop the 'X' zipping from one side of the screen to the other.
REM Sketch X%=10 Y%=10 REM Print X in starting place PRINT TAB(X%,Y%);"X" REPEAT Key%=GET REM Move cursor in direction after checking REM we're still in limits CASE Key% OF WHEN 139: IF Y% > 0 THEN Y%-=1 WHEN 137: IF X% < 19 THEN X%+=1 WHEN 138: IF Y% < 19 THEN Y%+=1 WHEN 136: IF X% > 0 THEN X%-=1 ENDCASE REM Print X in new position PRINT TAB(X%,Y%);"X" UNTIL FALSE END
Chapter 14
REM X-A-Sketch X%=10 Y%=10 REM Print X in starting place PRINT TAB(X%,Y%);"X" REPEAT REM Move cursor in direction after checking REM we're still in limits IF INKEY(-58) AND Y% > 0 THEN Y%-=1 IF INKEY(-122) AND X% < 19 THEN X%+=1 IF INKEY(-42) AND Y% < 19 THEN Y%+=1 IF INKEY(-26) AND X% > 0 THEN X%-=1 REM Small delay to stop too many prints WAIT 20 REM Print X in new position PRINT TAB(X%,Y%);"X" UNTIL FALSE END
Set an array to hold these values. Then add to the program so it loops through the values to find and print:
January 105 February 261 March 482 April 195 May 347 June 626
Chapter 15
REM Lolly sales DIM Sales%(6), Month$(12) REM Initialise Sales%() = 0,105,261,482,195,347,626 Month$() = "","January","February", \ \ "March","April","May","June", \ \ "July","August","September", \ \ "October","November","December" REM Set result variables LowestSale% = 9999 LowestMonth% = 0 HighestSale% = -9999 HighestMonth% = 0 Total% = 0 REM Now find the data FOR I%=1 TO 6 IF Sales%(I%) < LowestSale% THEN LowestSale%=Sales%(I%) LowestMonth%=I% ENDIF IF Sales%(I%) > HighestSale% THEN HighestSale%=Sales%(I%) HighestMonth%=I% ENDIF Total%+=Sales%(I%) NEXT I% REM Print the results LoMon$=Month$(LowestMonth%) HiMon$=Month$(HighestMonth%) PRINT "The lowest sales were in ";LoMon$ PRINT "The highest sales were in ";HiMon$ PRINT "The total sales were ";Total% END
2) Write a program that declares such a structure and prompts for the information. Calculate the average grade and print the results.
DIM Pupil{FirstName$, Surname$, Grades%(5)}
3) If you had 20 pupils in a class, how would you make an array of the above structure?
REM Pupil Report DIM Pupil{FirstName$, Surname$, Grades%(5)} REM Collect information INPUT "Enter first name " Pupil.FirstName$ INPUT "Enter surname " Pupil.Surname$ FOR I%=1 TO 5 PRINT "Enter grade for subject ";I%; INPUT " " Pupil.Grades%(I%) NEXT I% Total=0 FOR I%=1 TO 5 Total+=Pupil.Grades%(I%) NEXT I% REM Print a report card PRINT "Name: ";Pupil.Surname$;", "; PRINT Pupil.FirstName$ PRINT "Average grade: ";Total/5 END
or:
DIM Pupil{(20) FirstName$, Surname$, \ \ Grades%(5)}
Chapter 16
DIM Pupil{FirstName$, Surname$, Grades%(5)} DIM Class{(20)}=Pupil{}
2) Write and test PROC_Greater(A%,B%) which compares A% and B%. If the A% > B%, do nothing, if B% > A%, exchange the two values using a local variable. You'll need to pass by reference so the calling program can print the results.
REM Passing a value to a PROC PROC_ScreenSetup(5, "First screen", 0, 130) INPUT A$ PROC_ScreenSetup(10, "Second screen", 1, 135) INPUT A$ REM Restore original colours PROC_ScreenSetup(0, "", 0, 128+15) END DEF PROC_ScreenSetup(Col%,Title$,Fore%,Back%) COLOUR Back% COLOUR Fore% CLS PRINT TAB(Col%);Title$ ENDPROC
Chapter 17
REM Exchange two variables INPUT "Enter value 1 " Num1% INPUT "Enter value 2 " Num2% PROC_Greater(Num1%, Num2%) PRINT Num1%;" is greater than ";Num2% END DEF PROC_Greater(RETURN A%, RETURN B%) LOCAL Temp% REM If greater number is last, swop them IF B% > A% THEN Temp% = B% B% = A% A% = Temp% ENDIF ENDPROC
2) Write a function FN_Lower that accepts a string. It goes through each character in the string and converts all uppercase letters to lowercase. Other characters are left as they are. Return the converted string.
REM FN_YesNo PRINT "Are you sure you want to exit (Y/N)?" IF FN_YesNo THEN PRINT "Fine by me, bye." ELSE PRINT "Sorry, show's over anyway." ENDIF END DEF FN_YesNo LOCAL Reply$, Return% REPEAT Reply$=GET$ UNTIL INSTR("YyNn",Reply$)<>0 IF Reply$="Y" OR Reply$="y" THEN Return%=TRUE ELSE Return%=FALSE ENDIF =Return%
You could also use MID$ to replace the characters in the passed string, like this:
REM FN_Lower INPUT "Enter a string to convert " MyString$ LoString$=FN_Lower(MyString$) PRINT "Converted string: ";LoString$ END DEF FN_Lower(Convert$) LOCAL C$, Code%, Return$, I% Return$="" FOR I%=1 TO LEN(Convert$) REM Get character to work with into REM temporary variable, saves code C$ = MID$(Convert$,I%,1) REM Test character to see if uppercase IF C$>="A" AND C$ <= "Z" THEN REM It is, so convert it REM Get code for character - offset 'A' Code%=ASC(C$)-ASC("A") REM Add value to offset for 'a' C$=CHR$(ASC("a")+Code%) ENDIF REM Now add character to return string Return$+=C$ NEXT I% =Return$
Chapter 18
DEF FN_Lower(Convert$) LOCAL C$, Code%, I% FOR I%=1 TO LEN(Convert$) REM Get character to work with into REM temporary variable, saves code C$ = MID$(Convert$,I%,1) REM Test character to see if uppercase IF C$ >= "A" AND C$ <= "Z" THEN REM It is, so convert it REM Get code for character - offset 'A' Code%=ASC(C$)-ASC("A") REM Add value to offset for 'a' MID$(Convert$,I%,1)=CHR$(ASC("a")+Code%) ENDIF NEXT I% =Convert$
2) Create another alien with its arms pointing down. Use character 241. Modify the animation from 1) to alternate aliens as it moves across the screen.
REM Walking alien MODE 6 OFF VDU 23,240,153,189,219,126,36,60,36,36 PRINT TAB(0,10);CHR$(240) FOR I%=1 TO 19 PRINT TAB(I%-1,10);" " PRINT TAB(I%,10);CHR$(240) WAIT 25 NEXT I% FOR I%=19 TO 0 STEP -1 PRINT TAB(I%+1,10);" " PRINT TAB(I%,10);CHR$(240) WAIT 25 NEXT I% ON END
will tell you if I% is an odd or even number.
I% MOD 2
Chapter 19
REM Walking alien MODE 6 OFF VDU 23,240,153,189,219,126,36,60,36,36 VDU 23,241,24,60,219,255,165,189,36,36 PRINT TAB(0,10);CHR$(240) FOR I%=1 TO 19 PRINT TAB(I%-1,10);" " IF I% MOD 2 = 0 THEN PRINT TAB(I%,10);CHR$(240) ELSE PRINT TAB(I%,10);CHR$(241) ENDIF WAIT 25 NEXT I% FOR I%=19 TO 0 STEP -1 PRINT TAB(I%+1,10);" " IF I% MOD 2 = 0 THEN PRINT TAB(I%,10);CHR$(240) ELSE PRINT TAB(I%,10);CHR$(241) ENDIF WAIT 25 NEXT I% ON END
... or a helicopter depending on how you feel.
2) Here is an incomplete game ...
REM Machine gun FOR I%=1 TO 5 SOUND 0,-15,4,1 SOUND 0,0,0,1 SOUND 0,-15,4,1 SOUND 0,0,0,1 NEXT I% END
The missing lines should look something like this:
If you think it's too easy, change the WAIT 20 line at the top of the main loop or make the road three characters wide.
REM Read character in front of player Ch%=GET(CarX%,1) REM Off road, lose a life IF Ch%<>220 THEN SOUND 0,-15,4,5 Lives%-=1 WAIT 5 ENDIF REM Detect player movement IF INKEY(-26) AND CarX%>5 CarX%-=1 IF INKEY(-122) AND CarX%<34 CarX%+=1
Chapter 20
1) I'm sure you can see lots of improvements here, try adding two more commands,
one to completely clear the grid and one to fill it. You could use C and F to do
this.
The main problem to be aware of here is how to integrate the new options with
the existing program. Looking at the pseudo-code, we can see that there are
three routines to change:
PROC_DrawMainScreen, we need to display the new options so the user knows
they're there.
FN_GetUserAction, allow the user to enter two codes, taking care of upper and
lower cases and assign an action code.
PROC_ProcessAction, deal with the new actions. All that is required here is to
loop through each row and column in the grid, setting or clearing each cell as
the choice dictates. Once finished, we need to call PROC_DrawCharacter which
will refresh the screen.
Rather than reproduce the whole program, here are the updated routines.
2) It's nice to be able to reverse engineer characters too, given the row totals. Modify the project to allow the user to enter a total for the row he's currently on. Then redisplay the character.
REM ***************************************** REM PROC_DrawMainScreen - prints title & help DEF PROC_DrawMainScreen REM Set background colour COLOUR 128+7 CLS COLOUR 0 REM Print title PRINT TAB(15,0);"Character Generator" PRINT TAB(15,1);STRING$(19,"=") REM Print help instructions PRINT TAB(1,3);"Instructions:" PRINT TAB(1,4);"Use arrow keys to move cursor." PRINT TAB(1,5);"Space to toggles selected cell." PRINT TAB(1,6);"C clears grid, F fills it" PRINT TAB(1,7);"X or ESC to exits." ENDPROC REM ***************************************** REM FN_GetUserAction - returns an action code DEF FN_GetUserAction LOCAL Key%,Code% REPEAT REM Wait for keypress Key%=GET REM Translate key press to action code CASE Key% OF WHEN 139: Code%=1 WHEN 137: Code%=2 WHEN 138: Code%=3 WHEN 136: Code%=4 WHEN 32: Code%=5 WHEN 67 OR 99: Code%=6 WHEN 70 OR 102: Code%=7 WHEN 88: Code%=999 WHEN 120: Code%=999 OTHERWISE Code%=0 ENDCASE UNTIL Code%<>0 =Code% REM ***************************************** REM PROC_ProcessAction - actions a valid code DEF PROC_ProcessAction(Code%) LOCAL Row%,Col% CASE Code% OF WHEN 1: PROC_MoveCursor(1) WHEN 2: PROC_MoveCursor(2) WHEN 3: PROC_MoveCursor(3) WHEN 4: PROC_MoveCursor(4) WHEN 5: IF Grid%(Cursor.Col%,Cursor.Row%)=1 THEN Grid%(Cursor.Col%,Cursor.Row%)=0 ELSE Grid%(Cursor.Col%,Cursor.Row%)=1 ENDIF PROC_DrawCharacter WHEN 6: FOR Row%=1 TO 8 FOR Col%=1 TO 8 Grid%(Row%,Col%)=0 NEXT Col% NEXT Row% PROC_DrawCharacter WHEN 7: FOR Row%=1 TO 8 FOR Col%=1 TO 8 Grid%(Row%,Col%)=1 NEXT Col% NEXT Row% PROC_DrawCharacter WHEN 999: REM Set exit flag Exit=TRUE ENDCASE PROC_DrawCursor ENDPROC
Now we have to convert it into binary. Start with a value of 128, the value of the highest bit in an eight bit number, and compare the row value with it. If the row value is greater than or equal to 128, the top bit must be set so we subtract 128 from the row value and set the correct cell in the grid. After this take the value of the next bit down (64) and try again. We keep going until we have done all eight bits. This looks like a job for a FOR loop to me. Here's what we are trying to achieve:
REPEAT Prompt for Row Value Get a value for the current row UNTIL Row Value is valid
If we write all this into the Process Action routine, it starts getting a little ungainly. We'll give the action a new routine, GetRowValue. We're going to need local variables for the Row Value, Column Value, and a loop counter, Column. This is the complete routine, I added it to the bottom of the program:
Set Column Value to 128 FOR each column IF Row Value >= Column Value THEN Set Grid cell at Row, Column Subtract Column Value from Row Value ELSE Reset Grid cell at Row, Column ENDIF Half Column Value NEXT column Draw Character
Of course there are also the other three routines. Here they are:
REM ***************************************** REM PROC_GetRowValue - gets a value for row DEF PROC_GetRowValue LOCAL RowValue%,ColValue%, Col% REM Get a valid value REPEAT PRINT TAB(1,25);SPC(30);TAB(1,25); INPUT "Enter value for row: " RowValue% UNTIL RowValue%>=0 AND RowValue%<=255 PRINT TAB(1,25);SPC(30) REM Convert the number into binary ColValue%=128 FOR Col%=1 TO 8 IF RowValue%>=ColValue% THEN Grid%(Col%,Cursor.Row%)=1 RowValue%-=ColValue% ELSE Grid%(Col%,Cursor.Row%)=0 ENDIF ColValue%=ColValue%/2 NEXT Col% PROC_DrawCharacter ENDPROC
REM ***************************************** REM PROC_DrawMainScreen - prints title & help DEF PROC_DrawMainScreen REM Set background colour COLOUR 128+7 CLS COLOUR 0 REM Print title PRINT TAB(15,0);"Character Generator" PRINT TAB(15,1);STRING$(19,"=") REM Print help instructions PRINT TAB(1,3);"Instructions:" PRINT TAB(1,4);"Use arrow keys to move cursor." PRINT TAB(1,5);"Space toggles selected cell." PRINT TAB(1,6);"C clears grid, F fills it" PRINT TAB(1,7);"V enters a row value" PRINT TAB(1,8);"Press X or ESC to exit." ENDPROC REM ***************************************** REM FN_GetUserAction - returns an action code DEF FN_GetUserAction LOCAL Key%,Code% REPEAT REM Wait for keypress Key%=GET REM Translate key press to action code CASE Key% OF WHEN 139: Code%=1 WHEN 137: Code%=2 WHEN 138: Code%=3 WHEN 136: Code%=4 WHEN 32: Code%=5 WHEN 67 OR 99: Code%=6 WHEN 70 OR 102: Code%=7 WHEN 86 OR 118: Code%=8 WHEN 88: Code%=999 WHEN 120: Code%=999 OTHERWISE Code%=0 ENDCASE UNTIL Code%<>0 =Code% REM ***************************************** REM PROC_ProcessAction - actions a valid code DEF PROC_ProcessAction(Code%) LOCAL Row%,Col% CASE Code% OF WHEN 1: PROC_MoveCursor(1) WHEN 2: PROC_MoveCursor(2) WHEN 3: PROC_MoveCursor(3) WHEN 4: PROC_MoveCursor(4) WHEN 5: IF Grid%(Cursor.Col%,Cursor.Row%)=1 THEN Grid%(Cursor.Col%,Cursor.Row%)=0 ELSE Grid%(Cursor.Col%,Cursor.Row%)=1 ENDIF PROC_DrawCharacter WHEN 6: FOR Row%=1 TO 8 FOR Col%=1 TO 8 Grid%(Row%,Col%)=0 NEXT Col% NEXT Row% PROC_DrawCharacter WHEN 7: FOR Row%=1 TO 8 FOR Col%=1 TO 8 Grid%(Row%,Col%)=1 NEXT Col% NEXT Row% PROC_DrawCharacter WHEN 8: PROC_GetRowValue WHEN 999: REM Set exit flag Exit=TRUE ENDCASE PROC_DrawCursor ENDPROC
CONTENTS |
HOME |