Goal: The goal of this multi-day project is to exercise your JavaScript programming skills with constructors, prototypes, objects, properties, methods, and DOM manipulation and traversal.
First, carefully read each project description below, and decide which project to tackle with your partner. Then, work through the following questions as part of a pre-coding brainstorming session. Map out a basic approach for the project and get creative!
Pick just one prompt below to complete, and then start by completing the warm up.
Write a program where two users can play Pig dice against each other. Start with your business logic, and once it is completed move onto your user interface logic.
Use test-driven development to create your business logic. Include pseudocode tests in your README. After every passing test, make sure to commit your code.
Make sure that your user interface and business logics are clearly separated, and practice separation of concerns when designing your user interface function.
Note that this project is extra challenging; only begin with this if both you and your partner are fully on board. Or, consider tackling Tic Tac Toe if you finish Pig Dice with time to spare.
Create a Tic Tac Toe game for two players. Start with your business logic, and once it is completed move onto your user interface logic.
Use test-driven development to create your business logic. Include pseudocode tests in your README. After every passing test, make sure to commit your code.
Make sure that your user interface and business logics are clearly separated, and practice separation of concerns when designing your user interface function.
Consider making four constructors/prototypes: Player, Space, Board, and Game. The objects created from these could include some of the following features:
let testPlayer = new Player("X");
testPlayer.mark(); // returns "X"
let board = new Board();
let testSpace = board.find(1, 2); // board.find(1,2) returns a Space object
testSpace.xCoordinate(); // returns 1
testSpace.yCoordinate(); // returns 2
testSpace.mark(testPlayer);
testSpace.markedBy(); // returns testPlayer or "X"
board.gameOver(); // returns a boolean
Give users the option to play the computer at one of two levels: easy or hard.