Contest 44: Crazy Calculator

Online C++ programming contests.

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

Postby Corsix » Mon Feb 14, 2005 9:57 am

I'm looking forward to seeing this 106/104 token code....
Last edited by Corsix on Mon Feb 14, 2005 10:11 am, edited 1 time in total.
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 gamma » Mon Feb 14, 2005 10:03 am

Do you give up already Corsix?
while (true){sleep(28800);work(57600);}
"Free" as in speech is so much better than "free" as in beer.
User avatar
gamma
 
Posts: 178
Joined: Mon Dec 01, 2003 9:16 am
Location: The Netherlands

Postby Corsix » Mon Feb 14, 2005 10:10 am

I cannot push my code below its current 112 - no matter how much I bash my head
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 gamma » Mon Feb 14, 2005 10:12 am

MSVC++ question:
is
Code: Select all
main(){}
legal on MSVC++? (no int specified)

g++ complains (and gives errors with -pedantic):
gamma44.cc:26: error: ISO C++ forbids declaration of `main' with no type


I heard rumors VC++ allows it...
while (true){sleep(28800);work(57600);}
"Free" as in speech is so much better than "free" as in beer.
User avatar
gamma
 
Posts: 178
Joined: Mon Dec 01, 2003 9:16 am
Location: The Netherlands

Postby Darryl » Mon Feb 14, 2005 10:14 am

I think it warns, but it allows it.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Corsix » Mon Feb 14, 2005 10:18 am

That fact that ur main() is on line 26 makes me think that your not using your main().....
... but yes it is legal on MSVC++
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 exomo » Mon Feb 14, 2005 1:25 pm

151 after removing int in front of main and replacing <fstream> with "fstream".
I give up; I can't find anything to make it shorter 8) 8)

really wanna see the others 8)

EDIT: mingw-g++ (the one that comes with Dev-C++ 4.9.9.1) doesn't complain about main(){} without int either
Who needs a signature anyway.
User avatar
exomo
 
Posts: 879
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Corsix » Mon Feb 14, 2005 1:32 pm

Come on exomo, I can go (1 token) lower in CorsixScript!
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 » Tue Feb 15, 2005 10:02 am

gamma wrote:
Corsix wrote:So how many tokens without the seg fault?
I'll post when I'm under 100, okay?


Don't bother - 99! :D
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby gamma » Tue Feb 15, 2005 10:03 am

Nukkel
while (true){sleep(28800);work(57600);}
"Free" as in speech is so much better than "free" as in beer.
User avatar
gamma
 
Posts: 178
Joined: Mon Dec 01, 2003 9:16 am
Location: The Netherlands

Postby Darryl » Tue Feb 15, 2005 11:42 am

Woohoo! I finally broke 200..(195), don't everyone be impressed at once. Still have the rest of the day to catch you guys
[edit] 166... I'm in the home strech.
[edit2] I with the big boys now at 107
Last edited by Darryl on Wed Feb 16, 2005 5:34 pm, edited 1 time in total.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Togra » Wed Feb 16, 2005 10:12 am

With the deadline closing in, I wonder how everyone else is doing? Haven't heard from Alvaro and Beer Hunter for a while.
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Alvaro » Wed Feb 16, 2005 10:16 am

I kind of gave up after I got stuck on 129 tokens. I also haven't had the time to play with it, since my social life has been busy.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Togra » Wed Feb 16, 2005 4:09 pm

Alvaro wrote:I kind of gave up after I got stuck on 129 tokens. I also haven't had the time to play with it, since my social life has been busy.


Glad to hear that :). But wait - does this mean you're not going to finish the announced three new MathsChallenge-puzzles soon? Who will represent our C++-community at #1 then? Gamma is going on a vacation tomorrow... :(

Guess I'll just have to sacrifice my thursday afternoon!

BTW Alvaro, can you elaborate on what this 'testing' for MC means exactly?
Togra
 
Posts: 188
Joined: Wed Jul 28, 2004 8:51 am
Location: NL

Postby Alvaro » Wed Feb 16, 2005 4:14 pm

Togra wrote:BTW Alvaro, can you elaborate on what this 'testing' for MC means exactly?
The guy that writes the problems for mathschallenge.net (let's call him Euler), has screwed up a couple of times, either proposing a problem with poor or incorrect wording, or introducing the wrong number as the answer. A few other members of the "100% club" and I offered our help with testing the problems before they are released.

So, actually, I have already solved the three problems :). I will probably send in the solutions one day after the problems are released.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 2 guests