Quick Arrays Example By Doctor
Originally Posted at the Home Brew Forums.
Just a quick example showing arrays in Blitz Basic:
;
; Arrays example
;
Graphics 640,480
SetBuffer BackBuffer()
Global stars=100
Dim x(stars)
Dim y(stars)
Dim s(stars)
For a = 1 To stars
x(a)=Rand(640)
y(a)=Rand(480)
s(a)=Rand(5)
Next
While Not KeyDown(1)
Cls
update_stars()
Flip
Wend
Function update_stars()
For a = 1 To stars
Rect x(a),y(a),3,3
x(a)=x(a)+s(a)
If x(a)>640 Then
x(a)=0
EndIf
Next
End Function



