Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 35736

Small Basic: Turtle Polygon Patterns

$
0
0

Here is a gallery of some of our favorite patterns made with the Turtle object in Small Basic!

 

This first Turtle pattern comes from litdev:

Turtle.Speed = 10

For i = 1 To 600

Turtle.Move(10)

Turtle.Turn(i*11)

EndFor

 

Next, here's an interesting shape from Zock77:

Import code: FFB727

Screen shot of a program FFB727

 

As a bit of a joke, Pappa Lapub used it as a Turtle Frame:

And here are Pappa's three shapes:

Turtle PolySpiral   LNZ598  18 Lines , shortened as (too) much as could, but 3 figures, not my idea

TurtlePattern Brillie   JMC583   10 Lines   OK, but not my idea

Circle Series / Flower   QCL151  15 Lines

PS: Turtle.Hide sends Turtle (Image Shape) to Oblivion and it will never be seen in the same program again.  Turtle.Show wont bring it back.
Although not the same; to hide Turtle Shape and then show it up again Shapes.HideShape("_turtle") and Shapes.ShowShape("_turtle") can be used.

  

And here is some code from MK_hobby_coder:

Changing the number used in the turtle code makes different pictures.  The following code makes a  pictogram for 0-9.  Then the user can make a pictogram to store a numeric code. 

program : TLQ846

Turtle.Speed = 10
tutrix = Turtle.X
tutriy = Turtle.Y
For x = 0 To 9
  GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()
  Turtle.X = tutrix+(x*100)-300
  Turtle.Y = tutriy - 100
  Turtle.Angle=0
  GraphicsWindow.FontSize = 20
  GraphicsWindow.DrawText(Turtle.x,Turtle.y,x)
For i = 1 To 300 Step (x+1)
  Turtle.Move(10)
  Turtle.Turn((x+1)*i)
EndFor
EndFor
  code = "1=3;2=5;3=6;4=8;5=2;6=2;7=5;8=0"
  For x = 1 To Array.GetItemCount(code)
  GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()
  Turtle.X = tutrix+(x*100)-300
  Turtle.Y = tutriy + 100
  Turtle.Angle=0
  GraphicsWindow.FontSize = 20
  'GraphicsWindow.DrawText(Turtle.x,Turtle.y,code[x])
For i = 1 To 300 Step (code[x]+1)
  Turtle.Move(10)
  Turtle.Turn((code[x]+1)*i)
EndFor
EndFor

==================

 

Enjoy the Turtle Patterns! Do you know why turtles love fancy patterns? No? Well, see Small Basic: Why Turtles Love Fancy Patterns.

   - Ninja Ed


Viewing all articles
Browse latest Browse all 35736

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>