Microsoft Small Basic

Program Listing:
Embed this in your website
Height = GraphicsWindow.Height
Width = GraphicsWindow.Width
GraphicsWindow.BackgroundColor = "Black"
MirrorWidth = 5
MirrorHeight = MirrorWidth*6
MirrorX[1] = Width*6/8
MirrorY[1] = Height/2
MirrorAngle[1] = 36
MirrorX[2] = 410
MirrorY[2] = 77
MirrorAngle[2] = 108
'MirrorX[3] =
AmountMirrors = Array.GetItemCount(MirrorX)
GraphicsWindow.PenColor = "White"
GraphicsWindow.BrushColor = "White"
For i = 1 To AmountMirrors
  Mirror[i] = Shapes.AddRectangle(MirrorWidth*2,MirrorHeight)
  Shapes.Move(Mirror[i],MirrorX[i]-MirrorWidth,MirrorY[i]-MirrorHeight/2)
  Shapes.Rotate(Mirror[i],MirrorAngle[i])
EndFor
GraphicsWindow.PenColor = "Yellow"
LightBeamX = 1
LightBeamY = Height/2
LightBeamAngle = 0
LightBeamSpeed = 2
MirrorOn = 1
While LightBeamX > 0 And LightBeamX < Width And LightBeamY > 0 And LightBeamY < Height
  GraphicsWindow.DrawEllipse(LightBeamX,LightBeamY,LightBeamSpeed,LightBeamSpeed)
  LightBeamX = LightBeamX+LightBeamSpeed*Math.Cos(Math.GetRadians(LightBeamAngle))
  LightBeamY = LightBeamY+LightBeamSpeed*Math.Sin(Math.GetRadians(LightBeamAngle))
  If LightBeamX > MirrorX[MirrorOn]-MirrorHeight/2  And LightBeamY > MirrorY[MirrorOn]-MirrorHeight/2 And LightBeamX < MirrorX[MirrorOn]+MirrorHeight/2 And LightBeamY < MirrorY[MirrorOn]+MirrorHeight/2 Then
    Normal = MirrorAngle[MirrorOn]-90
    LightBeamAngle = (Normal-LightBeamAngle)*2+LightBeamAngle
    MirrorOn = MirrorOn+1
  EndIf
  If MirrorOn = 2 Then
    TextWindow.WriteLine(LightBeamX+" : "+LightBeamY)
  EndIf
  Program.Delay(5)
EndWhile
Copyright (c) Microsoft Corporation. All rights reserved.