TSF ‐ Vector Language - Mistium/Origin-OS GitHub Wiki
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
orpenup
: Lifts the pen to prevent drawing.pd
orpendown
: Places the pen down to start drawing.ps
orsetpensize
: Sets the width of the penfd int
orforward int
: Moves the turtle forward by the specified integer units.bk int
orbackward int
: Moves the turtle backward by the specified integer units.h
orhome
: Sets the turtle back to its starting position.seth angle
orsetheading angle
: Sets the turtle's heading (direction) to the specified angle.lt degrees
orleft degrees
: Turns the turtle left by the specified number of degrees.rt degrees
orright 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.