Rounding Shapes SmallBasic Source Code

Hmm… there are some new programming language from Microsoft again, SmallBasic, i think it like be small edition of Visual Basic because the error checking or debugging use Visual Basic style. Okay this post is my sparetime work, i will put number of a shapes to create some circle-like shape. Start from line, triangle, square, until nearly-circle shape and look what the shapes looks like. Beautiful.

size = 250
Turtle.Speed = 10

For sides = 2 To 10
  For blocks = 2 To 10
    DrawShapes()
    Program.Delay(2000)
  EndFor  
EndFor
GraphicsWindow.DrawText(400, 10, "End of Program!")

Sub DrawShapes
  GraphicsWindow.Clear()
  GraphicsWindow.DrawText(10,10, "Sides    : " + sides + " of 10")
  GraphicsWindow.DrawText(10,30, "Blocks  : " + blocks + " of 10")    
  GraphicsWindow.DrawText(10,400, "Created By : I Made Krisna W ~ http://times.imkrisna.com")
  
  Turtle.PenUp()
  Turtle.MoveTo(300,200)
  Turtle.Angle = 0
  Turtle.PenDown()
  For i=1 To blocks
    For j=1 To sides
      Turtle.Move(Math.Round(size / sides))
      Turtle.Turn(Math.Round(360 / sides))
    EndFor
    Turtle.Turn(Math.Round(360 / blocks))
  EndFor  
EndSub 

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation