Mike the Elder wrote:
> Invisible <voi### [at] devnull> wrote:
>
>> OMG... That's like... sublime!
>
>> In fact, you know what? I think even *normal* people might be able to
>> comprehend this code. w00t!
>
> My gosh, you're right! We can't have THAT. Crunch code to the rescue:
>
> #macro Gen_WN(YE) #declare WN = 1+3*(YE>.5) + (YE>4) * int(YE-4) +( YE>12) *
> int(12-YE); #debug concat("WN=",str(WN))#end
GAH! >_<
find_weeks_notice :: Double -> Integer
find_weeks_notice years_worked
| years_worked < 0.5 = 1
| years_worked < 4 = 4
| otherwise = 12 `max` floor years_worked
Much better. :-D
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|