Mind map
Text-based Adventure Game : Part 1 : Algorithm Challenge 1

Map content
Text-based Adventure Game : Part 1 : Algorithm Challenge 1
Available Resources
- Software
- Notepad++, Word, etc.
- A text editor to write the algorithm within
- Notepad++, Word, etc.
- Hardware
- Laptop
- For synthesis, documentation and research
- Laptop
- Knowledge
- The internet
- For research and investigation
- The teacher
- For questions and feedback
- The unit content
- On onenote, elearn, textbook and teams
- Pseudocode conventions
- The internet
- Software
Constraints/Limitations
- Time
- A full task time limit of 5 weeks
- 2 of the 5 weeks dedicated to Part 1
- A full task time limit of 5 weeks
- Skill
- Personal knowledge of pseudocode and coding conventions
- What can be learnt in 5 weeks
- Challenge
- The criteria accompanying each challenge
- Unable to do whatever one wants
- The criteria accompanying each challenge
- Time
Criteria
- Context
- Player begins in one of the centre squares of a 4 x 4 map grid with no equipment and 3 health points.
- Algorithm must include 4x4 map grid
- Player must begin in one of the centre squares
- mapCentre[0] or [1] or [2] or [3]
- Player must be informed of having no equipment
- Player must be informed of having 3 points of health
- Player begins in one of the centre squares of a 4 x 4 map grid with no equipment and 3 health points.
- Task
- Write algorithm for a function that selects a centre square at random and returns the starting position.
- The algorithm must be a function (modularisation)
- A centre square must be chosen at random
- The starting position must be returned
- The player must be informed of the starting position
- The algorithm must be written in correctly formatted pseudocode
- Write algorithm for a function that selects a centre square at random and returns the starting position.
- Context
Input
- An array of all of the map areas
- A 4x4 map grid
- Variable name
- mapIndex
- Data type
- Integer
- Eg. mapIndex[0 - 15] (since arrays start at 0)
- A whole number that can be negative, positive or zero.
- Integer
- Variable name
- A 4x4 map grid
- A written description of each map area
- Variable name
- mapDesc[ ]
- Data type
- String
- Use quotations " "
- Used to represent text
- String
- Variable name
- An array of the four centre squares of the array
- Eg. mapIndex[5,6,9,10]
- mapIndex corresponds directly to mapDesc
- Eg. mapDesc[5,6,9,10]
- mapIndex corresponds directly to mapDesc
- Eg. mapIndex[5,6,9,10]
- Variable name
- mapCentre
- Eg. mapCentre[0,1,2,3]
- mapCentre
- Data type
- Integer
- An array of all of the map areas
Output
- A written description of the randomly chosen map area
- Variable name
- mapDesc[5] or [6] or [9] or [10]
- Data type
- String
- Displayed in text to the player
- Eg. "Castle"
- String
- Variable name
- Statement of the game's initial context
- PRINT statement
- Text that is displayed to the player
- Must include starting position, player status (equipment and health) and game instruction.
- Eg. "You are at the (mapDesc) of the Kigndom of ___. You are not carrying anything. You have 3 health points."
- Data type
- String
- PRINT statement
- The position of the player
- Variable name
- mapLoc
- The variable stores the current position of the player
- The variable changes as the player explores the map
- The player's starting position corresponds to the value of the variable as the player starts the game
- Data type
- Integer
- Eg. mapLoc[5] or [6] or [9] or [10]
- mapLoc takes data from mapCentre
- mapCentre takes data from mapIndex
- mapIndex corresponds to mapDesc
- mapCentre takes data from mapIndex
- mapLoc takes data from mapCentre
- Eg. mapLoc[5] or [6] or [9] or [10]
- Integer
- Variable name
- A written description of the randomly chosen map area
Ideation/Processing
- Define function
- Name function getStart
- Include input data sets of mapDesc, mapIndex and mapCentre
- Eg. BEGIN getStart (mapDecs, mapIndex, mapCentre)
- Include input data sets of mapDesc, mapIndex and mapCentre
- Name function getStart
- End
- End function
- END getStart
- End function
- Define variables
- mapDesc
- Eg. SET mapDesc[0] = "place_1"
- mapCentre
- Eg. SET mapCentre[0] = mapIndex[5]
- Starting position
- Eg. StartPos = mapDesc[mapIndex]
- mapDesc
- Return starting position
- RETURN StartPos
- Display to player with a PRINT statement
- RETURN StartPos
- Choose randomly from mapCentre
- Eg. DECLARE i AS INTEGER SET i to (0-3)
- Eg. SET mapLoc TO mapCentre[0] or [1] or [2] or [3]
- Eg. DECLARE i AS INTEGER SELECT i FROM random_number_generator
- Eg. DECLARE i AS INTEGER SET i to (0-3)
- Define function
Images and files in the map
Information
- Description
- Year 11 Digital Solutions Mind Map on Text-based Adventure Game : Part 1 : Algorithm Challenge 1, created by Julia de Beer on 16/02/2021.
- Created by
- Julia de Beer
- Views
- 4
- Rating

