Skip to content

Instantly share code, notes, and snippets.

View crnguyen's full-sized avatar

Cristina Nguyen crnguyen

  • San Francisco, CA
View GitHub Profile
@perlmonger42
perlmonger42 / Tic-Tac-Toe-Winner.js
Created August 30, 2012 22:49
JavaScript function to determine whether a game of tic-tac-toe has been finished.
// Game_Board will have two slots:
// .boardString represents the contents of the 9 cells of the board
// .winner indicates whether or not the game has been won, and by whom
//
// Each cell in the game board has a cell #, as shown in this chart:
// | |
// 0 | 1 | 2
// ----+---+----