Skip to content

Instantly share code, notes, and snippets.

grid = [
[0,0,0],
[0,0,0],
[0,0,0]
]
ships = [
[ [0,0],[0,1] ],
[ [1,2],[2,2] ]
]
@jshawl
jshawl / warmupw01d02.md
Last active August 29, 2015 14:17 — forked from RobertAKARobin/warmupw01d02.md
Warmup, W01D02

Mission: Impossible!

We, the Impossible Missions Force, have become aware that Doctor Nefarious is planning on using his Nefarious Computer (a standard Macbook) to initiate a nuclear launch sequence that will destroy the entire world.

Our sources have told us that the nuclear launch sequence is run from a shell script, and have also given us a tree showing the contents of the Doctor's computer (the flash drive has been added to show where in the structure it will appear):

NO_NUCLEAR_LAUNCH_SEQUENCES_HERE/
	nopeNotALaunchSequence.sh
TOP_SECRET/
	SERIOUSLY_TOP_SECRET/
class Apartment
@@all = []
def initialize
@@all << self
end
def self.count
@@all.length
end
end

##The Search for Obi-Wan

C-3PO is a well-known protocol droid from the Star Wars universe, famed for having a frantic resolve and for directing snappy emotional outbursts at his droid life-mate, R2-D2. Your task is to write a program modelling a simple interaction with C-3PO as he searches for the reclusive Jedi Master, Obi-Wan Kenobi.

NOTE: This lesson not only reinforces, but also builds upon what you learned yesterday, so you will likely have to Google a certain bit of Ruby syntax.

  1. Create a new Ruby file called searching_for_obi_wan.rb in your work folder.
  2. C-3PO should:
    • introduce himself as "C-3P0, human-cyborg relations."
  • ask the user's name
We couldn’t find that file to show.

Homework, W01D01


Create a function in your .bash_profile that will set up a working directory for a new GA student!

Things it should do:

  • Create a folder called GeneralAssembly
@jshawl
jshawl / precess-output-1424174773.css
Last active August 29, 2015 14:15
a precess production
a {
color: #521852;
}
@jshawl
jshawl / precess-input-1424134548.scss
Last active August 29, 2015 14:15
a precess production
$color:blue;
a{
green(#3E123E, 5%);
}
@jshawl
jshawl / precess-input-1418991386.scss
Created December 19, 2014 12:16
a precess production
@mixin transitions($transition) {
-webkit-transition: $transition;
-moz-transition: $transition;
-o-transition: $transition;
transition: $transition;
}
body{
@include transitions(color .5s ease);
}
require 'sinatra'
require 'sinatra/reloader'
get '/coin_toss' do
return ['Heads','Tails'].sample
end
get '/dice_roll' do
rand(1..6).to_s
end