Cover by Conrad Barski M.D.

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

The Orc Battle Game

In the Orc Battle game, you’re a knight surrounded by 12 monsters, engaged in a fight to the death. With your superior wits and your repertoire of sword-fighting maneuvers, you must carefully strategize in your battle with orcs, hydras, and other nasty enemies. One wrong move and you may be unable to kill them all before being worn down by their superior numbers. Using defmethod and defstruct, let’s dispatch some whoop ass on these vermin!

image with no caption

Global Variables for the Player and Monsters

We’ll want to track three player stats: health, agility, and strength. When a player’s health reaches zero, that player will die. Agility will control ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required