Computer Science Canada Best "Anything" in 20 Lines (Choose Your Language) |
Author: | Clayton [ Wed Sep 13, 2006 6:19 pm ] |
Post subject: | Best "Anything" in 20 Lines (Choose Your Language) |
Okay, there was a contest like this some time ago, which turned into a best game in 20 lines.. but whatever. Here you can program whatever you want, just keep it *around* (preferrably under) 20 lines. So the contest! It will be open to any language (note ill need help with marking etc..), and will be marked on the following: 1. Intuitiveness - How interesting did you code your program to fit the restriction? 2. Performance - I don't want to have to wait forever for the program to execute 3. Attractiveness - It doesnt have to be perfect, but i dont want to see something utterly horrible (minor marks here) 4. Length - Marks will be taken off for going in excess of 20 lines Anyone wishing to submit a submission PM the source to me and i will share it with no one but mods who wish to help with the marking. Please do not post your source here, but if you wish to post an executable, thats fine. PRIZES Prizes will be awarded to the top place program for each language, and in each category (if enough submissions are submitted per language). Prizes will be as follows (for each group): 1st: 200 bits 2nd: 100 bits 3rd: 50 bits 4th: 25 bits 5th: 10 bits There will also be prizes for each language for other things: Most Graphically Appealing: 100 bits Best Effect: 100 bits Most Complex: 50 bits First Submission: 100 bits It should be noted that the First Submission prize still has to be quality work, not just some hodgepodge of code you threw together just to get some easy bits. I would still like to see some decent work from everyone NOTE: Any mods willing to help out with bits would be much appreciated, i can give out some, I don't mind, but i don't know if I'll have enough Once again, this will be open to any language, and depending on the number of submissions will be split into two groups on the request of the submitter (when submitting your code to me via a PM, tell me if you want into the first category [less experience] or the second category [more experience], if the judges deem a submission to be good enough we may request that we can move it up a category) Have fun with this and i hope to see some good submissions [edit]Deadline is one month from this post (ie. October 13 2006 at midnight)[/edit] |
Author: | [Gandalf] [ Wed Sep 13, 2006 7:12 pm ] |
Post subject: | |
The problem with allowing any language is that most languages are a lot more flexible in what you can fit on one line than Turing. Oh well, I guess we'll see how it goes... |
Author: | Clayton [ Wed Sep 13, 2006 7:26 pm ] |
Post subject: | |
thats why i have it separated into a category for each language submitted , in the 20 line count i will exclude whitespace (for those of you who like to use it) and in the cases of languages like C++, i will exclude lines consisting of just { or } and the newline at the end of the file (which some compilers require) |
Author: | md [ Wed Sep 13, 2006 8:52 pm ] | ||
Post subject: | |||
what about something like
That's only one line; but more then one statment of code. And do the includes count? I'm seeing many a problem here... |
Author: | NikG [ Wed Sep 13, 2006 9:30 pm ] |
Post subject: | |
Plus what about something like visual basic... seems like it could win the "graphically appealing" category with the fewest lines... |
Author: | Clayton [ Thu Sep 14, 2006 10:29 am ] |
Post subject: | |
okay guys, read it over againg, there are prizes for each language submitted, including the special prizes, Cornflake, i dont know, if there tends are enough people that want the include line exluced then no they wont be counted [edit]code will be required to be in good form ie, none of what md did [/edit] |
Author: | richcash [ Thu Sep 14, 2006 6:04 pm ] |
Post subject: | |
Good idea, this might be fun, but marking will be tough. My main question is can we submit more than one program from the same language and our best program qualifies, or is it just one per language? Also some advice, make it more like 10 bits for the first one submitted, unless there have already been submissions. Also, make the rewards for the best 4 or 5 programs from non-mods (but mods should still be able to participate), because mods can't even use the bits! And one more thing, in Turing when code is indented, super-long lines are broken up, but technically it could be thought of as one line. Will you count these super-long lines as one line? |
Author: | bugzpodder [ Thu Sep 14, 2006 6:12 pm ] |
Post subject: | |
does bits really matter? you can make bits for just spamming like this. |
Author: | [Gandalf] [ Thu Sep 14, 2006 6:21 pm ] | ||
Post subject: | |||
So says the one with almost 7000 of 'em. Anyway, just in case no one enters, here's my win by default submission:
Fun stuff. |
Author: | richcash [ Thu Sep 14, 2006 7:10 pm ] |
Post subject: | |
Quote: does bits really matter? you can make bits for just spamming like this.
Bits don't really matter to me, but there will definetely be more people entering the contest if there are bits to be handed out. I can't guarantee I'll enter something, but if I do I don't want to be the first out of five people, I want to be first out of 20+ (especially if any good programmers enter). @Gandalf : Well, at least he can't penalize you in the length column. |
Author: | NikG [ Thu Sep 14, 2006 7:46 pm ] | ||
Post subject: | |||
[Gandalf] wrote: Anyway, just in case no one enters, here's my win by default submission:
Isn't this program included as a sample with Turing? haha.
|
Author: | Clayton [ Fri Sep 15, 2006 7:45 am ] | ||
Post subject: | |||
super-long lines will be counted as one, however, it must be in some sort of proper indenting (ie none of this:
it must look the way it would with proper formatting.) richcash, i will allow only two submissions from one person for any one language (ie you can submit two in turing two in c++ etc etc), however only the one of yours that scores best will count. [Gandalf]: hmmm, 10 bits for that "excellent" entry? |
Author: | richcash [ Fri Sep 15, 2006 3:59 pm ] | ||
Post subject: | |||
Quote: super-long lines will be counted as one
That's good. Quote: none of this
lol, well obviously not, then any program (no matter how sophisticated) could be made in one line (and you don't even need those semi-colons!). |
Author: | wtd [ Fri Sep 15, 2006 4:32 pm ] |
Post subject: | |
How about a traditional 80 column limit? That is, you can put multiple statements/expressions on a single line, but no line may exceed 80 columns. |
Author: | richcash [ Fri Sep 15, 2006 4:44 pm ] |
Post subject: | |
I don't mind a column limit, but 80 is really low. Especially when you space it out and indent. For example, [Gandalf]'s middle line (for a lack of a better example) is 83 columns (including indenting and spaces). So I think maybe the 80 could be increased by a little (I mean a lot). [edit] oh, now that I've read it closer, I see what wtd means. You can put anything you want on a line (improper indentation) as long as it's less than 80 columns. That's a good idea, then you could have var, get, and put all on the same line and it still wouldn't take up much space on the line. So, everyone's program would be the same length : 20 lines x 80 columns. That would make this a completely different contest, though, so I wonder if Freakman would want that [/edit] |
Author: | [Gandalf] [ Fri Sep 15, 2006 5:47 pm ] | ||
Post subject: | |||
Heh, glad my program is getting all this attention. Although I most certainly didn't plagiarize it from those trusty Turing help files... It's purely original coding. The problem I see with the 80 column limit is that the code will become even more obfusciated than it would with just a line limit.
Code like that (and worse) is not good for the eyes... Does 80 columns seem like too few now? |
Author: | Clayton [ Fri Sep 15, 2006 5:54 pm ] |
Post subject: | |
an 80 column limit sounds good, if you have only one statement on the line however (eg for an if statement) i think it should be allowed to break the 80 column limit, i have already recieved a perfectly viable entry from Wolf_Destiny which is in actuality 18 lines |
Author: | richcash [ Fri Sep 15, 2006 6:15 pm ] |
Post subject: | |
Yeah, so since there is already a submission, let's keep the limit off. However, this seems like an ok idea for a future contest. I can imagine how bad it would get, especially in the above line from [Gandalf] with no spaces (to save even more room). But then I guess the marker of the program could first check if it meets the requirements (20 x 80) and indent it afterwards to actually read it! regarding [Gandalf] : I agree that that's not plagiarism. That's like saying put "a" is plagiarism because someone has done it before. If it's from your own head it's not plagiarism as far as I can see (even if the Turing help files do have the same one, not sure!). Although this random colour circle program is silly to argue over [and NikG was joking!], it could be an issue for other complicated programs. |
Author: | [Gandalf] [ Fri Sep 15, 2006 6:25 pm ] |
Post subject: | |
Yeah. Since you didn't seem to notice, I was being a little sarcastic. |
Author: | richcash [ Fri Sep 15, 2006 6:53 pm ] | ||
Post subject: | |||
Yeah, lol , I know nothing about that was serious if I failed to express this (that's what I get for trying to over-explain things over the internet!) I am no longer referring to [Gandalf]'s program. What I was trying to say was that if you learn something from someone else and use it in a different context, that's not plagiarism. For example, I'm sure there will be people using the famous method that involves this function (something like this) :
because the function can be used for almost anything simple and you can call it as many times as you want with exit when on the same line (and it will never exit because it's always false!). I believe this was first introduced by Catalyst, in the old contest : http://www.compsci.ca/v2/viewtopic.php?t=5539&start=0. In my opinion it's ok to use this if you understand what it means and you don't make a pong game with it. I'm not sure if you give credit in a situation like this, because it can easily be seen how it works and you can make it yourself in a different context. That was the point I was trying to bring up. |
Author: | Clayton [ Sun Sep 17, 2006 8:13 pm ] |
Post subject: | |
alright guys, screenshots will be posted of submitted entries, so here you go: By: Wolf_Destiny now get to coding |
Author: | zylum [ Sun Sep 17, 2006 11:54 pm ] |
Post subject: | |
why dont people just post their code here like in the last one? that made it funner and more competative.. for me atleast |
Author: | Clayton [ Mon Sep 18, 2006 12:51 pm ] |
Post subject: | |
if you wish to post your source thats fine, if not just PM it |
Author: | Clayton [ Wed Sep 20, 2006 4:58 pm ] |
Post subject: | |
alright guys, lets get some more entries, i now have 3 turing entries and one VB entry, keep em coming, post your source up here if you feel like it |
Author: | [Gandalf] [ Wed Sep 20, 2006 6:21 pm ] | ||
Post subject: | |||
Fine, I present Gandalf's Attempt at Trippy Graphics in 17 Lines in Turing:
|
Author: | Clayton [ Wed Sep 20, 2006 6:44 pm ] |
Post subject: | |
very nice [Gandalf] i have to ask, what is the purpose of the parameter 'c' in the cc function? if it is always true, why not just have a:=b no matter what? |
Author: | [Gandalf] [ Wed Sep 20, 2006 6:49 pm ] |
Post subject: | |
It's not always true. |
Author: | zylum [ Wed Sep 20, 2006 9:32 pm ] | ||
Post subject: | |||
3d with shading and z-sorting in 18 (somewhat long) lines... [edit] 16 lines now and some of the longer lines have been reduced a bit [/edit]
|
Author: | NikG [ Thu Sep 21, 2006 12:55 am ] |
Post subject: | |
zylum, that is just plain crazy! AMAZING JOB! +bits Gandalf, nice effect, but I personally like it better after adding a cls after your Time.DelaySinceLast (18). |
Author: | Clayton [ Thu Sep 21, 2006 7:35 am ] |
Post subject: | |
NikG, zylum's a mod zylum, very, very nice, 3d in 18 lines me likey very much |
Author: | md [ Thu Sep 21, 2006 9:57 am ] |
Post subject: | |
Someone wanna post a screenie of zylum's running program? Those of us lacking turing might be curious too... |
Author: | zylum [ Thu Sep 21, 2006 10:55 am ] |
Post subject: | |
its just a rotating cube although you can make it render more complex models, i didnt feel like initializing that array |
Author: | War_Caymore [ Thu Sep 21, 2006 1:04 pm ] | ||
Post subject: | my entry to the 20 anything competition | ||
this is going to be noobish, but i'm a noob programmer so i'll give this a shot...
don't blam it too badly... i want to continue programming. |
Author: | ZeroPaladn [ Thu Sep 21, 2006 1:24 pm ] | ||
Post subject: | |||
time for me to step up, brother. hers my lines in 12 lines. note that the lines are not completely random, nor are they in a set order. it is both. figure it out WarCaymore.
|
Author: | NikG [ Thu Sep 21, 2006 3:50 pm ] |
Post subject: | |
Ahh crap, I gave my bits to a mod Well, the contest is getting interesting, so I thought I'd put up something. Some of you may remember I put up a SMS messenger in the visual basic section. Well it doesn't work anymore, so I'm remaking it. There's a trick to how it works, it should be obvious to figure out. Here is the 20-line "Lite" version (the actual version needs more than 20 lines). Couple of things to remember:
|
Author: | Clayton [ Thu Sep 21, 2006 3:52 pm ] |
Post subject: | |
source? heh ill give you the bits you gave him lol |
Author: | neufelni [ Fri Sep 22, 2006 4:42 pm ] | ||
Post subject: | |||
Here is my submission for the contest in exactly 20 lines. It is a a Sierpinski's triangle program also knows as the chaos game program. Enjoy.
|
Author: | NikG [ Fri Sep 22, 2006 11:30 pm ] |
Post subject: | |
Nick, you're not a mod right? Good job. +bits |
Author: | NikG [ Sat Sep 23, 2006 2:01 am ] | ||
Post subject: | |||
Here's my turing submission, a casino-style slot machine:
I hate using one array for all the variables, but it was the only was to get down to 20 lines. If anyone wants to see a "clean" version, let me know. |
Author: | Silent Avenger [ Sat Sep 23, 2006 7:21 pm ] |
Post subject: | |
I've made another VB program for the contest (too bad you can only enter 2 per language). It's a Picture Viewer and yes I know it has the same name as the Quicktime program but I'm not very creative with words. This will let you view thumbnails of just about any picture. Oh and Freakman I've sent you the source code in a pm. |
Author: | apomb [ Mon Sep 25, 2006 12:13 am ] |
Post subject: | |
NickG: That is one addicting game you got there! the stars are the funnest to try and get... +bits for sure ... its entertaining. |
Author: | NikG [ Mon Sep 25, 2006 1:09 pm ] |
Post subject: | |
CompWiz333 wrote: NickG: That is one addicting game you got there! the stars are the funnest to try and get... +bits for sure ... its entertaining. Thanks CompWiz333.
Addicting? uh-oh... I hope my game doesn't lead you to real gambling... hahaha Also, sure the stars are fun, but the "$" is where the real money is at! |
Author: | ZeroPaladn [ Mon Sep 25, 2006 1:15 pm ] |
Post subject: | |
lol, CompWiz333 is right. It is addicting. Too bad it is hard as hell. |
Author: | War_Caymore [ Mon Sep 25, 2006 1:22 pm ] | ||
Post subject: | |||
here is my second try at this. i hope this is looking like a little less noobish. i ahve to thank the Turing refrence book that one of my teachers have.
I hope you like it. BTW, don't turn up your volume to much, it's really annoying after about half a minute or so. |
Author: | ZeroPaladn [ Mon Sep 25, 2006 1:40 pm ] |
Post subject: | |
lol, bro, i think thre is a rule against something that annoying. a rule of thumb for posting a program like that. run it listen or watch it for 2 mins if you still think its cool, then post it. either way, bravo bro! |
Author: | Artimes [ Thu Sep 28, 2006 10:17 pm ] | ||
Post subject: | |||
Well seeing as I don't expect mine to win over the 3D renderer... I'll post mine for kicks. Click and hold the mouse, watch the balls accelerate towards the pointer!! Velocty 19
|
Author: | BenLi [ Fri Sep 29, 2006 7:58 am ] | ||
Post subject: | |||
two lines worth adding to this program
|
Author: | md [ Fri Sep 29, 2006 10:33 am ] | ||||
Post subject: | |||||
BenLi wrote: two lines worth adding to this program
You are assuming Turing follows bedmas... it might just do in-order evaluation. If it does follow bedmas it'd be better to add those conditions as if statements... were it C++ you could do
Oh, and proper formating of code is nice... func() as opposed to func () |
Author: | ZeroPaladn [ Fri Sep 29, 2006 11:45 am ] |
Post subject: | |
That is amazing Cornflake! Yours is interactive, so it could stand a chance at beating Zylum's 3D Rendering program. (a very slight chance, but a chance nontheless) +20 bits to Cornflake |
Author: | [Gandalf] [ Fri Sep 29, 2006 3:30 pm ] |
Post subject: | |
Cornflake wrote: Oh, and proper formating of code is nice... func() as opposed to func ()
Turing convention is func (). |
Author: | Silent Avenger [ Fri Sep 29, 2006 10:16 pm ] |
Post subject: | |
Hey Freakman, just out of curiosity how many enteries do you have now for this contest? |
Author: | md [ Fri Sep 29, 2006 11:36 pm ] |
Post subject: | |
ZeroPaladn wrote: That is amazing Cornflake! Yours is interactive, so it could stand a chance at beating Zylum's 3D Rendering program. (a very slight chance, but a chance nontheless)
+20 bits to Cornflake Wha? |
Author: | md [ Sun Oct 01, 2006 6:55 pm ] | ||||
Post subject: | |||||
System performance measure, really not very useful at all My workstation: 30864197.5308642JHz My server: 8646031.471554557JHz ** Note, standard SI rules apply, so my workstation is really 30.8MJHz jibahertz.cpp
compile and run with
[edit] changed the code to a pthreaded version... it should make things more accurate for dual-core/hyperthreading machines. At least in that it should use both cores atthe same time... |
Author: | [Gandalf] [ Sun Oct 01, 2006 7:00 pm ] |
Post subject: | |
The Jibahertz name is © 2006 [Gandalf] though. My normal Jibahertz: 33967392 My uber computer Jibahertz: 76219512 Anyway, my vote is an even split between my flying circles and md's amazing creation. *edit* Phew... Updated! |
Author: | apomb [ Mon Oct 02, 2006 7:31 am ] |
Post subject: | |
54MJhz here ... seems this test runs well on Athlon64s cool little deal cornflake, i cant get it to run in VC++ here at school though. pthreads not included in the libraries i guess |
Author: | md [ Mon Oct 02, 2006 12:52 pm ] |
Post subject: | |
you'd need to get teh win32 pthread library manually. Windows implements it's own threading API; and it's much more complex, no way it'd fit in 20 lines. |
Author: | Clayton [ Sat Oct 07, 2006 4:47 pm ] |
Post subject: | |
One week left guys, get those submissions in! (Could a mod lock this afterwards, as im going to be away on the 13th and wont be back till the 17th) |
Author: | apomb [ Sat Oct 07, 2006 6:43 pm ] | ||
Post subject: | |||
yeah, i know its not all graphics oriented, but it does sort the array for you ... IN MEMORY |
Author: | md [ Sat Oct 07, 2006 7:17 pm ] |
Post subject: | |
If we're going to do assembly we might as well jsut go all the way to Corewars |
Author: | Clayton [ Wed Oct 11, 2006 6:46 pm ] |
Post subject: | |
Two days left guys, Get those submissions in, contest closes 11:59pm October 13th |
Author: | Tony [ Wed Oct 11, 2006 8:11 pm ] |
Post subject: | |
not mine, but rather interesting GPS + Google Maps Mashup in 42 lines of code actually when you take out the comments, it's more like 27. At the expence of redability and some error proofing (or making and going with assumptions about the user/system), it could be easily cut down to 20. |
Author: | ericfourfour [ Wed Oct 11, 2006 8:36 pm ] | ||||||
Post subject: | |||||||
Here is mine:
Mess around with the constants and array size and see what you get. Here are a few I found that looked cool.
The one used currently is:
|
Author: | zylum [ Fri Oct 13, 2006 3:59 pm ] | ||
Post subject: | |||
some simple turing:
|
Author: | War_Caymore [ Fri Oct 13, 2006 4:12 pm ] |
Post subject: | |
simple. I can't even read it. Then again, i know next to nothing about turing. |
Author: | Silent Avenger [ Sat Oct 14, 2006 12:23 am ] |
Post subject: | |
Isn't someone supposed to lock this so people don't keep entering submissions? I guess it doesn't matter because the time goes with each post. |
Author: | Tony [ Sat Oct 14, 2006 1:17 pm ] |
Post subject: | |
I think Freakman has mentioned being away for a bit, so this thread will be locked until then. |