 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike the Elder wrote:
> Orchid XP v7 <voi### [at] dev null> wrote:
>> "2.1.1 For the first 6 months of continuous employment the period of
>> notice to be given in writing by either you of the Company to terminate
>> your employment is one week's notice thereafter either party must give
>> at least four week's notice if you have been continuously employed for
>> up to four years and thereafter one additional week's notice for each
>> completed year of continuous service up to a maximum of 12 weeks' notice
>> after 12 years' service has been completed."
> #macro Find_Weeks_Notice(Years_Employed)
>
> #declare Weeks_Notice = 1;
>
> #if (Years_Employed > .5)
> #declare Weeks_Notice = 4;
> #end
>
> #if (Years_Employed > 4)
> #declare Weeks_Notice = int(Years_Employed)
> #end
>
> #if (Years_Employed > 12)
> #declare Weeks_Notice = 12;
> #end
>
> #debug concat("Weeks notice required: ",str(Weeks_Notice))
>
> #end
OMG... That's like... sublime!
In fact, you know what? I think even *normal* people might be able to
comprehend this code. w00t!
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> #declare Weeks_Notice = int(Years_Employed)
I'm not sure if int is a valid function. Replace with ceil or floor (or
round?) as appropriate; would make it more explicit.
> #debug concat("Weeks notice required: ",str(Weeks_Notice))
Better design if the function returns the value it found, instead of
printing it.
Also, you could have used #switch and #range; but I agree with
Invisible: the way it's written now is clear even for non-coders...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> 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
Much better.
BG,
MC
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Jim Henderson wrote:
> On Wed, 06 Feb 2008 21:46:44 +0000, Orchid XP v7 wrote:
>
>> I'm loving how they mix "week's" and "weeks'". Mmm, nice grammar.
>
> Hey, I've been meaning to mention, you'd make a good writer. Seriously,
> you use the English language quite well.
>
> Jim
He has a lot of practice writing to the newsgroup ;-0
Tom
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Mike the Elder wrote:
> Invisible <voi### [at] dev null> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible <voi### [at] dev null> wrote:
> In fact, you know what? I think even *normal* people might be able to
> comprehend this code. w00t!
#define "normal people"
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
>> Besides, spelling and grammar checking are what editors are for. :-)
>
> Heh! Who wants to be editor for my NG submissions? :-D
You're using Thunderbird, doesn't it have a live spell checking while
writing the message?
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> When I was in school they told us that in English "'s" should only be
> used with people, otherwise the "of" version should be used. For example,
> you shouldn't say "the house's window" but "the window of the house".
As a native speaker of American english, I will say I've never heard of
such a rule. Indeed, such a "window of the house" would make me think
you're a native French speaker speaking English or something.
> OTOH, there are situations where it's clearly misused. For example,
> I have seen "not as scary as you two's faces", which sounds really awkward.
> I would say "not as scary as the faces of you two" would be much better.
Yeah, agreed. When it starts getting into complicated sentences, it's
better to use "of", especially when the words are common homophones. It
prevents the person from thinking you said "as you too's faces", which
is confusing.
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp wrote:
> scott <sco### [at] laptop com> wrote:
>> "not as scary as your two faces" sounds better to me. No idea if it's
>> correct or not.
>
> That would mean a person with two faces... :P
*Sounds* right to me. "Your" can refer to plural, so if it's clear from
context you're talking to two people, it wouldn't be confusing.
(As for the its vs it's, yah, it's one of those things you just memorize.)
--
Darren New / San Diego, CA, USA (PST)
On what day did God create the body thetans?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote:
> Invisible <voi### [at] dev null> wrote:
> > In fact, you know what? I think even *normal* people might be able to
> > comprehend this code. w00t!
>
> #define "normal people"
>
> --
> - Warp
"just a normal human being. And you know what stinkers they are."
-Cab Driver from "Harvey"
(as played by Wallace Ford in the film version)
Oh So Pleasant Regards,
Mike C.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |