Programming with KTurtle

Author: | Posted in Programming No comments

KTurtle is a simple programming application loosely based on the LOGO programming language. It runs on Linux. If you are a Windows or Mac user, though, fear not. Using a live CD of Linux or possibly running through Cygwin is a possibility. There is also a KDE on Windows initiative, yo get KDE programs on Windows. There is also a KDE on Mac OS project. I will later leave a link in my comments, once the article on this is published.

The goal of KTurtle is making programming as easy as possible. It is actually running its own scripting language, called TurtleScript. One of the main feature of TurtleScript is the ability to translate into other languages.

The name TurtleScript actually comes from the small sprite in the center, which is a turtle. The person using the program controls the turtle using commands that cause the turtle to move and draw on the canvas.

KTurtle includes some example programs, and this may be just what you need to get started with programming.

First, run the programs, just to see what they do. They are found in the examples menu. These can be edited. Just changing some of the number will give you a slightly different program and result. You can also add in commands.

Of course, you can save these if you want, but it will not save over the example, so it must be saved under a new name.

The next step will be trying your hand at your own completely original program.

The program comes with a handbook, but if it did not install correctly, or for some other reason you should need it, the handbook is available at http://docs.kde.org/stable/en/kdeedu/kturtle/kturtle.pdf

Within this you will be able to find the list of commands and be able to start your programming adventures.

Another thing KTurtle can do is export the results to an image file. This can be in either PNG or SVG format, and you will have an image file appropriate for general use. This is in the Canvas menu. THere is also a print function in this menu.

You can also export the program to HTML. This is in the File menu under Export to HTML.

Here is a small program you can try running if you desire:

reset

go 16,16

pc 56, 42, 91

fontsize 16

$in=ask “What is your name?”

print $in

go 0,0

turnright 90

Now, go have fun, and learn something!