tnelsond / tnelturtle

A turtle drawing application written in C using SDL, and Lua as a scripting language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tnelturtle

This program is written in C using SDL and Lua.

To compile the program run: make

To run the program execute it from the command line with a .lua file as an argument.

*On Linux: ./tnelturtle.out demo.lua

*On Windows: tnelturtle.out demo.lua

The commands that Tnelturtle accepts in the lua file are:

  • fd(length) : Moves the turtle forward length number of pixels
  • tr(degrees) : Turns the turtle clockwise by degrees
  • turnto(degrees) : Turns the turtle clockwise by degrees from 0
  • penup() : Makes the turtle stop writing
  • pendown() : Makes the turtle start writing, turtle is writing by default
  • growto(radius) : Changes the turtle's radius/size
  • pencolor(color) : Changes the turtle's pencolor using a hexadecimal color (0xF9a103) as an argument
  • delay(delayfactor) : Sets the turtle's delay in between commands by a delay factor
  • moveto(x, y) : Moves the turtle to the position (x, y) on the screen. (0, 0) is the upper left hand corner
  • move(x, y) : Move the turtle (x, y) relative to his current location
  • angle() : Gets the current angle of the turtle
  • loc() : Gets the current location of the turtle as (x, y)

About

A turtle drawing application written in C using SDL, and Lua as a scripting language.

License:GNU General Public License v2.0


Languages

Language:C 60.0%Language:Lua 38.1%Language:Makefile 1.8%