Skip to content

Instantly share code, notes, and snippets.

@krokrob
Created May 9, 2016 16:35
Show Gist options
  • Save krokrob/89801ef4f47c4d5774e233e1b2a892be to your computer and use it in GitHub Desktop.
Save krokrob/89801ef4f47c4d5774e233e1b2a892be to your computer and use it in GitHub Desktop.
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