Skip to content

patrick-verbs/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

by Maxwell Meyer & Patrick Lee | See this project on GitHub Pages (...when it's live)

If you're an Epicodus student (or anyone else!) you're free to use this README as a template for your own work :)

Contents

About

TicTacToe > About

This tic-tac-toe project was created as an assignment to learn object-oriented JavaScript practices using prototypes and constructs.

Description

TicTacToe > About > Description

Forthcoming :P

Installation & Setup

TicTacToe > About > Installation & Setup

Also forthcoming...

Technologies Used

TicTacToe > About > Technologies Used

Known Bugs

TicTacToe > About > Known Bugs

:0

Test Specs

TicTacToe > About > Specs

Passing

Describe: new Board()
Test: It should create a game board object, which contains an array of 9 empty strings, representing the 9 empty squares at the start of a game.
Code: const thisGame = new Board();
thisGame.spaces;
Expected Output: ["", "", "", "", "", "", "", "", "", ""]

Describe: Board.prototype.addMark
Test: It should add an "X" character to the spaces property (an array) at the specified index in that array.
Code: const thisGame = new Board();
let playerMark = "X";
let targetSpace = 4;
thisGame.addMark(playerMark, targetSpace);
console.log(thisGame.spaces);
Expected Output: Current board state: ["", "", "", "", "X", "", "", "", "", ""]


Failing/Untested

Describe: Board.prototype.addMark
Test: It adds an "X" character to the spaces property (an array) at the specified index in that array.
Code: const thisGame = new Board();
let playerMark = "X";
let targetSpace = 4;
thisGame.addMark(playerMark, targetSpace);
console.log(thisGame.spaces);
Expected Output: Current board state: ["", "", "", "", "X", "", "", "", "", ""]
Test: It should prevent a mark from being added to a targeted space if that space is not empty.
Code: const thisGame = new Board();
thisGame.spaces[4] = "O";
let playerMark = "X";
let targetSpace = 4;
thisGame.addMark(playerMark, targetSpace);
Expected Output: Sorry, Player X! This space is taken!
Current board state: [, , , , "O", , , , , ]
Describe: Player.prototype.addMark
Test: It should switch from Player 1 ("X") to Player 2 ("O") after a mark is added.
Code: testTemplate("Do the thing!");
Expected Output: "So here's the thing..."
------------------------ --------------
Test: It should check if the mark won the game, or led to a draw.
Code: testTemplate("Do the thing!");
Expected Output: "So here's the thing..."


Template

Describe: testTemplate()
Test: It should do the thing!
Code: testTemplate("Do the thing!");
Expected Output: "So here's the thing..."
Test: It should also do this other thing...
Code: testTemplate("Another!");
Expected Output: "And another thing!"

License

TicTacToe > License
MIT
MIT License

Copyright (c) 2021 Maxwell Meyer and Patrick Lee

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright © 2021 Maxwell Meyer and Patrick Lee

Contact

TicTacToe > Contact

Patrick Lee | patricklee1138[at]live[dot]com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published