Created
May 9, 2016 16:35
-
-
Save krokrob/89801ef4f47c4d5774e233e1b2a892be to your computer and use it in GitHub Desktop.
This file contains 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
require "game" | |
class GameController < ApplicationController | |
def game | |
@grid = generate_grid(9) | |
@start_time = Time.now | |
if session[:counter] | |
session[:counter] += 1 | |
else | |
session[:counter] = 1 | |
end | |
end | |
def score | |
@guess = params[:guess] | |
@grid = params[:grid].split('') | |
start_time = params[:start_time].to_time | |
results = run_game(@guess, @grid, start_time, Time.now) | |
@translation = results[:translation] | |
@time = results[:time] | |
@message = results[:message] | |
@score = results[:score] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment