Staredit Network > Forums > Technology & Computers > Topic: Programming Contest
Programming Contest
Aug 27 2010, 11:12 pm
By: Apos  

Aug 27 2010, 11:12 pm Apos Post #1

I order you to forgive yourself!

Would it be a good idea to start a programming contest on Sen?
I'm not sure how much people can program on this site so if you program and you think it could be fun, say so.

Idea:
  • A program would be proposed and the participants would try to figure out a way to code it.
  • Any language could be used. (As long as it can be tested by others.)
  • Team work?

Criteria to judge:
  • Efficiency
  • Speed
  • Amount of lines of code (May differ from language to language so I guess it will have to be discussed.)

This is what I thought to far. Comment / Thoughts?

Note: I'm not saying I will host this, I'm just bringing the idea to see how it could turn out.




Aug 29 2010, 1:20 am Falkoner Post #2



Lulz, but I can always put all my code into one line in C++ :P Are we counting semi-colons? :bleh:



None.

Aug 29 2010, 1:29 am payne Post #3

:payne:

What about to orient this contest over the fact of helping SEN?
Devourer could post some things he needs to get done and ask for people to code them for him?
... or just think of a feature, code it, submit it, and wait for approbation from the Staff.

Maybe people could code those SEN Games that were discussed a while ago? Roulette and Horse Racing. :awesome:

Just my two cents. ;o



None.

Aug 29 2010, 2:25 am Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from Falkoner
Lulz, but I can always put all my code into one line in C++ :P Are we counting semi-colons? :bleh:
I would imagine it would be counted by semi-colons. That way, an if statement doesn't count as two lines if you like to separate the lines, and braces/method (or function, since you said C++) lines wouldn't hurt your score.

I already do this stuff in college. Having it oriented towards the site, as payne mentioned, would be a good incentive, versus making unused code (I do enough of that through my education).




Aug 29 2010, 2:46 am DavidJCobb Post #5



Apos, are HTAs acceptible? I've written a few of those.

I have one that will display the lyrics (if any) of the currently-playing track in iTunes, though it doesn't seem to always update reliably when the current track changes...

Have another that loops through your iTunes and iPod libraries and synchronizes the play counts, overwriting one set with the other (you pick which acts as the "source")...

Made an HTA that allows you to type in text and a few sound-related parameters and get that text spoken by Windows Voice...

Made an HTA that replaces every character in a file with whitespace before deleting it, so that if it's undeleted with special software, the recoverer gets only spaces (it's slow, though)...

Once had an HTA that kills the explorer.exe process, deletes a specified file, and restarts it, to get around Windows' weaker file protection schemes... (Or was that a batch?)

Worked up a BAT-ffmpeg combo and registered it with Windows; now, I can convert FLVs (YouTube, etc.) to iPod-compatible MP4s with a double-click.

Quote from payne
What about to orient this contest over the fact of helping SEN?
Devourer could post some things he needs to get done and ask for people to code them for him?
... or just think of a feature, code it, submit it, and wait for approbation from the Staff.
Definitely a case of too many cooks.



None.

Aug 30 2010, 8:24 pm Apos Post #6

I order you to forgive yourself!

Quote from payne
What about to orient this contest over the fact of helping SEN?
Devourer could post some things he needs to get done and ask for people to code them for him?
... or just think of a feature, code it, submit it, and wait for approbation from the Staff.

Maybe people could code those SEN Games that were discussed a while ago? Roulette and Horse Racing. :awesome:

Just my two cents. ;o

That brings me an other idea:
Make the contest about making the best Sen games.

If we do go for a web development contest, it means that less languages would be allowed but it would end up giving some better rewards since Devourer can give anything he wants. There would probably be some first place, second place and third place awards. (Not to mention anyone on Sen could play them so you would become very famous all around the would. *CHEERS IN THE CROWD*)




Aug 30 2010, 8:39 pm Aristocrat Post #7



C is awesome.

Code
#include <X11/Xlib.h>
#include <unistd.h>
typedef long O; typedef struct                    { O b,f,u,s,c,a,t,e,d; } C;
Display *d; Window w; GC g; XEvent e;
char Q[] = "Level %d   Score %d", m[222];
#define N(r) (random()%(r))
#define U I[n++]=L[n]=l; n%=222
#define K c=-l.u; l=I[i]; l.t=0; c+=l.u
#define E l.e--&&!--L[l.e].d&&(L[l.e].t=3)
#define M(a,e,i,o) a[0]=e,(a[1]=i)&&XFillPolygon(d,w,g,(void*)a,o,1,1)
#define F return
#define R while(
#define Y if(l.t


                     O p                                           ,B,
                  D,A=6,Z                                         ,S=0,v=
               0,n=0,W=400                                       ,H=300,a[7]
             ={ 33,99, 165,                                     231,297,363} ;
           XGCValues G={ 6,0                                   ,~0L,0,1} ; short
          T[]={ 0,300,-20,0,4                                 ,-20,4,10,4,-5,4,5,
        4,-20,4,20,4,-5,4,5,4,                               -10,4,20},b[]={ 0,0,4,
       0,-4,4,-4,-4,4,-4,4,4} ;                             C L[222],I[222];dC(O x){
      M(T,a[x],H,12); } Ne(C l,O                           s) { l.f=l.a=1; l.b=l.u=s;
     l.t=16; l.e=0; U; } nL(O t,O                         a,O b,O x,O y,O s,O p){ C l;
    l.d=0; l.f=s; l.t=t; y-=l.c=b;                       l.e=t==2?x:p; x-=l.s=a;s=(x|1)
   %2*x; t=(y|1)%2*y; l.u=(a=s>t?s:                     t)>>9;l.a=(x<<9)/a;l.b=(y<<9)/a;
  U; } di(C I){ O p,q,r,s,i=222;C l;                   B=D=0; R i--){ l=L[i]; Y>7){ p=I.s
 -l.s>>9; q=I.c-l.c>>9; r=l.t==8?l.b:                 l.a; s=p*p+q*q; if(s<r*r||I.t==2&&s<
 26) F S+=10; s=(20<<9)/(s|1); B+=p*s;               D+=q*s; }} F 0; } hi(O x,O d){ O i=A;
R i--&&(x<a[i]-d||x>a[i]+d)); F i; }      dL(){ O      c,r=0, i=222,h; C l; R i--){ l=L[i];
Y){ r++;c=l.f; Y==3){c=l.u; l.t=0;     E; }R c--){--     l.u;h=l.c>>9; Y>7){XDrawArc(d,w,g,
(l.s>>9)-++l.a,h-l.a,l.a*2,l.a*2,0   ,90<<8); if(!l.u){    I[i].t-=8; l=I[i]; } } else Y==2)M
(b,l.s>>9,h,6); else XDrawPoint(d    ,w,g,(l.s+=l.a)>>9,    h=(l.c+=l.b)>>9); Y==4&&!l.u){ Ne
(l,20); K; } Y&&l.t<3&&(di(l)||h>    H)){ if(h>H&&(c=hi(    l.s>>9,25))>=0){ dC(c); a[c]=a[--
A]; }Ne(l,30); Y==1){ E;K; } else    c=l.t=0;} Y==1&&h<H    -75&&!N(p*77)){ do{ nL(1,l.s,l.c,
                                     N(W<<9),H<<9,1,i+
                                       1); I[i].d++;
                                          }R N(3)

                                       );         K;
                                      l.u=c; c=0; } Y
                                     ==2){ l.s+=l.a+B;
                                    l.a= (l.e-l.s)/((H+
                                   20-h)|1); l.c+=l.b+D;
                                  M(b,l.s>>9,l.c>>9,6); }
                                 } L[i]=l; } } F r; } J(){
                                R A) { XFlush(d); v&&sleep(
                               3); Z=++v*10; p=50-v; v%2&&hi
                              ((a[A]=N(W-50)+25),50)<0 &&A++;
                         XClearWindow (d,w); for(B=0; B<A;
                            dC(B++)); R Z|dL()){ Z&&!N(p)&&(Z--
                           ,nL(1+!N(p),N(W<<9), 0,N(W<<9),H<<9,1
                          ,0)); usleep(p*200); XCheckMaskEvent(d,
                         4,&e)&&A&&--S&&nL(4,a[N(A)]<<9,H-10<<9,e.
                        xbutton.x<<9,e.xbutton.y<<9,5,0);}S+=A*100;
                            B=sprintf(m,Q,v,S); XDrawString(d,w
                                    ,g,W/3,H/2,m,B); } }

main ()
{
O i=2;
d=XOpenDisplay(0);
w=RootWindow(d,0);
R i--) XMapWindow(d,w=XCreateSimpleWindow(d,w,0,0,W,H,0,0,0));
XSelectInput(d,w,4|1<<15);
XMaskEvent(d,1<<15,&e);
g=XCreateGC(d,w,829,&G);
srandom(time(0));
J();
puts(m);
}






None.

Aug 30 2010, 9:40 pm CecilSunkure Post #8



Don't count lines of code for judging criteria, unless you're counting lines of ASM code.

You can't really judge efficiency or speed.



None.

Aug 30 2010, 10:48 pm Chia-Tyrant Post #9



You can calculate speed. I suppose that efficiency is the same as speed. In C, you could use the following:
Code
#include <time.h>
...
int main() {
    clock_t tstart,tend;
    tstart=clock();
    ...
    tend=clock();
    printf("Time: %f",((float)tend-tstart)/CLK_TCK);
    ...
}

Obviously, a single computer should be used to calculate all of the speeds. Also, those who use low-level languages would get an unfair advantage.



None.

Aug 31 2010, 12:02 am Apos Post #10

I order you to forgive yourself!

Quote from Chia-Tyrant
Code
#include <time.h>
...
int main() {
    clock_t tstart,tend;
    tstart=clock();
    ...
    tend=clock();
    printf("Time: %f",((float)tend-tstart)/CLK_TCK);
    ...
}
That's what I was thinking when I wrote the speed criteria.

For the efficiency, I was thinking about if a code could have been done in a simpler way. If it uses too much memory for it's purpose and so on.




Sep 1 2010, 5:13 pm CecilSunkure Post #11



Quote from Chia-Tyrant
You can calculate speed. I suppose that efficiency is the same as speed.
Yeah, but that would only work if you all used the same language. Like I said, if you were to use efficiency as a judging criterion, you should judge by lines of ASM code, since all languages are converted to it to run, and since lines of ASM code directly relate to efficiency.



None.

Sep 1 2010, 5:23 pm Aristocrat Post #12



Stand-alone programs are most likely going to be useless for the purposes of improving SEN.



None.

Sep 3 2010, 3:27 am DavidJCobb Post #13



Quote from CecilSunkure
Quote from Chia-Tyrant
You can calculate speed. I suppose that efficiency is the same as speed.
Yeah, but that would only work if you all used the same language. Like I said, if you were to use efficiency as a judging criterion, you should judge by lines of ASM code, since all languages are converted to it to run, and since lines of ASM code directly relate to efficiency.
Somewhat unfair with regards to interpreted languages, i.e. JavaScript. And JavaScript is most certainly a valid and formal programming language, as the existence of Gmail and Facebook demonstrates.



None.

Sep 3 2010, 3:42 am Aristocrat Post #14



How about we just do this?

http://projecteuler.net/index.php?section=problems



None.

Sep 3 2010, 3:45 am Biophysicist Post #15



Quote
Somewhat unfair with regards to interpreted languages, i.e. JavaScript. And JavaScript is most certainly a valid and formal programming language, as the existence of Gmail and Facebook demonstrates.
Yah... Or to users of PHP. Or Zetaplex. ;P



None.

Sep 3 2010, 12:47 pm rockz Post #16

ᴄʜᴇᴇsᴇ ɪᴛ!

Uh, how about when compiled, the file size?



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Sep 3 2010, 12:52 pm Biophysicist Post #17



Yah, well, that would only be valid if everyone did the same project (as some things will take up more space than others), the same language (for the same reason), and actually used a compiled language.

I think the only way to actually do this would be subjectively... Get three judges and have them vote on which program they think is best.



None.

Sep 3 2010, 2:12 pm rockz Post #18

ᴄʜᴇᴇsᴇ ɪᴛ!

1) everyone's supposed to be doing the same project
2) language should account for efficiency, as we all know java's going to be horrendously inefficient
3) you got me there. Maybe 2 categories.

I have a couple programs I've always wanted:
one to count the number and frequency of colors in a bitmap.
one to organize scmdraft's text triggers based on ownership.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Sep 3 2010, 2:58 pm NudeRaider Post #19

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Jasc Paint Shop Pro does it for years. I'm sure Photoshop or Gimp can count colors too.
ScmDraft's text triggers. Ever noticed the tree on the left?




Sep 3 2010, 3:37 pm Aristocrat Post #20



Quote from NudeRaider
Jasc Paint Shop Pro does it for years. I'm sure Photoshop or Gimp can count colors too.
ScmDraft's text triggers. Ever noticed the tree on the left?

Tree (Buggy: Don't Use)

The default Trigedit text editing environment is horrible though. Can't even Undo.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: jun3hong