Any interest in a brevity contest.

Online C++ programming contests.

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

Any interest in a brevity contest.

Postby Darryl » Fri Aug 10, 2007 2:05 am

I have a nice simple one, will probably easily be under 100 tokens. If at least 4 people say they will definitely do it, i will post.

Please note, I am counting literal strings differently than in the past.
Strings will be counted at the rate of 1 token per 256 chars per string or to put it in formula, (string_length / 257)+1
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby schloob » Fri Aug 10, 2007 2:38 am

i don't think i have any chance at coming close to any of the other people here but i wouldn't mind trying. i love these things.
:]
User avatar
schloob
 
Posts: 1853
Joined: Mon Feb 16, 2004 10:29 am
Location: Seattle

Postby Emery » Fri Aug 10, 2007 2:46 am

I'll compete. And ditto what schloob said about being utterly inferior and so forth...
--~~~~
User avatar
Emery
 
Posts: 4313
Joined: Sat Mar 19, 2005 9:16 am

Postby Zen » Fri Aug 10, 2007 2:55 am

Ok, count me in.
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby Darryl » Fri Aug 10, 2007 3:37 am

That's 3, just need 1 more. As far as coming close ... the people that did the best haven't been around in a while, Togra, Beerhunter, Corsix, and Gamma. The only other regulars in the brevity was me and Alvaro which Alvaro is pretty good and as for me, I am just persistent. I typically start with some huge program and then just keep at it until I get it low.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby exomo » Fri Aug 10, 2007 6:20 am

I'm in.

I should spend my time on learning, but there's allways some time for programming ;)
Who needs a signature anyway.
User avatar
exomo
 
Posts: 894
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Alvaro » Fri Aug 10, 2007 1:23 pm

Thanks for the kind words, Darryl, but I am afraid I am out of shape. I'll give it a try anyway. I remember these things were a lot of fun.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Zen » Sun Aug 12, 2007 2:08 am

So... bring it on :)
User avatar
Zen
 
Posts: 1088
Joined: Wed Sep 24, 2003 1:41 am
Location: Norway

Postby Darryl » Mon Aug 13, 2007 1:06 am

I had one, but then I got to thinking about it and while I can only solve it by brute force...the problem is very mathematical in nature (and easy) and I suspect someone like Alvaro could solve it with a one-liner :-) so I've been trying to think of another. While I am thinking I'll let you know what I was gonna do though....

Given a grid, like a chessboard, you have 64 - 1x1 square, 1 - 8x8 square and a number of squares of various dimensions in between. Placing a pawn on an arbitrary position on the board, calculate the number squares that contain it.

Now if Alvaro tells me this can only be done by brute force, then we can continue with it as the contest, otherwise I am thinking of another.

If we continue on with this problem, I will pass the position of the pawn on the command line, a number from 0 (lower left) to 63 (upper right), going from left to right then up
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Alvaro » Mon Aug 13, 2007 2:44 am

I don't know what you mean by "brute force". I got a 96-token solution without too much effort. I think this will be fun.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Emery » Mon Aug 13, 2007 3:19 am

I guess we're all competing for second place, knowing that Alvaro will be in first. =)
--~~~~
User avatar
Emery
 
Posts: 4313
Joined: Sat Mar 19, 2005 9:16 am

Postby GiovaMaster » Mon Aug 13, 2007 3:46 am

--------------------------- Alvaro is my Idol -----------------------------
The essence is the problem, and the algorithm is in me
User avatar
GiovaMaster
 
Posts: 168
Joined: Sun May 23, 2004 2:53 am
Location: Florence, Italy

Postby Darryl » Mon Aug 13, 2007 3:56 am

Alvaro wrote:I don't know what you mean by "brute force". I got a 96-token solution without too much effort. I think this will be fun.


Some solution that requires a certain amount of iteration and counting of boxes, versus just an equation that solves it outright...

I was also trying to avoid a recursive solutions like Fibonacci numbers or Factorials, which although iterative, still has a kind of simple equation feel to them.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Alvaro » Mon Aug 13, 2007 4:04 am

Darryl wrote:
Alvaro wrote:I don't know what you mean by "brute force". I got a 96-token solution without too much effort. I think this will be fun.


Some solution that requires a certain amount of iteration and counting of boxes, versus just an equation that solves it outright...

I was also trying to avoid a recursive solutions like Fibonacci numbers or Factorials, which although iterative, still has a kind of simple equation feel to them.

I don't think this will have a closed formula. At least not one simple enough to turn it into a short program.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Darryl » Mon Aug 13, 2007 4:28 am

Ok just to make sure everyone knows the rules and contest description:

Given a grid, like a chessboard, you have 64 - 1x1 square, 1 - 8x8 square and a number of squares of various dimensions in between. Placing a pawn on an arbitrary position on the board, calculate the number squares that contain it.

The 1x1 square containing the pawn will be passed in on the command line, a number from 0 (lower left) to 63 (upper right), going from left to right then up. ie. the bottom row = 0 to 7 going left to right

I will use Visual Studio 2005 to compile, if I get questionable errors, I will try it on Dev C++ (mingw) and if it still doesn't compile will be disqualified. If you know that your program is compiler dependent, let me know ahead of time.

If it produces the wrong answer it will be disqualified.

I will be using the ever popular tokenx to count tokens. (However I will have to manually adjust for strings)

I personally don't like the <header> vs "header" trick so go ahead and use it, everyone :-)

strings > 256 char will count as size/256 tokens

comments don't cost anything. Hint, hint

you may only submit 1 file

you can send it to my gmail.com address with the user name of darryl.123
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Next

Return to Contests

Who is online

Users browsing this forum: No registered users and 0 guests