This file contains hidden or 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
| puts "Winning!" |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| # ,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' |
This file contains hidden or 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 './bowling' | |
| describe Bowling do | |
| describe '#score' do | |
| let(:game) { Bowling.new } | |
| it 'should start at 0' do | |
| game.score.should == 0 | |
| end |
This file contains hidden or 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
| class Bowling | |
| attr_reader :score | |
| def initialize | |
| @score = 0 | |
| @spare = 0 | |
| @turn = 0 | |
| @strike = 0 | |
| @pins_this_frame = 0 |
This file contains hidden or 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
| // 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"; | |
| } |
This file contains hidden or 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
| @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 { |
This file contains hidden or 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
| Animal = function(name,sound) { | |
| if(name) { | |
| this.name = name; | |
| } | |
| if(sound) { | |
| this.sound = sound; | |
| } | |
| } | |
| Animal.prototype = { |
OlderNewer