Author Topic: Simple Turtle  (Read 232 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1065
    • View Profile
Simple Turtle
« on: 2017-May-03 »
I was curious to see if I could code a simple Turtle Graphics program

I will develop it further...

Working commands are :

FD ### (forward in pixels)
BK ### (backward in pixels)
LT ###  (Left turn in degrees)
RT ###  (Right turn in degrees)
PU / PD (Pen up / down)
PEN x (color of pen 0 to 7)
REPEAT x (where x is number of loops)
END (close repeat loop)

Type RUN to execute or repeat a list of commands
INSTANT ON = Execute commands immediately
INSTANT OFF = RUN required to run command list

RESET = Clears List and repositions Turtle
CLEAR / CL = Clears commands list

SAVE imagename = save png to documents.

FEATURES
=======
REPEATs can be nested


have fun!

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



   Create simple programs with commands to control the Turtle and draw amazing images!!


   INSTANT ON / OFF = Turns on / off immediate execution of commands

   FD x = Forward x pixels
   BK x = Backward x pixels

   RT x = Right by x degrees
   LT x = Left by x degrees
   
   PU = Pen Up (Do not draw)
   PD = Pen Down (Draw as normal)

   REPEAT x = Creates a loop to run x times which runs any commands within the loop. Place END when closing loop.

   END = Closes a REPEAT loop. (Loops can be nested)

   PEN x = Color of pen (0 - 7)

   RUN = Runs the current list of commands shown on screen

   CLEAR / CL = Clears the command list

   RESET = Clears commands and resets your Turtle
   
   SAVE filename = Saves a png of the working graphic to your documents folder

   QUIT = Exits the program
« Last Edit: 2017-May-04 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3975
    • View Profile
    • Portfolio
Re: Simple Turtle
« Reply #1 on: 2017-May-04 »
Is that LOGO? ;)
Will give a try.

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3975
    • View Profile
    • Portfolio
Re: Simple Turtle
« Reply #2 on: 2017-May-04 »
I could not make any drawings :(
Probably I have no idea how to work it out, or is there something wrong?

Here an image of one of my attempts

Offline r0ber7

  • Dr. Type
  • ****
  • Posts: 467
    • View Profile
Re: Simple Turtle
« Reply #3 on: 2017-May-04 »
I don't understand what this is. How do I use it? I typed in LT and PD and PEN 1, but don't understand what is Simple Turtle.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1065
    • View Profile
Re: Simple Turtle
« Reply #4 on: 2017-May-04 »
oops! Guys Type RUN at the end...left out vital instruction!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1065
    • View Profile
Re: Simple Turtle
« Reply #5 on: 2017-May-04 »
also INSTANT ON will run a line of commands immediately and INSTANT OFF means you need to do a RUN at the end.

RESET with clear a list.
« Last Edit: 2017-May-04 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1065
    • View Profile
Re: Simple Turtle
« Reply #6 on: 2017-May-04 »
New version added...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 924
  • KodeSource
    • View Profile
    • KodeSource
Re: Simple Turtle
« Reply #7 on: 2017-May-04 »
Great idea for a GLBasic project!
30 years ago, I had so much fun in school with LOGO and commanding that little turtle!
Couldn't draw much more than spirals and flowerish stuff though.

It would be fun to add more commands, such as boxes, circles, or an arc line for curves.
Or be able to draw a pattern, then duplicate that pattern with scale and rotation, etc.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4061
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Simple Turtle
« Reply #8 on: 2017-May-04 »
I thought LOGO was pointless BITD. I still do. But that isn't important - a lot of pursuits are also pointless, but fun.

But a recreation with all it's pointlessness is great.  :D

PS I really think you have to be over a certain age to appreciate your program. Anyone that used a pc rather than a BBC micro at school is too young! :P
I came. I saw. I played.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1065
    • View Profile
Re: Simple Turtle
« Reply #9 on: 2017-May-04 »
I actually had it on my Speccy - but also school had Apple iie with it and I recall it on Nimbus 286 PC

:)

I am actually using it to help build a tactics game using commands - logo seemed a good starting point.

New update added :)




Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3975
    • View Profile
    • Portfolio
Re: Simple Turtle
« Reply #10 on: 2017-May-04 »
It also helps to learn coding a parser, if that is the way MrPlow is going.
I also found this early today:
http://www.glbasic.com/forum/index.php?topic=11003.0
A music player that works out of text files.
I somehow feel they could be related. ;/