Attack of the Robots!

image with no caption

Here, we look at a game so horrifying that it’s sure to give you nightmares: Attack of the Robots! In this game, robots have taken over the world, and it’s your job to destroy them. Though the plot may sound scary, the part of this game that will really give a Lisp programmer nightmares is the way it abuses the loop and format commands in order to squeeze a fully functional robot-fighting game into a single page of code! (This program uses the “crazy formatting trick” discussed in the previous section.)

I have annotated the code with some basic explanations. If you want to understand how the game works in detail, you’ll need to review most of the information from the previous couple of chapters. Also, you can visit http://landoflisp.com/ to download the source code for the game and read a more thorough explanation of the code.

To win the game, you need to strategically walk around the field to cause all robots to collide with each other. The movement keys are QWE/ASD/ZXC. These characters form a grid on the left side of your keyboard, letting you move up, down, left, right, as well as diagonally. You can also teleport with the T key.

Enjoy!

image with no caption
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.94.190