appacademy / prep-work

preparatory material for interviewing with App Academy
291 stars 339 forks source link

I added a test to the spec for 04_wonky_coins #46

Closed CorySpitzer closed 9 years ago

CorySpitzer commented 10 years ago

While doing the app academy practice for my interview, I wrote the following bit of code for the 04_wonky_coins. It passed all the tests, but it didn't really seem right:

def wonky_coins(val) return val*2 + 1 end

I compared it to code given in the solution, and sure enough the answers started to deviate at coin values of 6 and above.

I added a test for this case in the spec, so that the above function will fail.

rglassett commented 9 years ago

Closed in ece2906. Thanks!