Sudoku Brevity Contest

Online C++ programming contests.

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

Postby Safari » Wed Jan 18, 2006 1:46 am

231? :shock:

I'm at 271, don't think I'll get lower with this algorithm. :(

Edit: Make that 258 :\
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Safari » Wed Jan 18, 2006 6:21 am

230 tokens using the same algorithm I've used from the start :D
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Safari » Wed Jan 18, 2006 7:17 am

To continue on my monolog

tokxx.exe -a sudoku.cpp
219

What's up with this secrecy? I know more people than BH and Darryl are participating.

Edit: Forgot to delete some unused variables after some recent changes. Tokens = 214.

Edit2: is => are
Last edited by Safari on Wed Jan 18, 2006 8:09 am, edited 1 time in total.
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Darryl » Wed Jan 18, 2006 7:47 am

Safari wrote:To continue on my monolog

tokxx.exe -a sudoku.cpp
219

What's up with this secrecy? I know more people than BH and Darryl is participating.

Edit: Forgot to delete some unused variables after some recent changes. Tokens = 214.


214!!! Good job....I think I need to rework my algorithm

@BH, rand()&random_shuffle() are definitely good enough, but I am not quite I understand your proposal. I believe you are saying that the puzzle generated shouldn't be limited to a certain subset of possible puzzles. While a good proposal, I don't know if it could be easily tested for example like with Safari; if his has a ~32000 max, unless I studied his algorithm, I couldn't easily discern that his has a limit.

Also, BH, in case you didn't realize, string_literal/80 will be integer division (throwing away remainders), so you can have a string up to 159 chars before it's counted as 2
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Darryl » Wed Jan 18, 2006 4:14 pm

Well after changing my algorithm and exploring my own heat death solution , I went back to my original algorithm and got it down to 245. Only 31 more to go to catch you Safari :-)

One other thing I thought I'd mention; you must include "int" in front of main() as my new more standards compliant compiler won't allow otherwise.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Beer Hunter » Wed Jan 18, 2006 11:47 pm

Darryl wrote:I believe you are saying that the puzzle generated shouldn't be limited to a certain subset of possible puzzles.
Right. Ideally, entries should include a quick explanation, though, to save the readers' time.
Darryl wrote:Also, BH, in case you didn't realize, string_literal/80 will be integer division (throwing away remainders), so you can have a string up to 159 chars before it's counted as 2
So a string less than 80 characters counts as zero tokens? OK, I can use that to reduce my token count. ;-)

EDIT: Are we allowed to use '#include "iostream"', or do we have to use '#include <iostream>'? My current token count is either 174 or 182 (or 175/183, if I add one for having a string 162 characters long).
User avatar
Beer Hunter
 
Posts: 912
Joined: Sat Dec 13, 2003 7:12 pm
Location: Australia

Postby Safari » Thu Jan 19, 2006 1:19 am

lol, I thinkI'll give up. I think I can get less than 200 (I'm at 203) but never down to 174 :roll:
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Darryl » Thu Jan 19, 2006 7:22 am

So a string less than 80 characters counts as zero tokens? OK, I can use that to reduce my token count. ;-)
:oops:

Guess I didn't think it through....however upon more thinking, I think I'll drop/modify the string requirement to no strings over 255 char.

Yes you can do the #include"iostream", however I didn't want to announce it because then everyone will do it, negating the benefit :-)

My goal was to get to 200, but I am already ready to give up too at 240. Safari, did you still want a Sudoku checker... I whipped one up yesterday ( it was actually my failed heat death entry, but the checker part is good, it was the generating part that failed) and I can quickly modifiy it to accept a file as input.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Alvaro » Thu Jan 19, 2006 12:22 pm

My first attempt has 188 tokens, and I haven't even used any obfuscation tricks, but the sudokus generated have a lot more structure than required. Would that be acceptable?
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Darryl » Thu Jan 19, 2006 12:31 pm

188!!! Geez, I was proud I just got down to 206!

What do you mean a lot more structure?

The formatting should appear as in the rules, each 3x3 grid is seperated by a space from it's neighbor on left/right and by a linefeed/empty line from it's neighbor above or below it.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Alvaro » Thu Jan 19, 2006 12:44 pm

No, I am not talking about the formatting. What I mean is that the sudokus generated have strange properties, like 1, 2 and 3 always appearing on the same column of the top-left 3x3 square.

Oh, I had forgotten about the formatting. With an improved generator (not so obvious structures) and the correct formatting, I am at 209, so don't panic just yet. :)
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Darryl » Thu Jan 19, 2006 1:57 pm

I kind of figured after I posted you were talking about number arrangment/patterns or such. I don't have any problems as long as it generates a "sufficient" variety and randomness, but BH, might take exceptions, opting for solutions that don't use just a subset of the whole, but can theoretically generate any sudoku.

Mine can generate any, and i am guessing BH's can, but I think Safari's is only a subset generator.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Darryl » Thu Jan 19, 2006 3:37 pm

Safari wrote:lol, I thinkI'll give up. I think I can get less than 200 (I'm at 203) but never down to 174 :roll:


Don't give up yet, i just hit 203 :o still using my original algorithm.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

Postby Safari » Thu Jan 19, 2006 3:57 pm

Darryl wrote:but I think Safari's is only a subset generator.

Are you talking about my 186 token solution? :?:
















Okay, that solution works theoretically not yet practically. I'm having a hard time accesing the array at the right places using 1 single loop + 2D-array (i/3*3+s%3 etc etc, it actually gave me a headache).
你 好!
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Darryl » Fri Jan 20, 2006 1:38 am

Safari wrote:
Darryl wrote:but I think Safari's is only a subset generator.

Are you talking about my 186 token solution? :?:



Yawn, 186 is soooo yesterday
let me know if you reach 178
Last edited by Darryl on Fri Jan 20, 2006 3:27 am, edited 3 times in total.
User avatar
Darryl
 
Posts: 1342
Joined: Wed Sep 01, 2004 10:50 am
Location: Cayman Islands

PreviousNext

Return to Contests

Who is online

Users browsing this forum: No registered users and 2 guests