GoConqr has a new look! Let us know what you think.

Mind map

ALGORITHM CHALLENGES

Khaifer Milan Digital Technologies Year 11 English

Map content

ALGORITHM CHALLENGES

  1. Algorithm Challenge #3

    • Aim
      • Write an iterative algorithm for a combat system to defeat the dragon (e.g. by attacking it 3 times or answering 3 riddles correctly)
        • Variables
          • Map Location
          • NPC
          • Dragon Health
          • End Game
          • Inventory
          • Sword
    • Input
      • When player inputs 'attack' or 'attack dragon'
        • Prompts the while algorithm to defeat/be defeated by the dragon to start
      • When player inputs 'north', 'west', 'south', 'east', 'leave' or other known actions
        • Allows player to move map locations when possible
    • Output
      • If input is "attack dragon" or "attack"
        • If map Location is 8
          • If player has 'sword' in their inventory
            • If dragon Health is more than 0
              • "The dragon roars at the mighty wound. You feel as if their eyes are set on you. Poised and deadly."
            • If dragon health is 0
              • "The dragon drops dead to the ground. You won. You saved Lyrica!"
          • If player doesn't have sword in their inventory
            • "You are bathed in dragon flames. You have died."
        • If map Location is not 8
          • "The wind billows, as if laughing at you. What is there to attack?"
      • If input was any other known travelling action.
        • "You turn to leave."
    • Processing Variable
      • Map Location
        • Evaluates whether the player is in the right map location to attack the dragon
      • Inventory
        • Evaluates whether the player has sword in their inventory
      • Dragon Health
        • Evaluates whether the dragon has been defeated or still needs to be attacked by player.
    • Relevant Constructs
      • Condition
        • Can only attack the dragon if player has a sword
      • Assignment
        • Redeclares the dragon's Health (-1) for each of player's attacks
      • Sequence
        • Uses IF-ELSE-ELSEIF statements to provide the steps and pathways for the code (i.e. dragon's death if player's attack equals 3)
      • Iteration
        • Uses a while loop in order to attack the dragon until it dies.
  2. Algorithm Challenge #1

    • Aim
      • Write an algorithm for a function that selects centre square at random and returns the starting position
        • Variables
          • Map Location
          • Starting Location
          • Map Description
          • Randomised Integer
    • Input
      • When player input is 'start'
        • The code is prompted to start, and the startLocation function runs
    • Processing Variable
      • Randomised Integer
        • If it equals 5, 6, 9 or 10
          • Code continues to output
        • If it doesn't equal 5, 6, 9 or 10
          • Code repeats until randomised integer equals the wanted values
    • Output
      • Uses the describe Location function (assumed to be pre-existing) to describe the Map Location
    • Relevant Constructs
      • Assignment
        • Sets player's location to the randomised integer (if it is 5,6, 9 or 10)
      • Modularisation
        • Uses an assumed pre-existing function called "describe Location' to simplify code when output aims to describe the map location
      • Iteration
        • The process of integer randomisation repeats until the integer equals 5,6, 9 or 10
      • Condition
        • Sequence only continues if the randomised integer values were 5,6, 9 or 10
  3. Algorithm Challenge #2

    • Aim
      • Write an algorithm processing player input and returns appropriate output message dependent on user location and player's inventory
        • Parts of Challenge
          • If backpack does or does not contain bread
            • Variables
              • health
              • inventory
              • map location
              • bread
          • If player is or isn't in the location of bakery
            • Variables
              • map location
              • NPC
              • inventory
              • bread
    • Input
      • When player inputs 'eat bread'
        • This input prompts the function to evaluate whether item (i.e. bread) can be removed or not
      • When player inputs 'talk to baker'
        • This input prompts the function to talk to the NPC (i.e. baker)
    • Processing Variables
      • Inventory
        • Evaluates whether user has the item 'bread' in their inventory
      • Map Location
        • Evaluates whether user is in the 'bakery' location on the map
      • Health
        • Evaluates whether user's health bar is full (max. of 5), or otherwise
    • Output
      • If input was "talk to baker"
        • If player is in Bakery Location
          • "The baker gives you a loaf of bread."
        • If player is not in Bakery Location
          • "The baker is not here. You sigh."
      • If input was "Eat bread"
        • If player has bread in their inventory
          • If player's health is less than 5
            • "You feel revitalised, like you could fight the whole world."
          • If player's health is equal to or more than 5
            • "You feel full. You don't think you needed to eat that, but at least it was delicious."
        • If player does not have bread in their inventory
          • "You are not carrying the bread."
    • Relevant Constructs
      • Condition
        • An example of a condition in this algorithm is whether or not user has bread in their inventory in order to eat it.
      • Selection
        • Has different code pathways dependent on player's variables (i.e. if they are in the right location, etc.)
      • Assignment
        • Redeclares the value of health (+1) if player consumes bread and has health value less than 5

Information

Description
Year 11 Digital Technologies Mind Map on ALGORITHM CHALLENGES, created by Khaifer Milan on 19/02/2021.
Created by
Khaifer Milan
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?