Microsoft Small Basic

Program Listing:
Embed this in your website
' Challenge of the month November 2012 Graphical Challenge by NaochanON
' Tornade and snow

Tornade()
rotate()
snow()

sub snow
  GraphicsWindow.Title="****** Snowing ***********"
  For i=1 To MM
    For j=1 to 3
      y2=400+math.GetRandomNumber(300)
      Shapes.Animate(snow[j][i],Shapes.GetLeft(snow[j][i]),y2,2000+math.GetRandomNumber(3000))
    endfor
    Program.Delay(100)
  endfor
EndSub

Sub rotate
  GraphicsWindow.Title="****** Tornade rotate and disappear ***********"
  While N<34
    N=N+1
    For i=1 To MM-N
      For j=1 to 3
        Shapes.move( snow[j][i],Shapes.GetLeft(snow[j][i+N])+N*0.5,Shapes.Gettop(snow[j][i+N]))
      endfor
    EndFor
    For j=1 to 3
      Shapes.move(snow[j][MM-N+1], -150+math.GetRandomNumber(1200),-300-Math.GetRandomNumber(1000))
    endfor
  endwhile
EndSub

sub Tornade
  GraphicsWindow.BackgroundColor="Black"
  GraphicsWindow.Width=1200
  GraphicsWindow.Height=700
  GraphicsWindow.CanResize="False"
  GraphicsWindow.top=20
  GraphicsWindow.Title="****** Making Tornade ***********"
  GraphicsWindow.BrushColor="Darkgreen"
  GraphicsWindow.FillRectangle(0,400,1200,400)
  GraphicsWindow.BrushColor="lightcyan"
  MM=500
  r=0.0005
  For j=1 To 3
    sx0[j]=100*j*j+100*(2-math.GetRandomNumber(3))
    sy0[j]=400+Math.GetRandomNumber(200)
  EndFor
  For i=1 To MM
    For j=1 To 3
      snow[j][i]=Shapes.AddText("★")
      r=r+0.001
      Shapes.Zoom(snow[j][i],r*r,r*r)
      Shapes.move(snow[j][i],Shapes.GetLeft(snow[j][i-1]),Shapes.Gettop(snow[j][i-1]))
      x=150*r*math.Cos(-3.14+i*0.1)+sx0[j]+ 10*math.SquareRoot(i)
      y=50*r*math.Sin(i*0.1)+sy0[j] - 0.65*i
      Shapes.Animate(snow[j][i],X,Y,2000)
    endfor
  EndFor
EndSub
Copyright (c) Microsoft Corporation. All rights reserved.