This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A simple Tic-Tac-Toe game implemented in Javascript V8 3.14.5.9 | |
Execute using NodeJS | |
Players 'X' and 'O' take turn inputing their position on the command line using numbers 1-9 | |
1 | 2 | 3 | |
--------- | |
4 | 5 | 6 | |
--------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A small script that finds the solution to the cracker barrel peg game / triangle game. | |
Instructions along with one of the game's solution can be found here: | |
http://www.joenord.com/puzzles/peggame/ | |
The solution is determined by building a game tree and using a depth-first search algorithm. | |
Game Tree: https://en.wikipedia.org/wiki/Game_tree | |
Depth First Search: https://en.wikipedia.org/wiki/Depth-first_search |