Mind map
Mind Map Algorithm
Map content
Mind Map Algorithm
Variables
- mapLoc
- PlayerHP
Functions
- A program module that can accept input and return output. Input, if required, is passed to the function using parameters, and output can be returned, if necessary, with return keyword.
- Set Player Loction
- Talk to baker
- Attack Dragon
- Talk to Dragon
- A program module that can accept input and return output. Input, if required, is passed to the function using parameters, and output can be returned, if necessary, with return keyword.
Algorithm Techniques
- Sequence
- A number of instructions process one after the other
- START run game FINISH
- A number of instructions process one after the other
- Selection
- The nest instruction to be executed depends on a condition
- IF, ELSE, ELSEIF, ENDIF
- IF chololate milk was selected THEN ADD chocolate milk ELSE ADD milk
- IF, ELSE, ELSEIF, ENDIF
- The nest instruction to be executed depends on a condition
- Iteration
- WHILE, NOTWHILE
- While a condition stills exists, the process continues to runs, when the conidtion does not exist, the process stops or changed to another process.
- Apply in Algorithm Challenge 3
- While a condition stills exists, the process continues to runs, when the conidtion does not exist, the process stops or changed to another process.
- REPEAT, UNTIL
- Apply in Algorithm Challenge 3
- Repeats process until a certain condition is fullfilled
- E.g. REPEAT keep walking UNTIL Location found
- WHILE, NOTWHILE
- Assignment
- Assign a value to a variable or memory location
- DECLARE
- MapLocation
- INPUT
- playerInput
- OUTPUT
- Game Message
- DECLARE
- Assign a value to a variable or memory location
- Condition
- A logical expression that evaluates true or false
- IF weather is rainy THEN ADD umbrella to bag ELSE leave house
- Applied in Challenge 2
- A logical expression that evaluates true or false
- Arithmetic
- Performs mathematical Calculations
- +ADD
- -Subtract
- Multiplication
- Divide
- () parentheses
- Modularisation
- Deconstruct a large problem into smaller, more or less indepedent units or modules to allow for the re-use of code and to reduce the complexity of a system, making it easier to find errors.
- REPEAT, UNTIL
- WHILE, NOTWHILE
- Deconstruct a large problem into smaller, more or less indepedent units or modules to allow for the re-use of code and to reduce the complexity of a system, making it easier to find errors.
- Sequence
Challenges
- Algorithm Challenge 1
- Player begins on one of the 4 center squares
- Selection
- If mapLoc = 5 OR 6 OR 9 OR 10
- Assignment
- mapLoc = ""
- Selection
- Set player with 3 health points
- Assignment
- playerHP = "3"
- Assignment
- Player begins on one of the 4 center squares
- Algorithm Challenge 2
- If player talks to baker, he will give the player a loaf of bread
- Selection
- If player talks to baker
- Condition
- Player must be at bakery location
- If player is at bakery location
- THEN baker given bread
- If player is at bakery location
- Player must be at bakery location
- Condition
- Else player does not talk to baker
- If player talks to baker
- Selection
- If player eat the loaf of bread, they will gain 5 health points
- Selection
- Else player does not to baker
- If player enter "eat bread"
- Condition
- Bread item must be in backpack
- If bread is not backpack
- Player cannot eat the bread
- If bread is not backpack
- Bread item must be in backpack
- Condition
- Selection
- If player talks to baker, he will give the player a loaf of bread
- Algorithm Challenge 3
- Player could attack dragon
- Iteration
- If dragon was attack 3 times then the game ends
- Iteration
- Player can talk to dragon
- If MC answers 3 questions correctly then the game ends
- Selection
- If player choose correct answer
- Game add 1 to score
- If player choose correct answer
- Condition
- If score = 3
- Game ends
- If score = 3
- Selection
- Questions could be riddles
- Easy
- Hard
- True or false Questions
- Based on the Game
- If MC answers 3 questions correctly then the game ends
- Player could attack dragon
- Algorithm Challenge 1
Information
- Description
- Mind Map on Mind Map Algorithm, created by Kat eip1 on 08/03/2020.
- Created by
- Kat eip1
- Views
- 3
- Rating