Some new Demos.
Code: Select all
Include "library.cb"
SCREEN 256,256,32,1
FrameLimit 6
font = LoadFont("courier",24)
SetFont font
Global numSteps,n,ax#,ay#,bx#,by#,cx#,cy#,px#,py#
numSteps=10000
ax = 10: cy = 10
ay = ScreenHeight() - 10
bx = ScreenWidth() - 10
by = ScreenHeight() - 10
cx = ScreenWidth() / 2
px = ax: py = ay
While EscapeKey()=0
ClearScreen(12,230,40)
For n=0 To numSteps
SetPixel(px, py, 0,0,255)
Select Rand(0,2)
Case 0
px = (px + ax) / 2.0
py = (py + ay) / 2.0
Case 1
px = (px + bx) / 2.0
py = (py + by) / 2.0
Case 2
px = (px + cx) / 2.0
py = (py + cy) / 2.0
End Select
Next n
DrawScreen OFF
Wend