May 08, 2024, 06:03:08 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Sudoku

Started by TonyMUK, January 13, 2009, 01:38:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TonyMUK

This is my attempt at a sudoku program that does not rely on pre-generated grids. The grid is generated randomly every time. Please excuse my sloppy programming but I haven't got round to tidying it up yet.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

mrainey

Software For Metalworking
http://closetolerancesoftware.com

TonyMUK

Thanks. The greatest challenge was creating a workable grid in a reasonable time. My first attempts were take over 15 minutes.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

RG

the grid generation is very fast - good job

are you going to put in different degrees of difficulty? didn't know what levels these are

TonyMUK

Thanks. I tried to make it as quick as possible while still been a fully solvable grid. I will get round to different levels of difficulty as well as some other features I want to add.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

TonyMUK

Updated.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

TonyMUK

Final update unless anyone has anything they would like to see added.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

fasecero

Nice and fun, good work and thx for sharing!!   :)

TonyMUK

Can't see the point in writing these things if I wasn't going to share them. I get paid for programming in my professional life so anything I write for fun I share.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

Haim

Thanks for sharing this,

Haim

RG

I play Sudoku so I have two suggestions to make this playable for me:

1. Right now the only number input seems to be clicking multiple times on a square. Easy for numbers 1 & 2, hard for 8 and 9. There also seems to be a slight delay in reading the next click so sometimes it takes 11-12 clicks to get to number 9. Any way to allow both clicking input or typing in the number directly?

2. I liked the buttons on the first version as they were easily accessible. Can you have both menu and buttons for some of the common commands? The ones I would use most would be new grid and check.

I do like the overall simplicity and speed of the game.

Rich

TonyMUK

Right click on a square and it brings up the numbers 1 to 9 with 0 to erase. Just click on the number you want to place it in the square.

I took the buttons off because I thought the menus looked better. I'll put them back on if that's what you prefer. Will update sometime in next two days and post new version.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

RG

Oh, that's a big help (right clicking) - just what I needed.

TonyMUK

Latest and final version.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

mrainey

QuoteLatest and final version.


There's no such thing as a final version.   :D
Software For Metalworking
http://closetolerancesoftware.com

TonyMUK

True, but there is a version I'm not going to be changing any more.  :)
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

Brian

Good stuff, Tony - I managed to complete an "easy" Sudoku without any problems

Brian

TonyMUK

Glad you like it.  ;D
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

Brian

Tony,

There is a slight problem with the Double Size:

If you select New Grid, and then Double Size, the grid is OK

If you close the program, and restart, then select Double Size before
New Grid, the grid has double numbers, slightly offset

Brian

Johnny

Hi,

Nice program by the way!   :)

I noticed also the strange double printing, checked the code, and changed five lines to make it printing cleaner.

Modify lines 222, 274, 321, 391, and 448, as follows:
Move w1,m*20*Scale+26*Scale,n*20*Scale+22*Scale
(Watch out, line 274 uses "a" and "b" in stead of "m" and "n", keep the original variables!)

One other thing, sometimes I think I solved the puzzle, but the program refuses my solution, although I think it is solved correctly???   :-[
(Atached image) Well, I could be wrong though, I never solved a puzzle like this before... :-[

Kind regards,
Johnny

celphick

January 25, 2009, 12:31:22 AM #20 Last Edit: January 25, 2009, 04:44:38 PM by celphick
Johnny
Your solution is correct.
I found an example that had 7 correct solutions.
I suspect that the answer is checked against the generated puzzle, not against the solutions own integrity.
Don't quibble about a nicely developing program that its author is revealing as it is developed.
Regards Colin.

TonyMUK

It does indeed check against the solution it has generated. I have not gone as far as checking if there are other solutions available.

Thanks for the fix for the double printing.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

Johnny

Hi,

Colin, I don't know where you got the idea that I'm criticizing the program, I like it, and that was also what I stated at the start!
The only thing is, since I never tried to solve a puzzle like that (I even stated that in my first message), I wasn't sure that I really solved it the correct way, or maybe overlooked something, or maybe just something like several solutions possible (Tony's answer cleared it up, that is was just this last possibility), hence my (rather embarest!) question.
Remember that not everybody is as good in games as you might be Colin, I barely have time for that in my life, hence my ignorance.
So in the future, please try not to twist somebody's words into an evil remark...
I rather like to help here or there "a little bit" than to "quibble"!

And to Tony, thanks for sharing your work!

Kind regards,
Johnny

TonyMUK

I didn't take it as criticism. Any comments are welcome when they are constructive.

Cheers Johnny.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.

TonyMUK

Said I wouldn't but have updated again. Now allows other solutions as well as the one it originally generates.
Check out www.arnoldchiari.co.uk. If you don't know what Arnold Chiari is you are very lucky.