Skip to content

Thinkerbell Labs Private Limited | Annie Software Engineer Task | Python Command Line Game Design

Notifications You must be signed in to change notification settings

kvishalrj/Annie_Software_Engineer_Task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Annie_Software_Engineer_Task

Thinkerbell Labs Private Limited | Annie Software Engineer Task | Python Command Line Game Design

Python Command Line Game Design

Design a command line game using Python that has the following requirements:

Game elements –

 Rabbit (denoted by the character “r” and “R”)  Carrot (denoted by the character “c”)  Rabbit hole (denoted by the character “O”)  Pathway stone (denoted by the character “-”)

Game story Our friendly neighbourhood rabbit, Mr. Bunny wants to gather carrots from the yard and take them back to his humble abode. He needs your help in picking up the carrots from the yard and dropping them in his rabbit hole.

Game design The task includes three aspects:

  1. Random map generator :-

Generate a 2D map of more than or equal to 100 characters(based on user input) such that it contains –

 1 Rabbit  More than 1 Carrot (user input)  More than 1 Rabbit Hole (user input)  Rest Pathway stones such that they are placed randomly every time we hit the enter key.

Display this on the command line.

  1. The game :-

 Build capabilities to move the rabbit (from his initial random position as generated by the random map generator) left, right, up, down or diagonally using the “a”, “d”, “w”, “s” and combination of these four keys(for diagonal movement) respectively.

 The rabbit cannot move across a carrot. He has to pick it up using the “p” key.

 Once the rabbit picks up the carrot, the character denoting the rabbit changes from “r” to “R”.

 The rabbit cannot move across a rabbit hole. He has to jump across by pressing the “j” key. If he is to the right of the hole, pressing the jump key will move him to the left of the hole, if he is above the hole pressing jump key will move him to below the hole vice versa, but not diagonally.

 Once the rabbit holds the carrot, placing it into a hole can be accomplished by positioning itself adjacent to the hole and pressing the "p" key. The game concludes as soon as any carrot is deposited into any of the holes.

 The rabbit is limited to holding just a single carrot at any given moment.

 The entire game map should run on a single grid on the command line.

 changing the state of the game should not spawn a new grid every time.

About

Thinkerbell Labs Private Limited | Annie Software Engineer Task | Python Command Line Game Design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages