Adventure Game Algorithm

Adventure Game Algorithm

  1. Start
  2. Select character
    1. Character 1
    2. Character 2
    3. Character 3
  3. Select ability
    1. Ability 1
    2. Ability 2
    3. Ability 3
  4. Begin Adventure
  5. Quest/Level 1
    1. Decision 1
      1. Take path 1
        1. Fight creature 1
          1. Do you win?
            1. No
              1. You lose
                1. End
              2. Yes
                1. Continue mission
                  1. Next level
                    1. Decision 1
                      1. End
                    2. Decision 2
                      1. End
                    3. Decision 3
                      1. End
  1. Decision 2
    1. Take path 2
      1. Fight creature 2
        1. Do you win?
          1. No
            1. You lose
              1. End
            2. Yes
              1. Continue mission
                1. Next level
                  1. Decision 1
                    1. End
                  2. Decision 2
                    1. End
                  3. Decision 3
                    1. End
  1. Decision 3
    1. Take path 3
      1. Fight creature 3
        1. Do you win?
          1. No
            1. You lose
              1. End
            2. Yes
              1. Continue mission
                1. Next level
                  1. Decision 1
                    1. End
                  2. Decision 2
                    1. End
                  3. Decision 3
                    1. End
  1. Decision 4
    1. Take path 4
      1. Fight creature 4
        1. Do you win?
          1. No
            1. You lose
              1. End
            2. Yes
              1. Continue mission
                1. Next level
                  1. Decision 1
                    1. End
                  2. Decision 2
                    1. End
                  3. Decision 3
                    1. End

Algorithm for Hangman Game

Algorithm for Hangman

  1. Start
  2. Identify player 1.
  3. Identify player 2.
  4. Player 1 inputs word or phrase.
  5. Identify length of word or phrase.
  6. Player 2 starts out with 6 chances to guess a wrong letter.
  7. While chances > 0,
  8. Have all the letter been correctly guessed?
    1. Yes: Player 2 wins!
      1. End
    2. No: Player 2 guess a letter.
      1. Is the letter correct?
        1. Yes: Print letter and go back to step 8.
        2. No: Loses a chance.
          1. How many chances are left?
            1. 5: Print head.
              1. Go back to step 8.
            2. 4: Add torso to head.
              1. Go back to step 8.
            3. 3: Add left arm to torso.
              1. Go back to step 8.
            4. 2: Add right arm to torso.
              1. Go back to step 8.
            5. 1: Add left leg to torso.
              1. Go back to step 8.
            6. 0: Add right leg to torso.
              1. Player 2 loses.
                1. End