Contest 45: 7 Card Draw

Online C++ programming contests.

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

Postby Corsix » Sun Aug 21, 2005 9:19 am

Alvaro wrote:
Corsix wrote:I would like to see if gamma or alvaro are going to enter...

I just got back from a nice two-week vacation. I have programmed this before, but with speed in mind, not brevity. I'll give it a try...
Welcome back :)
My entry is SLOW (a few seconds for each line of the input file), but small.
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Beer Hunter » Mon Aug 22, 2005 3:22 am

A few seconds? Sounds like something I came up with earlier. However, I ended up going back to the one that takes about 1/5 of a second when I found a way to save a few tokens that way. Unfortunately, I still have 351 tokens. :-(

EDIT: 349
EDIT: 347
EDIT: 341
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby Corsix » Mon Aug 22, 2005 5:00 am

332 :)
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Beer Hunter » Mon Aug 22, 2005 6:36 am

326. I noticed a 13-token line that wasn't doing anything useful.

EDIT: 322
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby Darryl » Mon Aug 22, 2005 7:16 am

Just when I thought you guys were slowing down...

I think i've reached my limit @478 with my current design, will have to rethink from scratch
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Corsix » Mon Aug 22, 2005 8:49 am

Beer Hunter wrote:326. I noticed a 13-token line that wasn't doing anything useful.

EDIT: 322
Not sure I can kill ten more tokens....

Edit: Actually, yes I can: 313
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Togra » Mon Aug 22, 2005 11:32 am

Crap, I haven't even started yet... Must find some time, I have some ideas on how to start. One is a sure winner, but will certainly take far too much time developing, like a few months :).
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Safari » Mon Aug 22, 2005 12:16 pm

This file doesn't belong to the site you came from

Please e-mail the webmaster of the site you came from and tell him:
NOT TO LEECH OTHER SITES LINKS!!

Definition of a Leecher: One who is to lazy to link from his own server or steals other peoples hard work and makes it look like his own

Your IP address has been logged.

If the page does not automatically reload, please click here


Can someone host that token counter program for just 5 mins so that I can download it?
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Darryl » Mon Aug 22, 2005 12:54 pm

Darryl wrote:..


EDIT: Nevermind, found a link here: http://www.cyberkopia.net/gamer/modules ... d=6&lid=13

..


this page works and the link on the page work...
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Safari » Mon Aug 22, 2005 12:58 pm

Not for me... I also tryed to download it by getting to the file through the site but I still couldn't download it :\
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Darryl » Mon Aug 22, 2005 2:26 pm

Ok, you can get it from here
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby TheKidder » Mon Aug 22, 2005 2:29 pm

For all of you that can't download it for some reason: http://loljk.com/tokxx-exe.zip

edit: Darryl beat me to it
w00t!
User avatar
TheKidder
 
Posts: 525
Joined: Mon Nov 24, 2003 7:57 pm
Location: MI

Postby Darryl » Tue Aug 23, 2005 6:12 am

Darryl wrote:Just when I thought you guys were slowing down...

I think i've reached my limit @478 with my current design, will have to rethink from scratch


found some new inspiration and i'm down to 440, but I have another idea too.

I also found out there's a max string literal limit on vc7, will have to try on devc and vc8, do anyone know offhasnd if there's a limit on devc literal strings?
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Corsix » Tue Aug 23, 2005 6:20 am

Darryl wrote:I also found out there's a max string literal limit on vc7, will have to try on devc and vc8, do anyone know offhasnd if there's a limit on devc literal strings?
Yarr, I found that too...
Code: Select all
#include <stdio.h>
char*_="XxTIHRCXCxTIHRXRCxTIHXHRCxTIXIHRCxTXTIHRCxXxTIHRCX";
int main(int l){for(l+=7;l!=putchar(010);++l);if(*(++_))main
(*_!=88?(putchar(*_^073)|putchar(33))&1:0xffff2a8b);}
User avatar
Corsix
 
Posts: 1181
Joined: Fri Jul 23, 2004 9:33 am
Location: Berkeley, UK

Postby Safari » Tue Aug 23, 2005 10:34 am

Lol, I had a token count of 288 when I discovered that writing

using namespace std;

instead of std :: string etc

gives you less tokens. Now I'm at 262 :) BUT I haven't done the function that checks if you have a Royal Flush etc :(
lol, I'm not even sure that I will manage to make one... :P
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 1 guest