Retired

Debug Tic-Tac-Toe Checker (retired)

Description:

##Debug proposed solution for kata. There are 5 logical errors in the proposed solution..

If we were to set up a Tic-Tac-Toe game, we would want to know whether the board's current state is solved, wouldn't we? Our goal is to create a function that will check that for us!

Assume that the board comes in the form of a 3x3 array, where the value is 0 if a spot is empty, 1 if it is an X, or 2 if it is an O, like so:

[
    [0,0,1],
    [0,1,2],
    [2,1,0]
]

We want our function to return -1 if the board is not solved yet, 1 if X won, 2 if O won, or 0 (zeroo) if it's a cat's game (i.e. a draw).

You may assume that the board passed in is valid in the context of a game of Tic-Tac-Toe.

###Notes Based on Tic-Tac-Toe Checker kata by eugene-bulkin. Debugging kata was derived from solution by By-The-Ocean's and noisycricket. Kudos.

It's suggested that you don't feed on this one. Don't try to rewrite it completely, also. Just try to fix what's provided.

Debugging

Stats:

CreatedDec 17, 2015
Warriors Trained127
Total Skips1
Total Code Submissions337
Total Times Completed25
JavaScript Completions25
Total Stars1
% of votes with a positive feedback rating42% of 18
Total "Very Satisfied" Votes4
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes7
Total Rank Assessments15
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Fosna Avatar
Ad