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
var Board = { | |
A1:" ", | |
A2:" ", | |
A3:" ", | |
B1:" ", | |
B2:" ", | |
B3:" ", | |
C1:" ", | |
C2:" ", | |
C3:" " |
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
101.times do |i| | |
next if i == 0 | |
if i % 15 == 0 | |
puts "fizzbuzz" | |
elsif i % 3 == 0 | |
puts "fizz" | |
elsif i % 5 == 0 | |
puts "buzz" | |
else puts i | |
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
puts (1..100).map { |i| (fb = [["Fizz"][i % 3], ["Buzz"][i % 5]].compact.join).empty? ? i : fb } |
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
(1..100).map do |i| | |
fb_a = [["Fizz"][i % 3], ["Buzz"][i % 5]] | |
fb = fb_a.compact.join | |
if fb.empty? | |
puts i | |
else | |
puts fb | |
end | |
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
require "./max_solution" | |
describe "#maximum" do | |
it "should return the largest element of the array" do | |
expect(maximum([43, 32, 45, 23])).to eq(45) | |
end | |
it "should return the largest element of the array" do | |
expect(maximum([4, 0, 1, 2, 3])).to eq(4) | |
end | |
it "should return an empty array if given an empty array" do |
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 "bundler" | |
Bundler.require | |
require "./lib/compliment" | |
require "yaml" | |
module Compliments | |
class App < Sinatra::Application | |
compliments = YAML.load(File.read("./compliments.yaml")) |
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
source "https://rubygems.org" | |
gem "sinatra" | |
group :development do | |
gem "shotgun" | |
gem "tux" | |
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
<div class="message"><%= @compliment.message %></div> | |
<div class="right-content"> | |
<img src="<%= @compliment.image %>"> | |
<a href="/compliments"> | |
<div class="button"> | |
<p>Are you still sad?</p> | |
</div> | |
</a> | |
</div> |
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
.tardis { | |
box-sizing: content-box; | |
with: 50ft; | |
padding: 300ft; | |
border: 0.5ft; | |
margin: all_of_time_and_space; | |
} |
OlderNewer