Skip to content

Instantly share code, notes, and snippets.

@WizardNinja
WizardNinja / file.rb
Created September 23, 2013 20:49
I just Gisted this Gist, catch my Gist?
puts "Winning!"
# Building Ruby Familiarity
# In this exercise you will take a first look at some common commands in Ruby
# The idea here is to build familiary with Ruby syntax
# This will likely be the first time you've seen some of these commands
# Just type them in and see the displayed output
# Steps:
# 1. Open up a new terminal window
# 2. Launch irb
@WizardNinja
WizardNinja / multiplicationTable.rb
Created September 24, 2013 18:50
multiplication table exer. this version formats the numbers correctly using some fancy formatting stuff I found on google.
puts "Exersize: 1"
#Write a program that prints out the answers of a 9 x 9 multiplication table
for x in (1..9)
for y in (1..9)
answer = x * y
print "%-3d " % answer
end
puts
end
@WizardNinja
WizardNinja / chooseYourOwnAdventure.rb
Created September 26, 2013 04:25
My choose your own adventure game.
# Choose your own adventure: redux
#printing the prompt
#reading input from the console
#return the input
def prompt_and_chomp(prompt)
puts prompt
gets.chomp
end
# ,o888888o. 8 8888 88 8 8888 8888888888',8888'
# . 8888 `88. 8 8888 88 8 8888 ,8',8888'
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888'
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888'
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888'
@WizardNinja
WizardNinja / bowling_spec.rb
Created October 1, 2013 23:47
my spec.. not finished
require './bowling'
describe Bowling do
describe '#score' do
let(:game) { Bowling.new }
it 'should start at 0' do
game.score.should == 0
end
@WizardNinja
WizardNinja / bowling.rb
Created October 1, 2013 23:48
my bowling class
class Bowling
attr_reader :score
def initialize
@score = 0
@spare = 0
@turn = 0
@strike = 0
@pins_this_frame = 0
@WizardNinja
WizardNinja / rock.js
Created October 2, 2013 22:15
working javascript for pet rock!
// Generated by CoffeeScript 1.6.3
var userName;
var intervalSet = false;
function touchRock() {
if (userName === undefined ) {
userName = prompt("What is your name?");
alert("It's nice to meet you " + userName);
document.getElementById("rockImg").src = "rock2.jpeg";
}
@WizardNinja
WizardNinja / atm.css
Created October 3, 2013 17:07
my ATM
@import url(http://fonts.googleapis.com/css?family=Oleo+Script);
@import url(http://fonts.googleapis.com/css?family=Ruluko);
#content {
margin: 0 auto;
text-align: center;
width: 700px;
}
#nav {
@WizardNinja
WizardNinja / animals.js
Created October 4, 2013 21:44
animals.js run this on repl.it
Animal = function(name,sound) {
if(name) {
this.name = name;
}
if(sound) {
this.sound = sound;
}
}
Animal.prototype = {