Tuesday, March 18, 2008

Back to 80s - console pacman game

Some time ago I had an interview for AI developer and the task was to write a Pacman game. I was not in mood to create a nice GUI or pretty 2D/sprites graphics, the main thing to do was to show ghosts running after the player. Used a standard non-blind path-finding algorithm for this. Here is the screenshot of the game(it's ugly, I know!):

Actually that's not the first game I've ever made. The first one was "Mine Sweeper" written in BASIC when I was 14. And I can assure you python is just awesome! May be anyone can remember GOTO and GOSUB/RETURN operators. Now having all these OOP, exceptions, libraries it's like damn nightmare. I definitely will prefer python to BASIC when teaching my children ;)

The source code(in python, of course) can be found following the link

2 comments:

  1. Hey. I tried this game but it crashed because some issue with curses. I wrapped all "addch" function calls with try/except clauses and it worked well. I also changed the # char by the chr(178) one so it looks way better :) Once I fixed these two things it worked well. THanks for the great work !

    ReplyDelete