### Author Topic: [ENDED] Code Golf Contest #10  (Read 17716 times)

0 Members and 1 Guest are viewing this topic.

#### JWinslow23

• Coder Of Tomorrow
• LV7 Elite (Next: 700)
• Posts: 556
• Rating: +43/-6
• I make quality calculator games...when I have time
##### [ENDED] Code Golf Contest #10
« on: September 15, 2014, 06:50:58 pm »
Ten is three, three is four, four is MAGIC.

NEXT: Here
PREVIOUS: Here

Challenge 10

Problem
Create a program which displays the Olympic Rings, following these criteria:
• The rings may be a picture or ASCII art
• The rings must overlap (-40% if they interlock in the proper way!)
• The rings should be in color if at all possible (-50% if so)
• The program must not access an external source, Juju
September 22, 2014, 1:00 AM EST

If any further clarifica...you know what? Nobody ever reads this part! Whatever, I don't have a pun anyways. Not that anybody reads that, either.

Ruby
 Rank User Size Date Code 1 Juju 220-70%=66 9/16/2014 8:35:42 AM Spoiler For Spoiler: puts"\x1b[2J"def H(x,y);"\x1b["+x.to_s+";"+y.to_s+"H";enddef a(x,y,c);2.times{|i|puts"\x1b[3"+c.to_s+"m"+H(x+i+1,y)+"#"+H(x+i+1,y+5)+"#"+H(x+3*i,y+1)+"$$#"+"\x1b[0m"};enda(1,1,4);a(1,7,0);a(1,13,1);a(3,4,3);a(3,10,2) Golfscript  Rank User Size Date Code 1 JWinslow23 47-40%=28.2 9/15/2014 11:16:11 PM Spoiler For Spoiler: ' bb ll rrb '' by lg rr'.);n@' yy gg' CJam  Rank User Size Date Code 1 JWinslow23 47-40%=28.2 9/15/2014 11:16:11 PM Spoiler For Spoiler: " bb ll rrb "" by lg rr"_);N@" yy gg" 2 pimathbrainiac 54-40%=32.4 9/15/2014 7:11:40 PM Spoiler For Spoiler: " bb ll rr"N"b by lg r"N" by lg rr"N" yy gg" C  Rank User Size Date Code 1 pimathbrainiac 101-40%=60.6 9/15/2014 7:11:40 PM Spoiler For Spoiler: #include int main(){printf(" bb ll rr\nb by lg r\n by lg rr\n yy gg");return 0;} Nspire Lua  Rank User Size Date Code 1 Jens_K 94-70%=28.2 9/16/2014 7:18:56 AM Spoiler For Spoiler: function on.paint(g)for i=0,4 dog:setColorRGB(9E5*i)g:drawArc(9+i*5,9+i%2*5,9,9,205-i%2*90,i>0 and 330 or 360)endend 2 LDStudios 80-50%=40 9/18/2014 5:26:33 AM Spoiler For Spoiler: for i=1,5 do a=(i>3 and 5 or 0)gc:setColorRGB(i*42)gc:drawString(0,i*8-a*4,a)end 3 Adriweb 84-50%=42 9/15/2014 11:38:14 PM Spoiler For Spoiler: function on.paint(g)for i=4,16,3 do g:setColorRGB(i^5)g:drawString(0,i,i%2*4)end end Language Ranking  Rank Lang User Size Date 1 CJam JWinslow23 28.2 9/15/2014 11:16:11 PM 2 Golfscript JWinslow23 28.2 9/15/2014 11:16:11 PM 3 Nspire Lua Jens_K 28.2 9/16/2014 7:18:56 AM 4 C pimathbrainiac 60.6 9/15/2014 7:11:40 PM 5 Ruby Juju 66 9/16/2014 8:35:42 AM « Last Edit: June 11, 2015, 08:56:59 am by pimathbrainiac » Did you know that "Ammonia Gas" rearranged is "As Omnimaga"? Click here for the only set of games you'll ever need = ? #### LDStudios • Coder Of Tomorrow • LV6 Super Member (Next: 500) • Posts: 388 • Rating: +41/-1 ##### Re: Code Golf Contest #10 « Reply #1 on: September 15, 2014, 07:38:54 pm » Quick question, is it okay on a color calc, if i make the rings gray scale to save bytes? It doesn't seem fair for me to have to do full color when anyone on a grayscale calc doesn't have to. 496 bytes (but so pretty!): 161 bytes: « Last Edit: September 16, 2014, 10:20:27 pm by LDStudios » #### JWinslow23 • Coder Of Tomorrow • LV7 Elite (Next: 700) • Posts: 556 • Rating: +43/-6 • I make quality calculator games...when I have time ##### Re: Code Golf Contest #10 « Reply #2 on: September 15, 2014, 07:48:49 pm » As long as the "colors" are all distinct, this is allowed. « Last Edit: September 15, 2014, 11:56:02 pm by JWinslow23 » Did you know that "Ammonia Gas" rearranged is "As Omnimaga"? Click here for the only set of games you'll ever need = ? #### pimathbrainiac • Occasionally I make projects • Project Author • LV10 31337 u53r (Next: 2000) • Posts: 1731 • Rating: +136/-23 • dagaem ##### Re: Code Golf Contest #10 « Reply #3 on: September 15, 2014, 08:10:20 pm » 54 bytes of CJam and 101 bytes of GNU C TAKE THAT!!! I am Bach. #### Juju • Incredibly sexy mare • Coder Of Tomorrow • LV13 Extreme Addict (Next: 9001) • Posts: 5730 • Rating: +500/-19 • Weird programmer ##### Re: Code Golf Contest #10 « Reply #4 on: September 15, 2014, 09:14:02 pm » • The program must not access an external source, Juju I didn't do that? o.o Remember the day the walrus started to fly... I finally cleared my sig after 4 years you're happy now? This signature is ridiculously large you've been warned. The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr. #### Adriweb • Editor • LV10 31337 u53r (Next: 2000) • Posts: 1708 • Rating: +229/-17 ##### Re: Code Golf Contest #10 « Reply #5 on: September 15, 2014, 10:18:59 pm » My calculator programs TI-Planet.org co-admin. TI-Nspire Lua programming : Tutorials | API Documentation #### JWinslow23 • Coder Of Tomorrow • LV7 Elite (Next: 700) • Posts: 556 • Rating: +43/-6 • I make quality calculator games...when I have time ##### Re: Code Golf Contest #10 « Reply #6 on: September 15, 2014, 10:37:23 pm » • The program must not access an external source, Juju I didn't do that? o.o Code Golf 9, Bash. perl isn't on every PC. Also please don't take solutions from here : http://codegolf.stackexchange.com/questions/18986/draw-the-olympic-games-logo Yes, golf them. Did you know that "Ammonia Gas" rearranged is "As Omnimaga"? Click here for the only set of games you'll ever need = ? #### Juju • Incredibly sexy mare • Coder Of Tomorrow • LV13 Extreme Addict (Next: 9001) • Posts: 5730 • Rating: +500/-19 • Weird programmer ##### Re: Code Golf Contest #10 « Reply #7 on: September 15, 2014, 11:16:42 pm » • The program must not access an external source, Juju I didn't do that? o.o Code Golf 9, Bash. perl isn't on every PC. Oh, right. Thought it was. Well, on systems where Bash is installed, Perl should typically be installed as well, but I can easily be wrong. Remember the day the walrus started to fly... I finally cleared my sig after 4 years you're happy now? This signature is ridiculously large you've been warned. The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr. #### Adriweb • Editor • LV10 31337 u53r (Next: 2000) • Posts: 1708 • Rating: +229/-17 ##### Re: Code Golf Contest #10 « Reply #8 on: September 15, 2014, 11:21:46 pm » Nspire-Lua : 66 bytes for this (black and white) : 82 with varying shades of blue (we can't really see but yes, it's different) : 83 for a little bit visually distinct : 84 for visually ""very"" distinct colours : What's submittable among that ? « Last Edit: September 15, 2014, 11:25:32 pm by Adriweb » My calculator programs TI-Planet.org co-admin. TI-Nspire Lua programming : Tutorials | API Documentation #### JWinslow23 • Coder Of Tomorrow • LV7 Elite (Next: 700) • Posts: 556 • Rating: +43/-6 • I make quality calculator games...when I have time ##### Re: Code Golf Contest #10 « Reply #9 on: September 15, 2014, 11:54:39 pm » Nspire-Lua : 66 bytes for this (black and white) : 82 with varying shades of blue (we can't really see but yes, it's different) : 83 for a little bit visually distinct : 84 for visually ""very"" distinct colours : What's submittable among that ? The 84-byte one. If at all possible for graphical entries, colors must be present and distinct. Also, for ASCII art entries, I am allowing (for example) an output of bbbb$$#  rrrr
b    b#    #r    r
b   ybyy  g#gg   r
bbyb  ##g#  rrrr
y    yg    g
yyyy  gggg

counting towards only proper interlocking (unless the text is colored in the correct way, in which case it counts for both).

(BTW, what do you think the point reduction values should be for color and/or proper interlocking? I'm thinking along the lines of -40 or -50.)

EDIT:
54 bytes of CJam and 101 bytes of GNU C

TAKE THAT!!!
47 bytes of both CJam and Golfscript.

TAKE THAT!!!
« Last Edit: September 16, 2014, 12:35:41 am by JWinslow23 »
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
= ?

#### JWinslow23

• Coder Of Tomorrow
• LV7 Elite (Next: 700)
• Posts: 556
• Rating: +43/-6
• I make quality calculator games...when I have time
##### Re: Code Golf Contest #10
« Reply #10 on: September 16, 2014, 01:17:07 am »
Bump.

I have now implemented the bonuses. You get 40% of your score deducted if the rings are interlocked properly, 50% off if the colors are present and distinct (for ASCII art entries, text must actually be colored), and 70% off (correct me if I'm wrong) for both. Juju, please show me a picture of your Ruby code output; I have no idea if the first criterion is met by yours.
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
= ?

#### Juju

• Incredibly sexy mare
• Coder Of Tomorrow
• LV13 Extreme Addict (Next: 9001)
• Posts: 5730
• Rating: +500/-19
• Weird programmer
##### Re: Code Golf Contest #10
« Reply #11 on: September 16, 2014, 09:09:21 am »
I'll send you the color version soon.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?

This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

#### JWinslow23

• Coder Of Tomorrow
• LV7 Elite (Next: 700)
• Posts: 556
• Rating: +43/-6
• I make quality calculator games...when I have time
##### Re: Code Golf Contest #10
« Reply #12 on: September 16, 2014, 09:16:47 am »
I'll send you the color version soon.

I have the color version, don't I?

But thanks.
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
= ?

#### Juju

• Incredibly sexy mare
• Coder Of Tomorrow
• LV13 Extreme Addict (Next: 9001)
• Posts: 5730
• Rating: +500/-19
• Weird programmer
##### Re: Code Golf Contest #10
« Reply #13 on: September 16, 2014, 09:43:55 am »
Nope, now you do.

Also I have a correctly interlocking version in a text file with ANSI color codes, I dunno if that counts as a valid programming language.

Also note that the filesize output of ls I give is always one more than necessary because Unices always add a final \n which you can remove.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?

This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Code Golf Contest #10
« Reply #14 on: September 16, 2014, 01:11:15 pm »
For ASCII art, does this also include just using 1 lowercase circle for an entire ring or is that against the rules?