Thursday, September 16, 2010

Learning To Program

I played an educational game that teaches a few fundamental details of programming, and I'm interested to know if I could have written the code more succinctly.
To play it in Ubuntu:
sudo apt-get install laby
Here is my code from the final level:
***
from robot import *;
forward()
left()
while look() == Void:
forward()
if look() == Wall:
right()
while look() == Web:
left()
left()
forward()
forward()
left()
forward()
forward()
left()
while look() == Void:
forward()
if look() == Wall:
right()
while look() == Void:
forward()
escape()

Tuesday, September 14, 2010

How to get xcowsay 1.2 working on Ubuntu Lucid

Download the newest package from the website.

Extract it to /usr/local/src

sudo apt-get install libgtk2.0-dev

Open a terminal:

cd /usr/local/src

./configure

make

make install