Microsoft Small Basic

Colors

Modified: 2008/12/25 01:56 by admin - Uncategorized
x1 = Math.GetRandomNumber(640)   
y2 = Math.GetRandomNumber(480)   
h1 = 5   
v1 = 5   
  
x2 = Math.GetRandomNumber(640)   
y2 = Math.GetRandomNumber(480)   
h2 = 3   
v2 = 3   
  
GraphicsWindow.PenWidth = 2   
  
start:   
x1 = x1 + h1   
y1 = y1 + v1   
  
x2 = x2 + h2   
y2 = y2 + v2   
  
If x1 < 0 Or x1 > 640 Then   
  h1 = -h1   
EndIf   
  
If y1 < 0 Or y1 > 480 Then   
  v1 = -v1   
EndIf   
  
  
If x2 < 0 Or x2 > 640 Then   
  h2 = -h2   
EndIf   
  
If y2 < 0 Or y2 > 480 Then   
  v2 = -v2   
EndIf   
  
  
GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB( Math.GetRandomNumber(255), Math.GetRandomNumber(255), Math.GetRandomNumber(255))   
GraphicsWindow.DrawLine( x1, y1, y1, y2 )   
  
Goto start  

ColorsImage

ColorsImage

ScrewTurn Wiki version 2.0.35. Some of the icons created by FamFamFam.