Skip to content

TSF ‐ Vector Language

DanimalsTCGYT edited this page Aug 4, 2024 · 6 revisions

THIS DOESN'T WORK IN ORIGIN ANYMORE

docs are just here so i can recreate this system in future if i want to

Examples:

Drawing an Octagon:

penup
setpensize 3
forward 5
setheading 180
forward -2.5
pendown
8 times [
  forward 5
  right 45
]
  • penup: Lifts the pen to prevent drawing.
  • setpensize 3: Sets the pen size to 3 units.
  • forward 5: Moves the turtle forward by 5 units.
  • setheading 180: Sets the turtle's heading (direction) to 180 degrees (facing backward).
  • forward -2.5: Moves the turtle backward by 2.5 units.
  • pendown: Places the pen down to start drawing.
  • 8 times [ ... ]: Executes the enclosed actions 8 times, which includes moving forward by 5 units and turning right by 45 degrees.

Drawing a Square:

penup
setpensize 3
setheading 90
forward 2.5
left 90
forward 2.5
pendown
4 times [
  left 90
  forward 5
]
  • penup: Lifts the pen.
  • setpensize 3: Sets the pen size to 3 units.
  • setheading 90: Sets the turtle's heading to 90 degrees (facing up).
  • forward 2.5: Moves the turtle forward by 2.5 units.
  • left 90: Turns the turtle left by 90 degrees.
  • pendown: Places the pen down to start drawing.
  • 4 times [ ... ]: Executes the enclosed actions 4 times, which includes turning left by 90 degrees and moving forward by 5 units.

Commands:

  • pu or penup: Lifts the pen to prevent drawing.
  • pd or pendown: Places the pen down to start drawing.
  • ps or setpensize: Sets the width of the pen
  • fd int or forward int: Moves the turtle forward by the specified integer units.
  • bk int or backward int: Moves the turtle backward by the specified integer units.
  • h or home: Sets the turtle back to its starting position.
  • seth angle or setheading angle: Sets the turtle's heading (direction) to the specified angle.
  • lt degrees or left degrees: Turns the turtle left by the specified number of degrees.
  • rt degrees or right degrees: Turns the turtle right by the specified number of degrees.
  • int times [ actions ]: Runs the enclosed actions the specified number of times.

These commands and examples provide a way to control the turtle's movements and drawing actions, allowing you to create various shapes and patterns by scripting its actions in .tsf files.

originOS Wiki

Wiki Views:
:views

OSL | RSH | ICN

Clone this wiki locally