15. class Ninja
constructor: (@numOfShurikens) ->
throwShuriken: ->
@numOfShurikens--
class Ronin extends Ninja
constructor: (numOfShurikens) ->
super numOfShurikens+1 #ronins know to
carry a spare
Saturday, November 12, 2011
28. describe 'Math', ->
describe 'fib', ->
it 'should calculate the numbers correctly up
to fib(16)', ->
fib = [0, 1, 1, 2, 3, 5, 8, 13]
expect(Math.fib(i)).toEqual fib[i] for i in
[0..7]
describe 'Math' do
describe 'fib' do
it 'should calculate the numbers correctly up
to fib(16)'
fib = [0, 1, 1, 2, 3, 5, 8, 13]
(0..7).map { |n| Math.fib(n) }.should == fib
end
end
end
Saturday, November 12, 2011
29. DOM Interactions .coffee
.coffee .coffee
.coffee .coffee .coffee
.coffee Domain/Business Logic
Saturday, November 12, 2011