Mini-Logo

Introduction

During my graduation in CS, in 1999, I wrote an small Logo language environment. It started as an homework project made for my C language class with not more than 4 basic commands (forward, left, right and repeat), but it turned out into a little more sophisticated Logo interpreter. It implements basic drawing features, like move/rotate in all directions, set pen colors, visible/invisible pen, the "repeat" command.

It does not implement procedure/function creation ("to" command) as it would need an program editor, neither it implements any other non-drawing features like text handling, variables, I/O, etc.

I made it available just for study purposes, and to avoid losing that code (but be aware it could contain some WTF code!).

It implements a portuguese dialect of Logo (my native language) and the source comments are all in portuguese. I don't intend to evolve this code, neither translate it. Maybe in future I can rewrite it in another language/platform.

Downloading and Using it

You can download Windows binaries from Google Code here.

Just execute it and you will get a window with a shell to enter commands and a graphical board with the turtle (very familiar if you played with some Logo environment before).

From there you can enter the commands and have some fun. There is a convenient "demo" command you can use to see some eye candy graphical demos.

You can get all implemented commands by looking at source code, in cmdtab.h file. Here I will list the most important commands with a brief explanation for non-portuguese speaking users:

  • pf <steps> - move foward.
  • pt <steps> - move back.
  • pe <degrees> - rotate left.
  • pd <degrees> - rotate right.
  • tat - move turtle to center and clear screen.
  • repita <times> [ <command block to repeat> ] - repeat a command block N times.
  • mudecl <pen-color> - change pen color (0 - 15).
  • demo - run interactive demo.
  • ajuda <command name> - get help on that command, including parameter explanation.
  • sair - quit the program.

Now, some screenshots:

Getting the Source Code

So, you are courageous enough to try to compile a C program written in 1999 dependent on third party libraries you have to download/compile/install manually! :)

The source code is available in Google Code SVN and is distributed under GPL v2 license.

The original code was written using DJGPP/GNU toolchain and the GRX graphical library for DOS. I made some adjustments, and thanks to GRX portability, it nows compiles using MinGW and GRX win32.

The recommended way to get the source is to install Wascana. It is a Eclipse/CDT/MinGW bundle and brings almost all you need to compile it under Windows. Also, you'll need to get Subversive to get the source from SVN under Eclipse.

You will need to get and install the GRX libraries under your MinGW installation. It is distributed only in source code form, so you need to get it and follow the instructions to compile and install. Note that if using Wascana, you must NOT install it under C:\Program Files (the default suggested by the installer), otherwise the GRX make scripts will complain about the space character inside path.