Jump to content
IGNORED

Sudoku for ColecoVision


Pixelboy

Recommended Posts

Hello people!

 

I'm happy to present the first beta of my very first ColecoVision homebrew, namely Sudoku! :D

 

There's no sound in this beta, but all other features are fully functional. I tried it under Meka, and it works quite well (the screenshots attached below were taken with Meka). I haven't tried it on any other emulator however, and I haven't tried it on the real hardware yet either.

 

Those of you who will try the ROM attached below, please be aware that the Sudoku grid generation can take from 2 to 15 seconds - perhaps even more - so please be patient while the "GENERATING GRID" message is displayed. The grid WILL be displayed eventually.

 

Controls in the main game are straightforward: Move the yellow cursor around the grid with the joystick, place numbers by using the keypad (1 to 9), and you can also remove a number by pressing a fire button. I'll let you discover the other features by yourselves. :)

 

Comments are welcome! :)

sudoku_no_sound_v1.zip

post-7743-1211857532_thumb.png

Link to comment
Share on other sites

Interesting. What algorithm for grid generation do you use?

It's an algorithm I came up with myself. I didn't spend too much time investigating existing algorithms documented on the web, so if my algorithm was already "invented" by someone else, it's purely coincidental.

 

Anyhow, my algorithm is of the "rollback if caught in an impass" variety. For each digit (1 to 9), I randomly place one instance of that digit in each 3x3 region of the grid. If I detect a collision within the same row or column, I rollback one step and randomly select another spot in the same region.

 

This works well for the first few digits, but the problem is that the more digits you successfully insert into the grid, the closer you get to reaching a logical impass which makes the grid unsolvable. If I detect such an impass, I simply restart the grid generation from scratch. From experience, a solvable Sudoku grid can be generated within 10 attempts (most of the time, under 4 or 5 attempts) with this algorithm. This explains why the grid generation sometimes takes a while to get done.

Link to comment
Share on other sites

Hello people!

 

I'm happy to present the first beta of my very first ColecoVision homebrew, namely Sudoku! :D

 

There's no sound in this beta, but all other features are fully functional. I tried it under Meka, and it works quite well (the screenshots attached below were taken with Meka). I haven't tried it on any other emulator however, and I haven't tried it on the real hardware yet either.

 

Those of you who will try the ROM attached below, please be aware that the Sudoku grid generation can take from 2 to 15 seconds - perhaps even more - so please be patient while the "GENERATING GRID" message is displayed. The grid WILL be displayed eventually.

 

Controls in the main game are straightforward: Move the yellow cursor around the grid with the joystick, place numbers by using the keypad (1 to 9), and you can also remove a number by pressing a fire button. I'll let you discover the other features by yourselves. :)

 

Comments are welcome! :)

 

Very well done Sudoku game... and it's for Colecovision! ;)

Link to comment
Share on other sites

It's an algorithm I came up with myself. I didn't spend too much time investigating existing algorithms documented on the web, so if my algorithm was already "invented" by someone else, it's purely coincidental.

 

Anyhow, my algorithm is of the "rollback if caught in an impass" variety. For each digit (1 to 9), I randomly place one instance of that digit in each 3x3 region of the grid. If I detect a collision within the same row or column, I rollback one step and randomly select another spot in the same region.

Are you sure you don't sometimes create unsolvable grids that way?

Link to comment
Share on other sites

Are you sure you don't sometimes create unsolvable grids that way?

Yes I am, because the algorithm won't quit until every space in the grid contains a valid number, and this validity is checked for each digit inserted in the grid. When the algorithm has completed its job, what you get is a solved grid, and after that, all I do is remove some digits randomly from the grid, and I let the player take it from there. It works every time, but as stated before, the only downside is how long the grid generation sometimes takes. :)

Link to comment
Share on other sites

Yes I am, because the algorithm won't quit until every space in the grid contains a valid number, and this validity is checked for each digit inserted in the grid. When the algorithm has completed its job, what you get is a solved grid, and after that, all I do is remove some digits randomly from the grid, and I let the player take it from there. It works every time, but as stated before, the only downside is how long the grid generation sometimes takes. :)

That makes sense.

 

But IMO you should add an additional check when removing digits. Currently your Sudokus can have more than one solution.

 

A few suggestions:

- more difficulties are IMO a must

- annotiations would be very helpful (either using the "clock" annotation or simply 3x3 dots)

- different colors for the different numbers help

- add more options (e.g. a checker, hints, best times, calculate annotations, restart grid, solve etc.)

 

I didn't get those ideas myself, but from my prefered Sudoku game. It's called 5ud0ku and for Java enabled mobile phones. Download is free.

 

BTW: I am too stupid to use Meka. Where is the # key? :)

Edited by Thomas Jentzsch
Link to comment
Share on other sites

But IMO you should add an additional check when removing digits. Currently your Sudokus can have more than one solution.

Having more than one solution is fine by me. When all spaces in the grid contain a digit, the program does a check to see if the grid is solved, and this check is done independently from what the grid generator produced initially. So if the player comes up with a different solution, the program will accept it.

 

- more difficulties are IMO a must

I find it hard to determine what constitutes "higher" or "lower" difficulties, since the software generates grids (and removes digits afterwards) in a very random fashion. I've read a few things on the net, and the subject of determining whether a grid is "easy" or "hard" is subject to debate. Right now, I find there's not that much of a difference between the "beginner" and "normal" skill levels in my Sudoku game.

 

- annotiations would be very helpful (either using the "clock" annotation or simply 3x3 dots)

Adding an annotation feature is not interesting to me, mainly because I did this game simply to introduce myself to ColecoVision programming, not to create the best Sudoku experience possible on the CV. There are better Sudoku applications out there and I'm fine with that.

 

- different colors for the different numbers help

I think the "visual aid" feature does a fine job already, IMHO.

 

- add more options (e.g. a checker, hints, best times, calculate annotations, restart grid, solve etc.)

Those are good suggestions, especially the hints system which would be nice, but then hints might be misleading in a multiple-solution situation. Also, there's one important thing I haven't mentioned until now: I want to release this game on cartridge as part of a 2-in-1 product. The other game on this proposed cart will be a "Memory Match-up" game called "Remember The Flag", and I'd rather design and code this other game before adding any new features to Sudoku. In the end, the inclusion of new features will depend on how much space is left in the available 32K of ROM, after "Remember the Flag" is finished and integrated.

 

BTW: I am too stupid to use Meka. Where is the # key? :)

I think it's the "=" key on the keyboard, IIRC.

 

 

Thanks for your comments! :)

Link to comment
Share on other sites

I find it hard to determine what constitutes "higher" or "lower" difficulties, since the software generates grids (and removes digits afterwards) in a very random fashion. I've read a few things on the net, and the subject of determining whether a grid is "easy" or "hard" is subject to debate. Right now, I find there's not that much of a difference between the "beginner" and "normal" skill levels in my Sudoku game.

Just checked the 5ud0ku source code. It has 3 difficulties, removing about 41, 48 and 58 digits. The difficulty differences a huge. Maybe because of the always unique solutions?

 

BTW: I always wondered why the created Sudokus look so nice. Now I found out. 5ud0ku uses 3 symmetric removal algorithms, removing 2 (swapping row and column, mirror row and column) and 4 (mirror row and/or column). Very clever.

 

I think the "visual aid" feature does a fine job already, IMHO.

Since I am (still) unable to switch it off, what exactly is it?

 

I think it's the "=" key on the keyboard, IIRC.

Doesn't work on my Germany keyboard. :(

Link to comment
Share on other sites

I find it hard to determine what constitutes "higher" or "lower" difficulties, since the software generates grids (and removes digits afterwards) in a very random fashion. I've read a few things on the net, and the subject of determining whether a grid is "easy" or "hard" is subject to debate. Right now, I find there's not that much of a difference between the "beginner" and "normal" skill levels in my Sudoku game.

Just checked the 5ud0ku source code. It has 3 difficulties, removing about 41, 48 and 58 digits. The difficulty differences a huge. Maybe because of the always unique solutions?

 

BTW: I always wondered why the created Sudokus look so nice. Now I found out. 5ud0ku uses 3 symmetric removal algorithms, removing 2 (swapping row and column, mirror row and column) and 4 (mirror row and/or column). Very clever.

I may look into that if I ever get back to it. Aside from adding music and sound effects to Sudoku, I'd rather get started on "Remember the Flag".

 

I think the "visual aid" feature does a fine job already, IMHO.

Since I am (still) unable to switch it off, what exactly is it?

If you put two or more of the same digits in a row, column or region, the offending digits will glow in red. Solid digits will glow in blue. Regular (removeable) digits are all shown in green when the visual aid feature is turned off.

 

I think it's the "=" key on the keyboard, IIRC.

Doesn't work on my Germany keyboard. :(

Can't help you then... :(

Link to comment
Share on other sites

Lookin' good, Luc! Way to go. Now I need to go read up on what Sudoku is so I can play it.

It's really simple. You have to put digits in each space of the grid, following these simples rules:

- No digit may appear more than once on any given row,

- No digit may appear more than once on any given column,

- No digit may appear more than once in any 3x3 region of the grid.

 

The "visual aid" option (which is turned on by default) will tell you if you're breaking any of the above rules while you're playing. Filling all the spaces of the grid without breaking any of the three rules = mission accomplished! :)

 

For an added challenge, put the timer in countdown mode (on the option screen) and set your starting time (default is 20 minutes). If the timer hits zero before you solve the Sudoku grid, you lose.

Link to comment
Share on other sites

Looks good, and, more importantly, it's a sort of game not already there for the CV. Variety is good.

 

The only thing I'd like to see is numbers with a different color than the grid. Makes it easier to see.

 

Nice going! :D

Thanks!

 

How about if I draw the solid digits in medium blue instead of dark blue? I think that would be a little better... :)

Link to comment
Share on other sites

I rather like Bruce's suggestion. And why just lighter blue? In a timed competition (where you are frantically trying to solve the board), the blue letters would strain my eyes for sure on the real CV. Why not white?

 

 

 

 

 

Looks good, and, more importantly, it's a sort of game not already there for the CV. Variety is good.

 

The only thing I'd like to see is numbers with a different color than the grid. Makes it easier to see.

 

Nice going! :D

Thanks!

 

How about if I draw the solid digits in medium blue instead of dark blue? I think that would be a little better... :)

 

Link to comment
Share on other sites

I rather like Bruce's suggestion. And why just lighter blue? In a timed competition (where you are frantically trying to solve the board), the blue letters would strain my eyes for sure on the real CV. Why not white?

From my point of view, solid digits should be the same color as the grid, to underline the fact that they are as unchanging as the grid itself. But I'm willing to try a few other colors and see if I like it. I don't think I would pick white, however, because then the visual aid feature would make solid numbers glow in white/gray/whatever, and that would just suck visually. How about cyan? :)

Link to comment
Share on other sites

Now I am really tempted to write a Sudoku generator for the 2600. :)

Dunno if by "generator" you mean creating the entire game, but I have seen a demo of a Sudoku display for the 2600. It didn't seem to be a simple matter to display all of that on a 2600. I believe I was also told of someone else working on a Sudoku(ish?) game for the 2600.

 

I'd be very tempted to buy a Sudoku game for the CV or the 2600.

Edited by BigO
Link to comment
Share on other sites

Yea, Cyan would do the trick I think.

 

 

 

I rather like Bruce's suggestion. And why just lighter blue? In a timed competition (where you are frantically trying to solve the board), the blue letters would strain my eyes for sure on the real CV. Why not white?

From my point of view, solid digits should be the same color as the grid, to underline the fact that they are as unchanging as the grid itself. But I'm willing to try a few other colors and see if I like it. I don't think I would pick white, however, because then the visual aid feature would make solid numbers glow in white/gray/whatever, and that would just suck visually. How about cyan? :)

 

Link to comment
Share on other sites

Dunno if by "generator" you mean creating the entire game, but I have seen a demo of a Sudoku display for the 2600. It didn't seem to be a simple matter to display all of that on a 2600.

Yes, there is (or was) a Sudoku written for the 2600. The display is tricky but done already.

 

My first intention is to only concentrate on the generator. Depending on the outcome of this, I might be in the mood to make an entire game out of it.

Link to comment
Share on other sites

Dunno if by "generator" you mean creating the entire game, but I have seen a demo of a Sudoku display for the 2600. It didn't seem to be a simple matter to display all of that on a 2600.

Yes, there is (or was) a Sudoku written for the 2600. The display is tricky but done already.

 

My first intention is to only concentrate on the generator. Depending on the outcome of this, I might be in the mood to make an entire game out of it.

Would you like to have the part of my C code that does the grid generation? Once you understand the logic, you could possibly replicate it on the 2600. Unless of course you'd rather go with another (and probably faster) algorithm available on the net. :)

Link to comment
Share on other sites

Would you like to have the part of my C code that does the grid generation? Once you understand the logic, you could possibly replicate it on the 2600. Unless of course you'd rather go with another (and probably faster) algorithm available on the net. :)

Thanks, but my generator has a different itention than yours. And therefore I have to work in reversed order. First find a valid grid and then remove digits.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...