Mind map
Algorithm Challenges
Map content
Algorithm Challenges
Challenge 1
- Input/output
- North
- Take 4 from mapLoc to move the player north
- If mapLoc = 0-3, display error message as player is on border
- Take 4 from mapLoc to move the player north
- East
- Add 1 to mapLoc to move the player east
- If mapLoc = 3, 7, 11 or 15 display error message as player is on border
- Add 1 to mapLoc to move the player east
- South
- Add 4 to mapLoc to move the player south
- If maploc = 12-15, display error message as player is on border
- Add 4 to mapLoc to move the player south
- West
- Take 1 from mapLoc to move the player west
- If mapLoc = 0, 4, 8 or 12 display error message as player is on border
- Take 1 from mapLoc to move the player west
- North
- Arrays/lists
- Map size
- 0-15
- MapLoc = player position
- 0-15
- Map size
- Variables
- Health points
- Set player health point variable to 3
- If player health point variable = 5
- Cap health
- If player health point variable = 0
- Print "You died!" and end game
- If player health point variable = 5
- Set player health point variable to 3
- Equipment
- Health points
- Functions
- When spawn, random.randInt MapLoc to 5, 6, 9 or 10
- Input/output
Challenge 2
- Input/output
- Eat bread
- Bread in inventory
- Health is 5
- Display error message "Health is max"
- Health is <5
- Add 1 to health
- Remove bread from inventory
- Add 1 to health
- Health is 5
- No bread in inventory
- Display error message "You have no bread"
- Bread in inventory
- Talk to baker
- Player in mapLoc 2
- Add bread to inventory
- Display message "The baker gives you some bread"
- Lock baker so it cannot give anymore bread
- Display message "The baker gives you some bread"
- Add bread to inventory
- Player not in mapLoc 2
- Display error message "What baker?"
- Player in mapLoc 2
- Eat bread
- Variables
- Baker in mapLoc 2
- Baker
- Eat bread
- Input/output
Challenge 3
- Variables
- Dragon in mapLoc 13
- Set dragon health point variable to 3
- If dragon health point variable = 0 then display message "You have defeated the dragon!"
- Set dragon health point variable to 3
- Sword
- Dragon in mapLoc 13
- Input/output
- Attack dragon with sword in inventory
- Display message "The dragon is attacked and loses 1hp!"
- Take 1 from dragon health point variable
- Display message "The dragon attacks back and you lose 1hp!"
- Take 1 from player health point variable
- Display message "The dragon attacks back and you lose 1hp!"
- Take 1 from dragon health point variable
- Display message "The dragon is attacked and loses 1hp!"
- Attack dragon without sword in inventory
- Display message "You attack the dragon with your fists and tickle him"
- Attack dragon with sword in inventory
- Variables
Information
- Description
- Mind Map on Algorithm Challenges, created by Vincent Chang on 21/04/2022.
- Created by
- Vincent Chang
- Views
- 1
- Rating