Skip to content

Instantly share code, notes, and snippets.

View nscricco's full-sized avatar

Nicholas Scricco nscricco

  • San Francisco, CA
View GitHub Profile
@nscricco
nscricco / tic_tac_toe.md
Created April 23, 2019 04:49
Urbandoor Take-Home Challenge

Urbandoor Take-Home Challenge

Goal

  • Build a Tic-Tac-Toe game

Stories

  • User may select whether to be "X" or "O"
  • User plays against the computer
# METHOD 1 - tic tac toe board not changing size or how to win
HORIZONTAL_AND_VERTICAL =
(0..2).each.reduce([]) do |w, i|
w << [[0, i], [1, i], [2, i]]
w << [[i, 0], [i, 1], [i, 2]]
end
DIAGONAL = [
[[0, 0], [1, 1], [2, 2]],
CondorConfig = Struct.new(:events, :relays)
module Condor
events = Registry::EventSet.new
runner = DSL::Runner.new(DSL::Closure.new(nil, events: events),
DSL::Syntax::Top)
relays =
if Rails.env.test?
[]
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
class Vehicle
@@WHEELS = 4
attr_reader :speeding_tickets
def initialize(args)
@color = args[:color]
@speeding_tickets = 0
end
def drive