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
data Tile = Rock | Air | |
type Stripe = [Tile] | |
type Heights = [Int] | |
type Water = Int | |
trimLeft :: Stripe -> Stripe | |
trimLeft [] = [] | |
trimLeft (Air : xs) = trimLeft(xs) | |
trimLeft xs = xs |
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
describe('fizz buzz',function(){ | |
var self = this; | |
beforeEach(function(){ | |
var threeChecker = new Checker(3, "Fizz"); | |
var fiveChecker = new Checker(5, "Buzz"); | |
var sevenChecker = new Checker(7, "Bang"); | |
self.fizzBuzzer = new FizzBuzzer([threeChecker, fiveChecker, sevenChecker]); | |
}); | |
it('Default is say the number',function(){ |
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
import static org.junit.Assert.*; | |
import org.junit.Test; | |
public class GildedRoseTest { | |
private GildedRose app; | |
@Test | |
public void at_the_end_of_each_day_our_system_lowers_both_values_for_every_item() { |
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
class Array | |
def occurrences_of(match) | |
self.select{ |number| match == number }.size | |
end | |
def delete_one(match) | |
for i in (0..size) | |
if match == self[i] | |
self.delete_at(i) |
NewerOlder