1
The challenge:
Write a program or function in any language that takes as an argument (command-line or function) a single English word. It returns or outputs the pluralized form of the word.
(To clarify, the program or function will be executed many times on different words, but separately - the list of words won't be passed all at once.)
The scoring:
The score of a program or function is -(characters in program + 1) * number of wrong answers
. Highest score wins. Joke answers will likely lose by a huge margin (I'm planning on putting in maybe 1,000 words) and if you're amazing you get the highest score of 0.
Example test data:
woman
turn
fly
court
finger
blitz
pie
injury
vertex
alleyway
alloy
ox
goose
mouse
house
louse
waffle
right
bacterium
virus
cherub
chaetognath
boy
man
shaman
figure
prefix
etc.
Those are just some that I picked off the top of my head. The real test cases will have even stranger plurals, but the distribution between types of suffixes will be more even.
Enjoy!
Additional Rule
No Mathematica. Sorry.
9The problem with your proposed scoring is that a program which gets everything right can be arbitrarily big, it will always have score 0. That's hardly code-golf-ish, you'd simply need to include an entire dictionary! I'd suggest
(characters_in_program + 1) * (wrong_answers + 1)
instead. – ceased to turn counterclockwis – 2012-02-25T21:31:55.517@leftaroundabout: I'll throw in a plural that people are unlikely to have ever heard of. If it includes that, well... it deserves the highest score! :) – Ry- – 2012-02-25T21:33:44.783
Also, you should perhaps specify whether answers like this will be accepted.
– ceased to turn counterclockwis – 2012-02-25T21:43:01.900@leftaroundabout: Ah, yes. I was meaning to add that. And the answer is NO! But for the other possible "loopholes" and rule-bending, they're still allowed. – Ry- – 2012-02-25T21:45:44.300
By the way, something which hadn't occurred to me earlier: how does your test script handle cases where there's more than one correct answer? – Peter Taylor – 2012-02-26T08:46:56.633
@PeterTaylor: I was originally going to allow any correct answer to be counted as correct, but I've now decided that only the plural forms of the world that break the most rules will be correct. Just to make things a little more fun :) – Ry- – 2012-02-26T14:43:17.100
Meh. That makes it even more of a guessing game than it already was. – Peter Taylor – 2012-02-26T15:28:02.273
@PeterTaylor: Fine, fine, anything accepted. No more guessing game. – Ry- – 2012-02-26T15:34:26.380