Sharon Brizinov
(sharonbrizinov at gmail .com) (ID in PDF file)Roie Koper
(roiekoper at gmail .com) (ID in PDF file)
- Pre game
index.js
will init the game after choosing board size.
- Game
render
function is responsible to render each HTML object to the DOM.placeMoveAtSquare
function will collect intopotentialSquareMoves
the squares that will be affected if current user will place the disk on the given square.- The algorithm for this function is pretty simple. Start with current square and check all occupied squares (by the rival player). For each such square continue with the direction (e.g. left, up, left-up, etc), until encountered square that belongs to current user or the board ended. If such path was found, it will be marked and kept.
calculatePotentialGainForPlayer
function will calculate the potential gain on every square, every turn. When in training mode, we will use its output to reflect to the current player what is the potential gain.
- Board and squares
board
represent a board with size of nxn which holdssquares
.- Each
square
holds an internal state which determines the current disk color (or none), and the potential gain (or none).
- Player
player
represent a player with its perferences and statistics.
- New Game
- Training Mode
- Implemented for every player separately
- Board Size
Since our project is constructed of multiple files (modules) and modern browsers are equipped with CORS technology, one will need to do the following:
- Use Ofer's WebPack template as follows:
a. Copy the WebPack template files one directory above the project
src
directory. b. Runnpm install
command to load all npm modules. c. Runnpm run build
to pack all the modules into a single file. d. Go to the newpublic
directory and runindex.html
in the browser.