D. Final Algorithm, Flowchart, or Pseudocode

Othello Algorithm

 

Game 1 – OTHELLO ALGORITHM

  1. Start Program
  2. Set up game
    • Display playing board (8×8)
    • Place 2 white discs and 2 black discs on the center of the board
      • In Standard Diagonal Pattern
    • Player to choose color (black move first)
  3. Game Status
    • Check blank spaces available. If the board is full, print the statement and go to Step 7 (End Game)
    • Check valid moves. If there’s none, print the statement and go to Step 7 (End Game)
  4. Display Statistics (updates every turn)
    • The current round number
    • Number of discs currently for both players
    • Number of blank spaces available
  5. Moving (for both player)
    • Verify move
      • Blank space (taken spot is illegal)
      • Take at least one piece (either wise illegal)
        • Black must place a piece with the black side up on the board, in such a position that there exists at least one straight (horizontal, vertical, or diagonal) occupied line between the new piece and another black piece, with one or more contiguous white pieces between them.
      • If no legal move is available, the turn will be over and given to the opposing side
  6. End Round
    • Go to Step 3 (Game Status)
  7. End Game
    • Display Statistics
    • Congrats the winner
      1. Player with more number of discs wins
    • End Program

Game 2 – HANGMAN

  1. Run program from command line
  2. Parse text file to generate word bank
  3. Wait for user to request new word
    1. When a new word is requested, get one from the word bank and update the display accordingly (show word with spaces)
    2. Reset number of incorrect guesses user has left to make to 5
  4. Wait for user input of character
    1. If the character is in the term to guess, reveal the position of each instance of the character in the term. If the character is not in the term to guess, decrement the number of incorrect guesses the user can still make.
    2. If the user has guessed every character in the term, other than whitespace, they win Display an appropriate message and return to step 3.
    3. If the user has run out of incorrect guesses, they lose. Display an appropriate message and return to step 3.
  5. End Program