DEV Community

Cover image for command line game
Symon  Kipkemei
Symon Kipkemei

Posted on

command line game

Dive into a gameplay like never before.

summary

The game is about akin to dungeons and dragons. There are two doors; the left door and the right door. One of the rooms/caves is empty. If you search further/look around you will encounter a sword.

The other room contains a dragon .If you choose to fight the dragon without a sword , chances of defeat are high.

Give it a try

Would you like to give it a try?
https://github.com/symonkipkemei/command-line-game

Pseudocode breakdown

Here is a sum of pseudocodes of how the game play works. I will go into the details later on.

  1. get the player name
  2. display message
  3. present them with two doors
  4. if they choose the left door, they'll see an empty room, they can choose to look around, If they do so, they will find a sword. They can choose to take it or leave it.
  5. if they choose the right door, they'll encounter a dragon, they have the choice to fight it. If they have the sword from the other room, then they will be able to defeat it and win the game.
  6. In both options they have an option to return to the previous room.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay