Page 1 of 2

Sodoku

Posted: Tue Sep 28, 2010 5:07 am
by waffle
It has been a long time since I posted anything on these boards.
Last weekend I had some spare time so I wrote this little game.

http://archonrpg.com/zips/wsodoku.zip

Be sure and read the readme before playing. Some of the menu options
don't do exactly what you would expect. When you first launch the game,
there are no games to play. To create games you can play, you need
to create them. There are 2 ways to do this .....

1 - Game - Create
will create 1 game each time, and save the master and get you ready to play

2 - Game - Enter
will let you enter any numbers for your game. This is useful for copying
a game from the paper. Next you will need to save the game. This
creates the master. To play the game, you will need to use the
Game - New option and select the game you saved.

game was coded with PB4.1beta
waffle

NOTE: I should have warned this was an Alphe release :)
the following bugs have been fixed ...

1 - a major crash/program hang when "Game-Create" ing a new game.
The issue was that I was using a sequencial file search to determine
a filename, but forgot to increment the variable :shock:

2 - When playing a "Master" or "SMS" game, you could sometimes
erase the original numbers ... not anymore :)
This error was caused by using the same data "setgadgetdata"
for multiple purposes, and then checking for either
a "bit - set" or "non-zero" or "<0" .... but not always correctly.

3 - sometimes, when you clicked on a spot, the number would not enter
or would enter into the wrong location. This was caused by testing for
"string gadget events" without checking for "which events", so,
a "lost focus" event would trigger a number entry.

Also, I added a few speed improvements ....
Hopefully everything will work better now.

And, an extra note:
Anyone wanting source code should explain why. The reason is the source is
700 lines long. Not as long as my IDE project (11000+), but still a bit wordy to simply post.

Re: Sodoku

Posted: Mon Oct 11, 2010 6:48 pm
by waffle
I upgraded the help systemt to use *.htm file instead of txt. The help file can be viewed
http://archonrpg.com/PBSources/sodoku/sodoku.htm
Included in the help file are some screen shots if interested.

Re: Sodoku

Posted: Tue Oct 12, 2010 2:34 am
by Vera
Hi waffle,

thanks for a seemingly neat game ;)

I'm no sudoku-player myself but very curious to understand why 'half of the word' is addicted to it (including some friends) - that's why I had a look - and comparing it to others I've seen before - I like it :)

Although I'm mostly impressed on how you managed the including help ;)
As for that: your DL-help misses the screenshots - or is it done on purpose?

The support by marking the numbers (and the rows) is very helpful.
The error-sounds are becoming heavily annoying when you come to a stage where you have to delete loads of previous number settings to free the fields. (I wished I could turn off these sound warnings & I wished a double-click could remove an entry just as that)
Plus: I also wished I could remove all setted numbers of the currently preselected number in one go.

Another major experience was: when comanding to solve the puzzle after having played a while, wsudoku overloads - freezes other open applications - and can only be closed to regain CPU power ;)

Btw: what about resizing your game for those who don't have good eyesights ?
[I'm fine - still it seems uncomfortably tiny for longer usage]

so far for the moment

greetings ~ Vera

Re: Sodoku

Posted: Tue Oct 12, 2010 7:15 am
by waffle
The images not appearing in the direct-link help file could be cause by the "/" being backwards
for your type of web browser... I have had complaints about that in the past but have been too
lazy or busy to correct my htm editor :oops:

About the erasing numbers with sounds... ??
Normally to erase numbers I just click on zero (0) and then each click removes a number.
It should only beep if you try to delete a number that is supposed to be perminate.
I will look into a way of customizing the beeping system :?

I do like your idea to delete all numbers as selected ... Maybe I will add that feature.

I will look into the "solve" feature and see whats wrong. The solve function is also
used by the Create menu, so it may take a few days for me to simulate :mrgreen:

The resizing option sounds like fun. The overal concept is straight forward.
I will look into it. My eyes are not so young anymore too :D

Re: Sodoku

Posted: Tue Oct 12, 2010 1:34 pm
by Vera
Hi,

sorry, if I haven't been clear enough: the images cannot appear because they are missing in the download. There's no trouble with the "/" slashes as there are none at all in the html code at the moment.

About the sounds...
Thanks for the '0' - I didn't know what it was good for and using it will not alarm. :) As the '0' doesn't show off you could also display an 'X' instead of the number, which would make it's usage more obvious.

Still when deleting or trying to place a number in the wrong place the alarm appears, because these are unavailable (forbidden) commands. The alarm is supplied by WIN and I don't think you could prevent it. (At least I wouldn't know how)

About the "solve" feature...
on new creation a possible solution may be achieved easily, but when I've played a while and placed my own numbers into the fields the amount of dependencies is much higher and will demand encreasingly more calculations where a process delay would be needed.

grettings ~ Vera

Re: Sodoku

Posted: Wed Oct 13, 2010 5:51 pm
by waffle
Fixed everything :)

I thought you ment the images were not appearing in your brower... I did find that
sodoku.GIF was refered to as sodoku.gif which sometimes is an issue online. But, yes,
now all images are included in the zip file.

I fixed the Solve Game Error. The problem was caused by the program not marking your
numbers as "starting points". What this means in AI is the program would try numbers (1-9)
looking for a valid number. If I don't mark the starting point, you get an endless loop
because the program won't know when it has tried all the numbers.

I add the custom sound options

The Game is now resizable and it saves all sound and size settings to a *.ini file
for the next game.

I havent changes the "0" to an "x" yet. Don't know why I did not think of that before :shock:
Maybe because I wrote this moslty just for fun. Did I even mention the "0" in the help file?
That is quite an oversite :)) But still, I was suprised I wrote the first draft in 2 days.

Re: Sodoku

Posted: Thu Oct 14, 2010 3:59 pm
by Vera
Dear Waffle,

the improvements are great and solving now is quicker than a single look :)
(thanks for the explanation)

It's good to have no sound and it's fun to choose an independant sound of one's own taste. :mrgreen:
How do you suppress the alarm sound? I only know how to do it with a MessageRequester by adding $50 or $80 as further flag.

The resizing is helpful and nice that one can even make it none-quadrate. And it's also nice to watch how the gui builds up when starting.
Although the numbers keep their size and position the bigger distance between them makes viewing more comfortable. (Don't know what gadgets you use, maybe they allow a centering of the contents?)
Of course there is a flickering now when resizing. You can prevent (or reduce) it by using SmartWindowRefresh(). [Will also help with the WebGadget()].

Undo works fine and unlimited, as far as I've tested it. And the shortcut is handy.

Unfortunately 'delete number' and 'reset game' don't do anything yet.

About the colors..
1. as you choose red as marking-background and preset the numbercolor to red as well, they will of course vanish when the marker is turned on. Maybe choose a different numbercolor as presetted or allow it to become a custom setting as well?

2. there's a mischief with the lightgrey highlighting because it doesn't clear when I've cleared a field. So the game gets more and more grey although the fields are empty.
-> changing from one game to another doesn't clear the grey fields from the previous game. They are ported and added to the new loaded one.
-> with all this grey background the numbers are harder to see and the new color palette now misses some light colors. What about allowing a custom-color here as well ? [not necessaryly as gui-option, maybe as manuel ini-setting]

But don't worry - keep doing it for fun 8)

cheers ~ Vera

Re: Sodoku

Posted: Fri Oct 15, 2010 5:38 am
by waffle
i think you grabbed an "interum" release. I release I posted and then fixed and reposted.
The latest posting seems to work fine. Maybe you grabbed it while I was "fixing" and "testing".
Generally, I post from my laptop and test on my moms desktop to ensure everything is fine.
I do remember a glitch with the colors and such, and I fixed it about an hour later. I just retested
on the desktop, (win Vista) and seems ok.

Thanks for playing, If you "complain" again, I'll shoot you :))
ok, if its still there, I'll look into it again. ....
I won't really shoot you ..... I promise ...

Re: Sodoku

Posted: Fri Oct 15, 2010 5:47 pm
by Vera
waffle wrote:i think you grabbed an "interum" release.
yes - I was ten hours too early ;)

now all commands work fine and it's a good improvement to be able to remove the setted numbers and a good option to restart the current game in case of...

well - as for that greyish overload - it can be worked around by new starting instead of new loading :mrgreen:

but it's not all days end - is it :wink:

cheers ~ Vera

Re: Sodoku

Posted: Fri Oct 15, 2010 6:32 pm
by waffle
For the "game grid", I use the PB StringGadget. In PB41B, it does not have the option
to center text (maybe if I used an API message ....) but that is extra work....

About the "Grey Out" error... Exactly how does that happen. I have tried to creat that, so I could fix it,
but I cant simulate. Generelly, when I play, I "Game - Create" and play that game.

When I start a new game that way, I have no problems. Are you switching from multiple saved
games? I do some "odd" things when saving a game ... maybe that is the source of the problem...
When I save the game, I save all color schemes as well. Maybe, thats the problem?

Maybe, older game saves are simply not working right??? Could be because I generelly never replay
a saved game ... not sure how to fix what I can't simulate... I may play some more this weekend.

Re: Sodoku

Posted: Sat Oct 16, 2010 5:12 am
by waffle
I could not simulate the highlight bug, but I made a few guesses on the cause...
I also added a "build - date" into the about box .... from the #PB_Compiler_Date ...

The current one is 1.4 dated 15 Oct at about 9pm
I hope this fixes it.

Re: Sodoku

Posted: Sat Oct 16, 2010 4:23 pm
by Vera
Hi,
sorry, your changes didn't make a difference yet.

Game/create/play/close - restart: NEW this *.sms game => all numbered fields are highlighted
play and save as *.ssv - restart: LOAD this *.ssv => only changed numbered fields are highlighted


Well, as to simulate what I mean try the following:
1 -
NEW or LOAD a game: => all numbered fields are highlighted grey
-> move the app away from the center to keep it in sight
-> call the requester to open another one => the numbers in the app will vanish BUT the highlighting is preserved
-> then open another game => the new numbered fields are greyed PLUS all previous greyed fields stay grey although empty
-> ... with every new opening more and more fields are grey

2 -
when playing: set a number anywhere => that field will be highlighted
-> remove a number => the field stays highlighted although empty
-> the more you set & remove the more empty grey fields you'll get

I think whenever removing a fieldentry (by reopening or clearing) the highlighting should be resetted to none as well. This should solve all those effects.

Well if you open WSodoku and just play straight on without correcting much you won't really notice. But someone who can't decide which one to play and switches until a game applies to him or often resets ... will quickly come along this effect.

I hope you can see what I meant now

cheers ~ Vera

Re: Sodoku

Posted: Mon Oct 18, 2010 5:53 pm
by waffle
Ok, I found a few bugs in my load game routine. It would load masters ok, but was not reading
all the data from saves .... The way I noticed this is from my custom masters not loading right...

Added batch undo options, so now you can undo Delete Number, Delete Color, Game Reset.
The new version is 1.5 dated today about 10am :)

Re: Sodoku

Posted: Mon Oct 18, 2010 9:57 pm
by Vera
Hello you hardworking gamer ;)

Wow - that's the first UNDO menu I've ever seen and it works straight and fine Image

But ~ I am so so sorry - now the game is always totally grey and that's only depressing to look at :(
I think a screenshot is needed. <removed>
1- opening WSodoku => all fields are empty and lightcolored
2- Creating /New / Load-requester => all fields turn grey
3- now every game is always grey from the beginning, no matter what you do

I can't understand why you can't see that the background changes from light to something else, which makes it grey on my system. That's why I asked you in the beginning, if this background highlighting could become a custom color. Then everybody could choose what is comfortable to him.

GREAT - grey was yesterday ~ now the color comes to life :D

Image

Vera

Re: Sodoku

Posted: Tue Oct 19, 2010 4:47 am
by waffle
ok, custom colors added :)

Default Back Color ( normally white space for me)
Default Highlight Color (Normally Grey)
Marking Color (Normaly Red) for the numbers

All three colors can be changed and the changes are saved to the INI file
The changes can be edited from the Game - Color menu.

And, I have not shot you yet ;)