Microsoft Small Basic

Program Listing:
Embed this in your website
GraphicsWindow.BackgroundColor = "Gainsboro"
GraphicsWindow.PenColor = "Ivory"
GraphicsWindow.BrushColor = "LightCyan"

hGap = 30
vGap = 30
dropLength = 45
columns = GraphicsWindow.Width / hGap
rows = GraphicsWindow.Height / (dropLength + vGap)

For r = 1 To rows
  For c = 1 To columns
    dCount = dCount + 1
    X = c * hGap
    Y = (r-1) * (vGap + dropLength) + Math.GetRandomNumber(60)
    drop[dCount] = Shapes.AddEllipse(5, dropLength- Math.GetRandomNumber(dropLength/2))
    Shapes.Rotate(drop[dCount] 10)
    Shapes.Move(drop[dCount], X, Y)
  EndFor
EndFor

GraphicsWindow.ShowMessage("You just added " + dCount + " rain drops", "SETUP COMPLETE")

While 0=0
  For i = 1 To dCount
    If Shapes.GetTop(drop[i]) > GraphicsWindow.Height Then
      Shapes.Move(drop[i], Shapes.GetLeft(drop[i]), 0)
    EndIf
    If Shapes.GetLeft(drop[i]) < 1 Then
      Shapes.Move(drop[i], GraphicsWindow.Width - Math.GetRandomNumber(10), Shapes.GetTop(drop[i]))
    EndIf
  EndFor

  For i = 1 To dCount
    Shapes.Move(drop[i] Shapes.GetLeft(drop[i])-1, Shapes.GetTop(drop[i]) + Math.GetRandomNumber(50)+10)
  EndFor

  Program.Delay(1)
EndWhile
Copyright (c) Microsoft Corporation. All rights reserved.