Obfuscate Code Contest 5 - Results Poll

Online C++ programming contests.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard, raimo

Obfuscate Code Contest 5 - Results Poll

Postby Darobat » Sat Dec 18, 2004 2:43 pm

Entries can be found here:
http://www.freewebs.com/darobat/Blackjack.txt

Vote count
Beer Hunter: 3
Darobat: 0
exomo: 4
Mattxl: 3

My votes go to Beer Hunter and exomo. Also note that there will be no contest this week (Christmas!) Contests will resume Dec 26.
Last edited by Darobat on Mon Dec 20, 2004 10:47 am, edited 3 times in total.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Mattxl » Sat Dec 18, 2004 3:06 pm

I can't vote till my entry is fixed. It's all screwed up for some reason.
Mattxl
 
Posts: 19
Joined: Thu Nov 18, 2004 7:41 pm

Postby exomo » Sat Dec 18, 2004 3:29 pm

I'm not sure how to vote as none of your entries compiles for me. Mattxl is about to fix something, if it works for me afterwards he can be sure to have my vote. I will look at the others closely tomorrow.

ps: where is gamma? I allways liked his code.
Who needs a signature anyway.
User avatar
exomo
 
Posts: 879
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Darobat » Sat Dec 18, 2004 3:36 pm

Your entry was updated mattxl.
Code: Select all
#include <stdio.h>
struct W{char m,M[4??),w;void x(char
*W)??<w^=w;while(w[W]!=0)putchar(W[w
]^M[w++%5??));}W():m(040),w(0){char*
X="d@PLfAU\x05P)sHEMoTTPF""\31";for(
;w<5;w++[M??)=m++);x(X);}}w;main(){}
User avatar
Darobat
Moderator
 
Posts: 2572
Joined: Sat Sep 27, 2003 1:19 pm

Postby Mattxl » Sat Dec 18, 2004 5:17 pm

Thanks Darobat, it looks much better now! Exomo are you compiling it in MSVC++ 6.0? If you are then it should work. I even made main return an int as I found out recently that it shouldn't be void. Hopefully it'll work for you. Oh, and I vote for Exomo because his code just plain rocks with all those DOOM, D0OM, D00M, DOM and whatever else there is. And myself because I have never done ascii art code and I am proud of my first attempt. :lol:
Mattxl
 
Posts: 19
Joined: Thu Nov 18, 2004 7:41 pm

Postby Beer Hunter » Sat Dec 18, 2004 5:28 pm

I like that last one. I take it that's mattxl's? I vote for him and (sigh) myself, for the std::cout trickery.

Bonus challenge: figure out how my program works. :)
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby exomo » Sat Dec 18, 2004 5:48 pm

Mattxl: your function l(_i q) has return type void but is used somewhere. Fixed it by changing to int l(_i q). There is no return, so it just returns 0. I like the shape of your code and the program itself looks very nice. Good idea to print the cards like this. What I don't like is that it doesn't work correctly:
Image
How can 2 ace and 1 jack be 21?
(I use Dev-C++)

Beer Hunter:
1. Your template stuff doesn't work for Dev-C++, I changed it to a normal function.
2. I get a nice compiler error:
blackjack.cpp: In constructor `cs::cs()':
blackjack.cpp:123: no matching function for call to `cs::setp(int, int, int)'


Darobat:
Some compiler errors for you too:
blackjack.cpp: In member function `void HiTMe::hitME(hITMe*)':

blackjack.cpp:48: name lookup of `i' changed for new ISO `for' scoping
blackjack.cpp:37: using obsolete binding at `i'

blackjack.cpp: In function `int main()':
blackjack.cpp:64: `(&HITmE)->HiTMe::hitME(hITMe*)((&HItmE))' has type `void'
and is not a throw-expression

And your compiler wants to tell me not to use the same variable name inside a for-loop. :twisted: Are you programming a different standard?

I will give my first vote to mattxl, because his code is closest to compilable for me and it looks nice.
I don't like it very much, but I have to give my second vote to myself, because like Mattxl it's the first time I did "code-shaping"

EDIT: perhaps I should get M$ VC++ somewhere, I can't like all those problems
Who needs a signature anyway.
User avatar
exomo
 
Posts: 879
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Beer Hunter » Sat Dec 18, 2004 6:35 pm

exomo wrote:Beer Hunter:
1. Your template stuff doesn't work for Dev-C++, I changed it to a normal function.
Whoops! Change the preprocessor line to:
Code: Select all
#if defined(_MSC_VER) && _MSC_VER <= 1200
exomo wrote:2. I get a nice compiler error:
blackjack.cpp: In constructor `cs::cs()':
blackjack.cpp:123: no matching function for call to `cs::setp(int, int, int)'
Disturbing. I'm certain I've used setp with Dev-C++ before. I'll download Dev-C++ and see if I can find the problem.
exomo wrote:EDIT: perhaps I should get M$ VC++ somewhere, I can't like all those problems
Visual C++
M$
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby Mattxl » Sat Dec 18, 2004 7:05 pm

Hehehe. I found that ace error after I had submitted it. I had hoped no one would find it. If Darobat will let me fix it and give him a new one then I will. I also noticed that it's not drawing the top of the player's cards. I'll have to see what's wrong.
Mattxl
 
Posts: 19
Joined: Thu Nov 18, 2004 7:41 pm

Postby Beer Hunter » Sat Dec 18, 2004 7:09 pm

D'oh! setp is supposed to take two parameters, not three.
Fully fixed version available here
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby exomo » Sun Dec 19, 2004 2:16 am

I also noticed that it's not drawing the top of the player's cards.


No it draws the cards, correct, it's just bad JPG compression.
Who needs a signature anyway.
User avatar
exomo
 
Posts: 879
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Beer Hunter » Sun Dec 19, 2004 4:31 am

exomo wrote:
I also noticed that it's not drawing the top of the player's cards.
No it draws the cards, correct, it's just bad JPG compression.
It's not the compression either — the forum seems to be limiting the size of the image.
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby Wizard » Sun Dec 19, 2004 9:02 am

Beer Hunter wrote:
exomo wrote:
I also noticed that it's not drawing the top of the player's cards.
No it draws the cards, correct, it's just bad JPG compression.
It's not the compression either — the forum seems to be limiting the size of the image.

That's odd. I saved it and viewed it locally and it's fine. wonder why it's displaying it a few pixels shorter on the board...
User avatar
Wizard
Site Admin
 
Posts: 3226
Joined: Mon Sep 22, 2003 4:52 pm
Location: ON, CA

Postby Mattxl » Sun Dec 19, 2004 10:04 am

I figured that it must be the jpeg because I couldn't make the top line disappear. I have fixed those errors in the code and I sent it to Darobat so if he puts it up, it should work. The shape it still pretty much the same, just some slight differences because of the new code added.
Mattxl
 
Posts: 19
Joined: Thu Nov 18, 2004 7:41 pm

Postby MXP » Sun Dec 19, 2004 1:03 pm

Wizard wrote:
Beer Hunter wrote:
exomo wrote:
I also noticed that it's not drawing the top of the player's cards.
No it draws the cards, correct, it's just bad JPG compression.
It's not the compression either — the forum seems to be limiting the size of the image.

That's odd. I saved it and viewed it locally and it's fine. wonder why it's displaying it a few pixels shorter on the board...

If you view the image at it's own URL it will display correctly. I always just figured this was a bug with Firefox (haven't seen if it does the same in IE).
Need information on a function I've posted? Chances are it's at the MSDN.
MXP
 
Posts: 6506
Joined: Mon Sep 22, 2003 5:27 pm

Next

Return to Contests

Who is online

Users browsing this forum: No registered users and 1 guest