Skip to content

Instantly share code, notes, and snippets.

@jesseadams
Last active December 23, 2015 09:48
Show Gist options
  • Save jesseadams/8dd29d63f2d65287a675 to your computer and use it in GitHub Desktop.
Save jesseadams/8dd29d63f2d65287a675 to your computer and use it in GitHub Desktop.

Energy Quest

Description

You have been tasked to write an amazing, revolutionary new game called Energy Quest! It is a command line game where you must search through rigorous mazes and dungeons to find food to stay alive. If you run out of energy, you are dead. Your boss wants to you hack up a proof of concept level and have it ready to demo within the next 90 minutes. Your boss also heard that Lua is the new hot language and wants it written in this. Happy coding!

Requirements

  1. The proof of concept level is a 5x5 grid of squares
  2. The starting energy is 50 and you lose 1 energy each move
  3. The player starts at a random square and that square shows up as an X in the grid
  4. The food is placed at a random square but can not be the same square that the player starts at. The player has no idea which square has the food
  5. The player should be able to gracefully quit the game at any time.
  6. The player gains 20 energy if they find the square where the food was placed
  7. If the food is found, another piece of food is placed somewhere else
  8. If the player hits 100 energy, they win the game
  9. Players should not be able to make an invalid move (Can't go North if there is no square north, etc.). If they attempt to, an "Invalid move" message should display. No energy should be consumed.
  10. Upon dying or winning, the game should output a message and close

Bonus Points

  1. Use OOP
  2. Write tests for your code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment