This file contains 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
function arrayOfLight(x) { | |
var array = []; | |
for (var i = 0; i <= x; i++) { | |
array.push(i); | |
} | |
return array | |
} | |
alert(arrayOfLight(20)); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> | |
</head> | |
<body> | |
<!-- TODO make navigation bar wider --> | |
<nav class="navbar navbar-default"> | |
<div class="container-fluid"> |
This file contains 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
SELECT | |
editions.isbn AS "ISBN" | |
FROM editions | |
INNER JOIN books ON (books.id = editions.book_id) | |
INNER JOIN publishers ON (editions.publisher_id = publishers.id) | |
WHERE publishers.name = 'Random House'; |
This file contains 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_relative 'robot' | |
class BoxOfBolts < Item | |
def initialize | |
super("Box of bolts", 25) | |
end | |
def feed(robot_to_feed) |
This file contains 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
gem 'rspec' | |
gem 'pry' | |
gem 'byebug' |
This file contains 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_relative 'footman' | |
class Barracks | |
attr_reader :gold, :food | |
def initialize | |
@gold = 1000 | |
@food = 80 | |
end |
This file contains 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
module Flight | |
def fly | |
puts "I'm a #{self.class}, I'm flying" | |
end | |
end | |
class Animal | |
attr_reader :num_legs, :warm_blooded | |
def initialize(num_legs, warm_blooded) | |
@num_legs = num_legs |
This file contains 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
#Problem 1 | |
require 'rubygems' | |
require 'rest-client' | |
require 'open-uri' | |
wiki_url = "http://en.wikipedia.org/" | |
wiki_local_filename = "wiki-page.html" |
This file contains 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
--color |
This file contains 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_relative 'two_player' | |
require_relative 'question' | |
@repl = true | |
@turn_number = 0 | |
puts "Welcome to 2 Player Math" | |
print 'Player 1 name: ' | |
@name = gets.chomp |
NewerOlder