These are projects posted by the students of Dr. Gove Allen at Brigham Young University. These students have taken one semester-long course on VBA and generally have had no prior programming experience

Saturday, April 9, 2011

Traffic Jam

For my project I created a Traffic Jam game in Excel. The Traffic Jam game is a six by six grid with cars placed horizontally or vertically on it. The cars are constrained to move only left and right or up and down, depending on their orientation. The goal is to move a car, typically red, out of the grid. The difficulty is arranging the cars to clear a path.

I became fascinated with the game for its simplicity and complexity. On the gird there are only 36 tiles, but some games require over 20 moves to free the red car. This project is largely a continuation of my fascination with the game.



The game shown above is very simple and can be beat in 8 moves:
1. Move the pink car in the top right to the right 1 square
2. Move the orange car up 1 square
3. Move the cyan car up 1 square
4. Move the brown car left 2 squares
5. Move the green car left 3 squares
6. Move the middle pink car down 2 squares
7. Move the blue car down 3 squares
8. Move the red car out

No comments:

Post a Comment

Blog Archive