Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 1.74 KB

README.md

File metadata and controls

60 lines (37 loc) · 1.74 KB

Othello

View Demo

Game Setup

  1. Game Board 8 x 8, 64 black or white pieces
  2. starting position white, black, black, white (diagonal) at the center of the board.

Game Play

  1. Player1 (Black) starts first
  2. A valid move needs to fulfill 2 conditions below.
  • There needs to be at least one adjacent opposite tile.
  • in that same direction, there needs to be an identical tile without any gap in between.
  1. If one player can not make a valid move, play passes back to the other player. When neither player can move, the game ends.
  2. The player with the most pieces on the board at the end of the game wins.

screenshot

screenshot

Game Flow Diagram

screenshot

Code Design

Follows OOP

screenshot

Main logic

  • Traversing the grid as (x,y) coordinate from one tile to another, when checking for the 2 required conditions for the player move

screenshot

screenshot

TDD

  • Main logic was first built and tested simultaneously with npm test cases

screenshot

screenshot

Project Stages

  1. Requirements / Design
  2. Game Logic
  3. UI
  4. AI (stretch goal) - Future improvement

Reference

  1. https://en.wikipedia.org/wiki/Reversi
  2. http://www.othelloonline.org/
  3. background image from here
  4. icons and images from https://thenounproject.com