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
| # User list holds a list of names | |
| # and their shopping items | |
| # Expecting [name, [item1, item2]] style | |
| user_list = [] | |
| # Prompting the user if they want to start | |
| puts "Would you like to start a nested list?[y/n]" | |
| response = gets.chomp |
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
| my_hash = {"jackie"=>"I like bowling", "Luke"=>"likes riding his bike", "imogen"=>"I have a cold", "sara"=>"I ride bart"} | |
| puts "Want to start a hash?" | |
| response = gets.chomp | |
| while response == "y" | |
| puts "Give us your name" | |
| key = gets.chomp |
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 "would you lke to start a contact list?" | |
| response = gets.chomp | |
| hash = {} | |
| while response == "y" | |
| puts "give me name" | |
| name = gets.chomp | |
| puts "number" | |
| number = gets.chomp | |
| hash[name] = number |
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
| <html> | |
| <head> | |
| <title>Supersize Me Cookie</title> | |
| </head> | |
| <body> | |
| <button href="#" onclick="myStopFunction();">stop the cookie!</button> | |
| <br> | |
| <img name="fred" id="freddie" src="cookie.jpg" width="100" height="auto"> |
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 { |
OlderNewer