Skip to content

Instantly share code, notes, and snippets.

View abaldwin99's full-sized avatar

Alex Baldwin (Old Account) abaldwin99

View GitHub Profile
@abaldwin99
abaldwin99 / TicTacToe.js
Last active October 21, 2021 01:26
Tic Tac Toe - Two Player Command Line
/* 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
---------
@abaldwin99
abaldwin99 / triangle_game.py
Last active November 28, 2017 15:31
Cracker Barrel Peg Game / Triangle Game Solution
"""
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