Computer Science Canada

team battle:

Author:  zylum [ Tue Mar 09, 2004 8:43 pm ]
Post subject:  team battle:

i was wondering, who wants to have a programming battle??? i was thinking having teams of 2. the topic is still open, but the point of the battle would be to make the best program about the topic and under 50 lines of code (in turing)... we should also set a deadline. once all submissions are sent in then we all vote for the best one... everyone who participates pitches in maybe 20 or 50 bits and the winning team gets the bits...

so whos interested? Very Happy

-zylum

p.s. who wants to be on my team Laughing

Author:  Maverick [ Tue Mar 09, 2004 8:51 pm ]
Post subject: 

id be interested, im not really that good with turing but id try.

Author:  Paul [ Tue Mar 09, 2004 9:36 pm ]
Post subject: 

Yes, you should put us into the newbie division.

Author:  zylum [ Tue Mar 09, 2004 9:42 pm ]
Post subject: 

lol, so what should the topic be???

Author:  bugzpodder [ Wed Mar 10, 2004 7:44 am ]
Post subject: 

lines is not the best way to measure how good a program is

Author:  Tony [ Wed Mar 10, 2004 9:02 am ]
Post subject: 

defenatly not. In C++ you can fit everything on a single line Laughing

anyways, if you've got to have a limit - measure how fast program executes

Author:  Paul [ Wed Mar 10, 2004 12:02 pm ]
Post subject: 

Then everything will have to be run in one judge's computer, cause everyone's computers are different.

Author:  octopi [ Wed Mar 10, 2004 12:02 pm ]
Post subject: 

MSVC++ has a limit on the length of a line, I think its 2KB (2048bytes)

Author:  zylum [ Wed Mar 10, 2004 12:24 pm ]
Post subject: 

well you could fit all your code on one line in turing too, but i meant 50 lines after auto formating (F2)

Author:  Homer_simpson [ Wed Mar 10, 2004 1:28 pm ]
Post subject: 

i'd be in if there's no limit... and it's in language of choice... c++ Twisted Evil
hehe... catalyst will come up with a crazy azz ogl engine with crazy effects

Author:  zylum [ Wed Mar 10, 2004 3:51 pm ]
Post subject: 

well i was thinking it should only be 1 language because it would be really hard to judge otherwise... i mean, if someone makes a 3d engine in ogl in 50 lines, it'll be hard to match if someone only knows turing....

Author:  Paul [ Wed Mar 10, 2004 5:24 pm ]
Post subject: 

Yes, turing would be nice, either that or Malbolge, Very Happy

Author:  bugzpodder [ Wed Mar 10, 2004 7:12 pm ]
Post subject: 

whats the point of teams?

Author:  shorthair [ Wed Mar 10, 2004 7:18 pm ]
Post subject: 

Kool im in , Very Happy Very Happy

Author:  zylum [ Wed Mar 10, 2004 7:43 pm ]
Post subject: 

well, i've done a lot of solo battles on other forums and thought it would be cool if we could do teams of 2 to mix it up a bit... lets just see if this works out, if it's too much trouble then we could always make the next battle solo...

anyways.... anybody have any ideas on a topic???? maybe water??? fire???

and who wants to be on my team Very Happy

-zylum

Author:  Maverick [ Wed Mar 10, 2004 9:45 pm ]
Post subject: 

Me and Paul culd have a n00b battle Very Happy

Author:  zylum [ Wed Mar 10, 2004 9:54 pm ]
Post subject: 

so i guess paul and maveric are on the same team... any ideas for the topic anyone???

Author:  Maverick [ Thu Mar 11, 2004 4:33 pm ]
Post subject: 

hmm a topic eh?
What do u want it to be liek who can make the best animation in under 50 lines or sumtin.

Author:  Paul [ Thu Mar 11, 2004 4:39 pm ]
Post subject: 

hey, they volunteered me into mavericks team, guess one has to take care of the handicapped Very Happy I'll try my best, this weekend, Im learning how to make pong Very Happy yea, im a noob.

Author:  Maverick [ Thu Mar 11, 2004 6:08 pm ]
Post subject: 

Chu callin me a noob mang?
So whatr shuld the topic be anyone?

Author:  zylum [ Thu Mar 11, 2004 6:44 pm ]
Post subject: 

i think it should be either fire or water.... just make a problem that's related to the topic... for example a simple program for water would be bubbles floating upwards.... or for fire, make a candle....

Author:  Paul [ Thu Mar 11, 2004 7:28 pm ]
Post subject: 

Whoa Whoa Whoa slow down, the water I might be able to do, but the fire takes thinking, and I'm not up to the thinking level yet...

Author:  zylum [ Thu Mar 11, 2004 7:36 pm ]
Post subject: 

i guess water it is... so who else is in... so far there is one team : paul and maveric.... and i am waiting for a partner....

what should the deadline be?

zylum

Author:  Catalyst [ Thu Mar 11, 2004 9:27 pm ]
Post subject: 

if no one else want in
ill be on ur team

Author:  Maverick [ Thu Mar 11, 2004 9:51 pm ]
Post subject: 

nonon none of that. Cataylst your too damn good.

lol Very Happy

Author:  Paul [ Thu Mar 11, 2004 10:14 pm ]
Post subject: 

Uh oh, we're gonna get our butts kicked by Zylum, who knows flash and turing graphic crazy stuff. I'll have some time in the march break.

Author:  zylum [ Thu Mar 11, 2004 10:40 pm ]
Post subject: 

fine fine, you and maveric can team up and me and catalyst will work solo to make things a bit more fair... to make it even more interesting, me and catalyst may have a max of 30 lines Shocked Laughing

you up to the challenge catalyst??? Smile

anyways... i'v just finished my submission... its only 20 lines so im way under the limit... maybe i'll add some other stuff to it but for now this is it. it's supposed to be rippling water... as in water droplets dropping in the middle of this body of water and creating ripples.

for slow computers:
code:
setscreen ("graphics:220;220,offscreenonly")
const size := ceil (sqrt (2 * 220 ** 2))
var clr : array 1 .. size of int
for i : 1 .. size
    clr (i) := RGB.AddColor (0, 0, i / (size * 2) + 0.5)
end for
var wave : array 1 .. size div 2 of real
for i : 1 .. size div 2
    wave (i) := i / 5
end for
var c : int
drawfillbox (0, 0, maxx, maxy, blue)
loop
    for decreasing i : size div 2 .. 1
        wave (i) -= 0.5
        c := ceil ((sin (wave (i)) * (abs (size - i * 2.3)) / 3 + (size div 2)))
        drawoval (maxx div 2, maxy div 2, i, i, clr (c))
    end for
    View.Update
end loop


for fast computers:

code:
setscreen ("graphics:220;220,offscreenonly")
const size := ceil (sqrt (2 * 220 ** 2))
var clr : array 1 .. size of int
for i : 1 .. size
    clr (i) := RGB.AddColor (0, 0, i / (size * 2) + 0.5)
end for
var wave : array 1 .. size div 2 of real
for i : 1 .. size div 2
    wave (i) := i / 5
end for
var c : int
drawfillbox (0, 0, maxx, maxy, blue)
loop
    for decreasing i : size div 2 .. 1
        wave (i) -= 0.5
        c := ceil ((sin (wave (i)) * (abs (size - i * 2.3)) / 3 + (size div 2)))
        drawfilloval (maxx div 2, maxy div 2, i, i, clr (c))
    end for
    View.Update
end loop


-zylum

Author:  Catalyst [ Thu Mar 11, 2004 10:45 pm ]
Post subject: 

ill see what i can do Very Happy

Author:  Paul [ Thu Mar 11, 2004 10:46 pm ]
Post subject: 

Aww geez >_< nice work. I hope there isn't a time limit cause Im still half way thru my essay and have a history paper coming up Mad

Author:  Catalyst [ Thu Mar 11, 2004 11:26 pm ]
Post subject: 

heres my idea
inspired my zylum's

code:
setscreen ("graphics:300;300,offscreenonly")
var vals : array 1 .. 150 of real
proc ColorSet (c1, c2, n : int)
    var r1, g1, b1, r2, g2, b2, p, p0, clr : real
    RGB.GetColor (c1, r1, g1, b1)
    RGB.GetColor (c2, r2, g2, b2)
    for i : 1 .. n
        p := (i / n) * 100
        p0 := 100 - p
        clr := RGB.AddColor ((((r1 * p) + (r2 * p0)) / 2) / 50, (((g1 * p) + (g2 * p0)) / 2) / 50, (((b1 * p) + (b2 * p0)) / 2) / 50)
    end for
end ColorSet
ColorSet (55, 1, 128)
ColorSet (53, 55, 88)
ColorSet (102, 53, 32)
for i : 1 .. 150
    vals (i) := i
end for
drawfillbox (0, 0, maxx, maxy, 7)
loop
    for decreasing i : 150 .. 1
        vals (i) -= 2
        drawfilloval (maxx div 2, 100 - round (sind (vals (i) * 5) * 15), i * 2, i, round (maxcolor - ((sind (vals (i) * 5) + 1) / 2) * 220))
    end for
    View.Update
end loop

Author:  zylum [ Thu Mar 11, 2004 11:35 pm ]
Post subject: 

lol, you cow!!! Wink anyways, my waves disipate... good work though!!!
*runs away and studies catalysts code"

lol, -zylum

Author:  Tony [ Thu Mar 11, 2004 11:51 pm ]
Post subject: 

Laughing you can always count on Catalyst to take any of your effects and add another dimention to it Wink

Author:  zylum [ Thu Mar 11, 2004 11:59 pm ]
Post subject: 

in that case, i'll udate my old file:

code:
setscreen ("graphics:220;160,offscreenonly")
const size := ceil (sqrt (2 * 220 ** 2))
var clr : array 1 .. size of int
for i : 1 .. size
    clr (i) := RGB.AddColor (i / (size * 2), i / (size * 2) + 0.3, 1)
end for
var wave : array 1 .. size div 2 of real
for i : 1 .. size div 2
    wave (i) := i / 5
end for
var c : int
drawfillbox (0, 0, maxx, maxy, black)
loop
    for decreasing i : size div 2 .. 1
        wave (i) -= 0.5
        c := ceil ((sin (wave (i)) * (abs (size - i * 2.3)) / 3 + (size div 2)))
        drawfilloval (maxx div 2, round (maxy / 2 + c / 20) - 8, i, i div 2, clr (c))
    end for
    View.Update
end loop


Very Happy -zylum

Author:  Catalyst [ Fri Mar 12, 2004 12:15 am ]
Post subject: 

code:

setscreen ("graphics:300;300,offscreenonly")
var vals : array 1 .. 250 of real
proc ColorSet (c1, c2, n : int)
    var r1, g1, b1, r2, g2, b2, p, clr : real
    RGB.GetColor (c1, r1, g1, b1)
    RGB.GetColor (c2, r2, g2, b2)
    for i : 1 .. n
        p := (i / n) * 100
        clr := RGB.AddColor ((((r1 * p) + (r2 * (100 - p))) / 2) / 50, (((g1 * p) + (g2 * (100 - p))) / 2) / 50, (((b1 * p) + (b2 * (100 - p))) / 2) / 50)
    end for
end ColorSet
ColorSet (55, 1, 128)
ColorSet (53, 55, 88)
ColorSet (102, 53, 32)
for i : 1 .. 250
    vals (i) := i
end for
var theta, inc : real := 1
loop
    for decreasing i : 250 .. 1
        vals (i) -= 2
        drawfilloval (maxx div 2, round (150 * (theta / 360)) - round (sind (vals (i) * 5) * 15), i, round (i * (theta / 360)), round (maxcolor - ((sind (vals (i) * 5) + 1) / 2) * 220))
    end for
    if (theta >= 360) or (theta < 0) then
        inc := -inc
    end if
    theta += inc
    View.Update
    drawfillbox (0, 0, maxx, maxy, 55)
end loop

Author:  zylum [ Fri Mar 12, 2004 12:24 am ]
Post subject: 

man, that one just killed my computer... runs fine for the first few seconds and then it starts zooming in or rotating and the it just goes like 5 fps Confused nice fading though

ps my waves still disipate 8)

-zylum

Author:  Maverick [ Fri Mar 12, 2004 6:44 pm ]
Post subject: 

damn thats a little too good. I forfeit Smile

Author:  zylum [ Fri Mar 12, 2004 7:05 pm ]
Post subject: 

lol, so i guess team maveric/paul bian forfiet due to lack of confidence/skill... and catalyst is disqualified for plagerism Laughing

i declare myself the winner!!! unless catalyst can come up with something a bit more original...

-zylum

Author:  Paul [ Sun Mar 14, 2004 5:44 pm ]
Post subject: 

zylum wrote:
lol, so i guess team maveric/paul bian forfiet due to lack of confidence/skill... and catalyst is disqualified for plagerism Laughing

i declare myself the winner!!! unless catalyst can come up with something a bit more original...

-zylum

Damn, shut down before I even started.

Author:  the_short1 [ Sun Mar 14, 2004 7:31 pm ]
Post subject: 

im not as pro at some others i only took gr10... but im in if its turing cuz thats all i know righte now... and hey zylum... il be on ur team... we garuntee win... hell u made that fractoral tree in 49 lines... that was TITE.......

Author:  the_short1 [ Sun Mar 14, 2004 7:33 pm ]
Post subject: 

yea i only read page one.. i didibn;t notice the other 2 pages... then i posted.. hehehe... my bad

and wow... those are both REALY good... hard to say which is better Catalyst or zylum

Author:  sport [ Sun Mar 14, 2004 7:43 pm ]
Post subject:  Battle topic

Useful stuff. Let's have a battle of making something useful, the most useful program wins.


: