22
5
On that challenge you have to solve that challenge.
Contest is over! Check the end of the question
Specs:
- Write the smallest code (Any language*).
- The score of an answer is the sum of:
- Code length without whitespace.
- Number of answers using that same language squared.
- Length of the name of the biggest language on the contest minus the length of your language.
- Downvotes minus Upvotes (a.k.a. minus Total of Votes)
- Write the position of the users and the score.
- Each user can write only one answer.
- The lowest score wins.
Testing:
So, at the end of the contest, a possible input could be (STDIN):
The columns are: Username, Language, Code length(w/o whitespace) and TotalVotes
UserA Python 100 1
UserB Perl 30 2
UserC Java 500 3
UserD Brainfuck 499 4
UserE Perl 29 5
If your user name has spaces like "My User Name" it'll become "MyUserName" so the input will always have exactly 4 columns.
The output will be (STDOUT):
1 UserE 33
2 UserB 37
3 UserA 103
4 UserD 496
5 UserC 503
Explanation:
User P N^2 L V
A 100 1 3 -1
B 30 4 5 -2
C 500 1 5 -3
D 499 1 0 -4
E 29 4 5 -5
Brainfuck is the largest name with 9 chars (9 - 9 = 0
).
Perl and Java have 4 chars (9 - 4 = 5
).
Python has 6 chars (9 - 6 = 3
).
Perl has 2 entries so each get 4 extra points.
About languages:
The name of the language must contain only English letters (i.e. [A-Za-z]) and those which don't fit that must be "translated" to something else.
By the end of the contest, every language must have it's representation (You may propose better representations)
Examples:
Python3 -> Python
Ruby1.9 -> Ruby
Shell Script -> Shell
C++ -> Cpp
C# -> CSharp
><> -> Fish
Deadline: August 20, 2011 00:00 UTC
At the end of the contest, the winner must use his/her program to find the winner. It's allowed to non winners to use their programs to find the winner and tell him/her to use his/her program to find the winner. :)
The winner (see above) gets the answer accepted!
*The Whitespace language has the unfair advantage of being able to introduce unlimited complexity without a penalty on the character count. Answers written in Whitespace may be on the contest but can't win.
If you can make the logic of your program in whitespaces, you also can't win. That's a subjective topic, but if your program can increase considerably in size without being penalized, it falls in that condition.
Final Input
Alphabetical order of names (as of Aug 20th 2011 UTC 00:00)
boothby Sage 41 9
Harpyon Python 203 4
JBernardo Python 184 7
JoeyAdams PostgreSQL 225 6
jpjacobs AWK 269 4
Lowjacker Ruby 146 2
PeterTaylor Golfscript 82 4
rmackenzie CommonLisp 542 2
shesek Javascript 243 3
userunknown Scala 252 1
As both mine and boothby's answers are not allowed to win, the winner should proclaim himself the winner by editing this question and posting the final output below.
Final Output
1 boothby 39
2 PeterTaylor 79
3 Lowjacker 151
4 JBernardo 185
5 Harpyon 207
6 JoeyAdams 220
7 shesek 241
8 userunknown 257
9 jpjacobs 273
10 rmackenzie 541
Is the goal to have the lowest score or the highest score? – Joey Adams – 2011-07-18T05:35:31.910
@Joey Lowest (it's code golf! :) I Fixed the question. – JBernardo – 2011-07-18T05:38:25.437
This contest favors languages with longer names, correct? – Joey Adams – 2011-07-18T06:12:43.577
Yes. It also favors languages with lots of whitespaces, answers with lots of upvotes and obscure languages. – JBernardo – 2011-07-18T06:16:26.057
8
Does that mean a solution in Whitespace will automatically win?
– Joey Adams – 2011-07-18T06:35:13.767@Joey I thought of that, but i don't know if whitespace should be banned or not. Maybe if someone is crazy enough to write in Whitespace and don't get too much downvots he should win... – JBernardo – 2011-07-18T06:43:53.870
1Where does the information about other answers come from? Are our programs supposed to connect to StackExchange and mine the answers to this question? – Justin Morgan – 2011-07-18T16:46:57.983
It's
><>
, not<><
. Imagine I'd call you odranreBJ instead of JBernardo! :P (Creator of ><> here) – None – 2011-07-18T21:35:11.9071@Justin At the end of the contest, I'll make the real program input with the answers. I gave the format – JBernardo – 2011-07-18T21:55:53.153
1@Harpyon <>< ti dexif I !sknahT – JBernardo – 2011-07-18T21:58:41.610
The input format might deserve a bit more detail. For example, some user names have spaces, which is tricky with the current example. Which might or might not be what you want, you tell us. – J B – 2011-07-18T22:10:31.717
@JB The spaces will be stripped (Like I did with your user name). Is anything else about the input format missing? – JBernardo – 2011-07-18T22:17:18.207
1Must we sort the output by scores? If so, what should we do in case of tie? – boothby – 2011-07-19T00:13:02.173
@boothby The answer posted first should win but you don't have worry about that. Just sort those with same number of points the way you like. – JBernardo – 2011-07-19T00:27:08.100
It seems there could be some evil strategies that could go on. For example, if a Javascript solution was currently winning, I could post three more solutions in Javascript to lower its score. – Peter Olson – 2011-07-21T05:37:47.190
@Peter, only one per user. I mean... you could make puppets... but don't. – boothby – 2011-07-21T06:08:10.737
@Franklin It will be on the contest but I won't choose as right answer if it wins (As said on the last paragraph). In addition, I won't choose my answer if it wins. – JBernardo – 2011-07-25T03:10:19.483
@JBernardo Yeah... I figured you'd update the rule once I posted my solution. What I didn't expect is to have a positive vote total. – boothby – 2011-07-26T20:38:13.270
Added a small bounty to remind people of the August 20 deadline. – Joey Adams – 2011-08-16T12:36:35.060
@Joey Adams Oh, nice! – JBernardo – 2011-08-16T12:39:49.223
"Perl has 2 entries so each get 4 extra points." <- they get 3 extra points, since the others get 1 point. – oenone – 2011-08-17T08:00:45.817
It would be a spec violation for my bootstrapping code to have the usage ./btstrp ./test-file as opposed to cat ./test-file | ./btstrp, correct? – arrdem – 2011-08-18T19:07:31.237
I don't get it, what are we building? A whitespace interpreter or a parsing lib for the four column input? – Xeoncross – 2011-08-18T20:07:45.977
@Xeoncross just sort the input using the rules (and they say Whitespace languages will make your answer 'invalid') – JBernardo – 2011-08-18T21:48:30.147
@rmackenzie if your language can't use stdin it might be ok... But doesn't seems like your case. – JBernardo – 2011-08-18T21:52:12.047
@Joey - May I please have a Mod ruling on the spec-compliance and legality of my posted solution? – arrdem – 2011-08-20T03:35:54.487
1@rmckenzie: I'm not a Mod. However, the problem with your wget solution is that you can arbitrarily increase the complexity of your solution without a corresponding increase in code size (the same problem with the Sage solution). Furthermore, downloading code and immediately executing it is dangerous, if it is not sandboxed properly. For these reasons, I will not put a bounty on your wget solution. – Joey Adams – 2011-08-20T03:48:53.827
@joey - my bad. Valid comments, thank you. Btw - who are the mods (if we have any)? I was under the impression that you and Peter were admins of only due to seniority. – arrdem – 2011-08-20T03:57:43.313
I awarded the bounty to Peter Taylor's Golfscript solution. He would have needed -69 votes to fall to third place. jpjacobs and rmckenzie, I am sorry to say that you have fallen below the yellow line and will be up for elimination tonight.
– Joey Adams – 2011-08-20T04:09:27.210@mckenzie, the most visible codegolf.se mods are gnibbler, Chris Jester-Young, dmckee; there are a few more, but I don't know a better way to get a full list than to go through the entire Users page looking for blue diamonds. However, for rulings on this question the final arbiter would be JBernardo, and for rulings on the awarding of the bounty it would be Joey Adams. – Peter Taylor – 2011-08-20T05:57:33.367