home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D Game Programming for Teens (2nd Edition)
/
3DGPFT2E.iso
/
Source
/
Chapter03
/
demo03-10.bb
< prev
next >
Wrap
Text File
|
2009-01-20
|
742b
|
36 lines
;demo03-10.bb - Draws out 25 '*'s and 25 '+'s
;create the array
Dim starsplusses$(2,24)
;initialize the array. The first dimension will contain *'s and the second will contain +'s
For rows = 0 To 1
For columns=0 To 24
;Assign either + or *, depending on the return value of FindChar$()
starsplusses$(rows,columns) = FindChar$(rows)
Next
Next
;display the array
For rows = 0 To 1
For columns = 0 To 24
;Write each value to the screen
Print starsplusses$(rows,columns)
Next
;write a new line after each row
Print ""
Next
;Delay five seconds
Delay 5000
;FUNCTION FINDCHAR$(i)
;returns * or +
Function FindChar$(i)
If i = 0
Return "*"
Else If i = 1
Return "+"
EndIf
End Function