Skip to content

Instantly share code, notes, and snippets.

@ak8824
ak8824 / .babelrc
Created March 5, 2017 17:37 — forked from fdietz/.babelrc
Phoenix Framework Webpack Integration (replacing Brunch)
{
"presets": ["es2015", "react", "babel-preset-stage-0"]
}
@ak8824
ak8824 / tic_tac_toe_win_check.rb
Created May 16, 2015 21:51
Tic Tac Toe Winner Check
game = [["x","x", "o"],["x", "o", "x"], ["x", "o", "x"]]
def game_winner?(game, player_sign)
result = get_winning_sign(game)
if result.nil?
return game.flatten.include?(nil) ? "Game in Progress" : "Draw"
else
return result == player_sign ? "Player #{player_sign} is the winner" : "Player #{player_sign} is the loser"
end
end