Jump to content
IGNORED

Sudoku 800 Version.


idavis

Recommended Posts

The title speaks for itself. I have spent the last few months teaching myself 6502 assembler, and now I have a working game. I have been holding back on announcing anything till I had at least a simple working version. I noticed that SeaGtGruff has been working on a 2600 version, so I am opening a new thread for my 800 version.

 

Background: I got my 800 back in '82. It's been the inspiration for my career. The only thing I have regretted all these years is not learning assembler. I wrote a lot in Basic, and moved up to higher level languages. Long story short, I have been dragging all my Atari hardware and software around for years. Our oldest son went off to the Army, and his bedroom is now my office. So I pulled the Atari out of the closet, dusted it off, and pulled out my copy of Synassembler intent on fulfilling a lifelong dream. I was intent on learning assember, and programming a game for my beloved Atari. I have things like a eprom burner, and a blank eprom cart, so I have been slowly working on this for years. God only knows why I decided to make a Sudoku game as my intro to assembler.. I should have picked something easy like a Global Thermonuclear War Simulator.

 

Now to the code. As of yesterday, I have a working game. If I still have your attention, I want to know if there's any interest in a 400/800 version of Sudoku. It's probably not the flashiest, or the most exciting, but it's sudoku, and it's now working. I have a few things left to code, like a splash screen where you can select a level of difficulty, and I am sure a lot of polishing on things like sound, and the routine when you complete a puzzle. My 12 y.o. thought it was fine, but I think he's just being nice. My neighbor wants fireworks to go off. I am at 6k and can probably trim it back to about 5k. I have the routine to gen up a new random puzzle, but it can take anywhere from 5 seconds to a few minutes to actually gen up a 'legal' puzzle, so I need to come up with a distraction while the puzzle if generating. Another idea would be to use the spare time to have it generating a new puzzle in the background. That will take some modifying code to save state. Not hard, just something I was saving for last.

 

So is anyone interested in a real cartridge eventually? I am sure that I will just release this as an ATR, or a MaxFlash image eventually, but I want to test the waters. If nothing else, I want at least one cart for myself. I realize the homebrew situation, and didn't do this to make any money. Just to prove I was crazy enough to pull it off.

Isaac

 

Note: I will be around next week, but am leaving at the end of the week to go watch our oldest graduate Basic Training. I was torn between mentioning the game and then going on vacation, or waiting till I got back. Looks like I couldn't hold it in. I can't forget, I need to thank my son for the office. :cool:

Edited by idavis
Link to comment
Share on other sites

Oh. I was hoping this forum here was considered very open to any kind of platform? Of course, the majority of talk here is 2600 centric, yet I think all others are very welcome as well, no need to hide in a private club :)

I also thought this was a non-2600-specific forum. However, I think that Heaven/TQA's implication is a good one-- namely, that idavis might want to drop a note in the 8-bit forum(s) to let them know about this thread, in case they would have missed it otherwise.

 

And idavis, I do think you should put out a cart. I don't have a working XE system right now, but one of these days I hope to get my XEs repaired and get some more disk drives for them.

 

Also-- open question to anyone who knows-- how difficult is, or what's involved in, porting an 800 game to the 5200? Let's assume there are no special considerations, such as a 128K machine, just a plain manilla game. I'm just wondering if it would be possible for idavis' Sudoku 800 game to be ported to a Sudoku 5200 game?

 

MR

Link to comment
Share on other sites

some of the assemblers out there can output code directly for 5200 like xasm... and if you are consider the memory map of the 5200 i dont see any problem why a game should not work on both machines when considered by design and at the beginning... (16kram etc f.e.)

 

re: private club

 

yup... it is... 2600 you get tons of feedback here in the homebrew while you get more feedback for your 5200 projects or 800 projects in the desired ones... even the programming forums are less visited than the special ones... i have to admit... that's why all of my projects are discussed in the 8bit forums same as most of the others do as well...

Link to comment
Share on other sites

RMT music thread:

http://www.atariage.com/forums/index.php?s...8283&st=500

 

New Video Card + Demo:

http://www.atariage.com/forums/index.php?showtopic=84499

 

Alternate Reality for Maxcart:

http://www.atariage.com/forums/index.php?showtopic=92921

 

Tower Toppler:

http://www.atariage.com/forums/index.php?showtopic=94888

 

Yie ar kung fu A8 port:

http://www.atariage.com/forums/index.php?showtopic=62410

 

Sudoku Sweep for A8:

http://www.atariage.com/forums/index.php?showtopic=94617

 

Voyage to home Game for A8:

http://www.atariage.com/forums/index.php?showtopic=96019

 

Crownland brilliant new Jump 'n Run for A8:

http://www.atariage.com/forums/index.php?s...5280&st=375

 

Scorpions new Game for A8:

http://www.atariage.com/forums/index.php?showtopic=84307

 

New Space Invaders Game for A8:

http://www.atariage.com/forums/index.php?s...88980&st=75

 

Flower Mania Game for A8:

http://www.atariage.com/forums/index.php?s...5&hl=flower

 

Asteroids New Port for A8:

http://www.atariage.com/forums/index.php?showtopic=87312

 

my diablo clone:

http://www.atariage.com/forums/index.php?s...8809&st=650

 

Adventure 2 for 5200:

http://www.atariage.com/forums/index.php?showtopic=95676

 

QBert for 7800:

http://www.atariage.com/forums/index.php?showtopic=67326

 

Frogger for 7800:

http://www.atariage.com/forums/index.php?showtopic=69060

 

 

and there are many more which i am missing now... f.e. International Karate Plus Port for A8...

check out all new games f.e. here:

http://www.atari.online.pl/v01/index.phtml...&ct=nowinki

 

 

Now tell me...which of these games is discussed in the Homebrew forums? none... as feedback there

is nearly 0%...

Link to comment
Share on other sites

Now tell me...which of these games is discussed in the Homebrew forums? none... as feedback there

is nearly 0%...

Just to be fair, this could be viewed as a "chicken or egg" quandry. There's no one standing guard at the door to the Homebrew forum, keeping out everyone who wants to discuss development of games for non-2600 platforms. If someone posts about a 5200, 7800, or 800 game here (or for that matter, a Colecovision game, or C64 game, or Apple II game, etc.), and gets little feedback, it's because the people who are interested in those platforms are avoiding this forum on their own-- perhaps because they aren't seeing much being posted here about games for their preferred platforms? So what you end up with is a vicious cycle, not a private club (which implies someone standing guard at the door, which isn't the case).

 

The way to kill the vicious cycle is for non-2600 programmers to post updates about their WIPs in here, and make sure that everyone who's interested in that particular platform is aware that their WIP is being discussed here-- and resist any urges or attempts to move the discussion to another forum. It may take a while, but as more and more non-2600 programmers begin using this forum to discuss their projects, the percentage of non-2600 readers in this forum should increase, and there should be more feedback.

 

So, come on... be a rebel! :)

 

MR

Link to comment
Share on other sites

You said that you're storing a complete puzzle in 48 bytes. What format are you using? Is it BCD, or something else? And does it include the flags or whatnot to indicate which squares are the givens?

 

Also, did you come up with your own routine for generating a random puzzle, or did you read about different algorithms first?

 

MR

Link to comment
Share on other sites

You said that you're storing a complete puzzle in 48 bytes. What format are you using? Is it BCD, or something else? And does it include the flags or whatnot to indicate which squares are the givens?

 

Also, did you come up with your own routine for generating a random puzzle, or did you read about different algorithms first?

 

MR

 

 

First, thanks for the replies all. I will just keep the thread here. I don't want to splinter off the discussion. This could turn into a 5200 port I am sure, since the 800/5200 are basically the same. I will have to research and since I don't own a 5200 per se, might need some help testing on something other than an emulator.

 

To answer the 48 byte question, I came up with my own algorithm to store and generate a puzzle (9x9). I have been working on this for months, and spent the majority of it on just building a puzzle. The actual game code came after I got that down. I am going to write up some documentation, and publish it on my little scheme. It's just a formula I came up with after nights and nights of staring at the puzzles and trying to figure out how to get this to work in assembler. It's really simple when you see it, and it I actually had to explain it to myself a few times to make sure I was right, but it's working. Actually the code to generate a puzzle is probably under 2k when you scratch off the extraneous bits I needed to turn this into a game.

 

Since it takes a random amount of time, and possibly up to a few minutes depending on the luck of the draw to build a puzzle, I used my scheme to store about 15 built puzzles in the code. I then wrote a routine to shuffle the rows and columns, staying in the blocks of 3. As long as you shuffle row or column 1,2,3 or 4,5,6 or 7,8,9 you still have a valid puzzle. Mix 3 and 4, or 6 and 7, and you blow the puzzle. So when the program comes up, it picks one of the 15 generated puzzles, and then shuffles it. I don't have any code yet for a splash screen, and to pick a difficulty level, but that's coming.

 

What's the best way to post? An exe file directly, or maybe an ATR image with the program as autorun.sys?

Isaac

Link to comment
Share on other sites

Since it takes a random amount of time, and possibly up to a few minutes depending on the luck of the draw to build a puzzle, I used my scheme to store about 15 built puzzles in the code. I then wrote a routine to shuffle the rows and columns, staying in the blocks of 3. As long as you shuffle row or column 1,2,3 or 4,5,6 or 7,8,9 you still have a valid puzzle. Mix 3 and 4, or 6 and 7, and you blow the puzzle. So when the program comes up, it picks one of the 15 generated puzzles, and then shuffles it.

I had thought about using that sort of approach, too. By the way, another thing you can do is replace the digits with other digits-- i.e., after you randomly pick one of your 15 pre-generated puzzles, and shuffle the rows and columns as you described, you can also shuffle the digits and change them in the puzzle, such as in the following scheme:

 

1 --> change to 2

2 --> change to 5

3 --> change to 1

4 --> change to 8

5 --> change to 3

6 --> change to 7

7 --> change to 9

8 --> change to 4

9 --> change to 6

 

Obviously, you'd need to keep the original puzzle in memory while changing the digits, since you wouldn't want to change the 1s to 2s, and then change the new 2s to 5s, etc.

 

And you can also shuffle the rows and columns in groups of three (or the 3x3 zones), as follows:

 

A B C --> A C B --> D F E --> F D E --> etc.

D E F --> D F E --> G I H --> I G H --> etc.

G H I --> G I H --> A C B --> C A B --> etc.

 

In other words, you're shuffling the 3x3 zones as if they're rows and columns, so to speak.

 

Finally, you can flip or rotate the puzzle, like changing it to a mirror image of itself, or rotating it 90 degrees to the right, 90 degrees to the left, or 180 degrees upside-down.

 

By combining several or all of these approaches, you should be able to get a large number of possibilities even from just a single pre-generated puzzle.

 

What's the best way to post? An exe file directly, or maybe an ATR image with the program as autorun.sys?

Isaac

An ATR image might work best for emulators?

 

MR

Link to comment
Share on other sites

Ok. Here's what I will call version .01. It's an .atr file with the exe set to autorun.sys.

 

Rules:

 

Typical Sudoku rules apply. 1-9 in each column, row, and square. No duplicates.

 

You start out with 4000 points, and acquire 10 points for each square filled in (right or wrong). The game automatically checks to see if you have correctly completed the puzzle. When you have every square correct, the bonus (if any is left) will add to your score, and the sreen will blink for a couple of seconds. I didn't want it blinking too long for fear of putting someone into a trance. Once you have finished a puzzle, you can hit Start again to begin a new game. Don't hold it too long for now as if you do, you will use up a hint or two on the new game before you have even gotten started. I was going to code that to slow down, but the splash page will fix it when I get that coded and drawn up.

 

Controls: Basic Joystick. Up, down, left and right. Holding the button will allow you to change a value by pushing the stick up or down on a square

 

Hints are programmed a little different than you might think at first. When you hit the start button two things happen. First, you lose 500 points for the hint. Second, all of your entries are checked. The correct ones are left, and the incorrect entries are blanked back out, and you lose 20 points for each one. You are only allowed to get a hint 4 times, and then you are on your own. Hints will not however give you a clue as to what a square might contain other than telling you if you guessed it wrong or right.

 

Notes: Sounds, colors, and look and feel are all preliminary. I am using a custom Char set and a full screen Graphics mode 2 (12x20) screen. I didn't touch the 1-9 chars though I have thought about redrawing them to make it more custom looking. I also am wanting to a make a splash screen and take my name off the main game screen, just leaving the Score, Bonus, Hints, and Sudoku on the left hand side. The plan for a splash screen will be to put up the title, credits, and allow you to pick a difficulty. Right now, I have it set to randomly blank 40 spaces for you to fill in. I am thinking this will be the medium setting, with 30 blanks being easy, and 50 being difficult. I am also considering rewriting the blanking code, although for now, it does seem to come up with some really interesting conbinations some times.

 

All comments will be taken seriously, I just don't know how much time I will have to do things like "add fireworks at the end" as my neighbor has requested. I want to keep this around 8k, and am currently sitting at around 6k, and that is including the screen ram (240 bytes). I also have left the code to generate a random puzzle in as well, just no way to activate it as of yet, since it will need something to let you know it's "working" on the new puzzle. As for a 5200 version, I will need to read up on converting to 5200. I am sure that since I have all of the source code, and Synassembler allows you compile straight to a file, I will just need to remap the compile location, and recompile. I might have to check things like joystick codes and/or locations. I have also thought of making a two player version with a cooperative mode or heads up mode available.

sudoku.zip

Link to comment
Share on other sites

Ok. Here's what I will call version .01. It's an .atr file with the exe set to autorun.sys.

This is good! :) I'm attaching a screenshot so people can see what it looks like. I vote that you keep the digits as is, because they're nice and clear, easy to see-- but then, if you were to change them, who knows, I might like the new look better! :)

 

MR

 

post-7456-1163478412_thumb.jpg

Link to comment
Share on other sites

Thanks. I am not that artistically inclined, so you are right, I might make them worse. I was thinking about an options page where you could select certain things like colors and maybe char sets. For now, my main concern was making something that was visually non-offensive, since you could be staring at a screen for quite some time. Flashy colors might get harsh after some time. I also wanted it to be easy enough to distinguish between numbers you have entered and ones that are given without making the difference too visually distracting.

 

My neighbor is a musician, so maybe I can get a quick tune out of him for the winning sequence and splash page. I don't think I want to have it play in the background while you are playing, as anything looping could get on your nerves as fast as a set of awful colors.

 

I also forgot completely. I misspoke on the bytes requires to store a puzzle. I have it at 24. You have to split out the top and bottom halves of the byte, but I am using the scheme in my prog and it's working fine. If you don't pack the two halves together you need 48 bytes. I will work on a doc to explain it all and post something up here. It more like storing a map of where to place the numbers, then storing the actual numbers.

Isaac

Link to comment
Share on other sites

Obviously, you'd need to keep the original puzzle in memory while changing the digits, since you wouldn't want to change the 1s to 2s, and then change the new 2s to 5s, etc.

 

One approach which may be useful for minimizing the amount of code, at some expense in puzzle-generating time, would be to come up with a small "basis set" of operations which, when done in the right combinations, will suffice to produce all the puzzles of interest. A basis set for the transforms described thus far would be:

  • Swap all 1's and 2's
  • Increase all numbers by one, replacing 9's with 1's
  • Shift everything right by three columns
  • Swap the first three and last three colums
  • Rotate the first three columns rightward among themselves (wrap 3->1)
  • Swap the first two columns
  • Flip the board about the primary diagonal (rows become columns)

If it weren't for the '3x3 box' restriction, it would be possible to convolve a Sudoku board, opening up some more possibilities, but I don't know any way to make a convolution work (or indeed any transformation to change the real behavior of the 3x3 boxes). I would think that if you can't change the behavior of the 3x3 boxes, you'll need more than 15 puzzles in your starting set.

Link to comment
Share on other sites

I can't believe only 1 person has downloaded this! (That would be me.) This is fun to play; it isn't too hard, but it isn't so easy that it's a piece of cake, and the scoring gives you an incentive to play again and again in hopes of getting a higher score. Good job, Isaac!

 

One suggestion, though... Could you make the digits brighter when the cursor is moved to a given, because the brown(?) or dark red(?) color is kind of hard to see against the blue background.

 

Michael Rideout

 

PS: To anyone who doesn't have an 800 (or who-- like me-- has one that isn't in working condition), just download an 800 emulator so you can play this! All you have to do is load (attach) the ATR, and the game starts up automatically. And the nice thing about playing this on an emulator is the ability to save the state, so you can save the game in the middle of a puzzle and go back to it later on.

Link to comment
Share on other sites

I can't believe only 1 person has downloaded this! (That would be me.) This is fun to play; it isn't too hard, but it isn't so easy that it's a piece of cake, and the scoring gives you an incentive to play again and again in hopes of getting a higher score. Good job, Isaac!

 

One suggestion, though... Could you make the digits brighter when the cursor is moved to a given, because the brown(?) or dark red(?) color is kind of hard to see against the blue background.

 

Michael Rideout

 

PS: To anyone who doesn't have an 800 (or who-- like me-- has one that isn't in working condition), just download an 800 emulator so you can play this! All you have to do is load (attach) the ATR, and the game starts up automatically. And the nice thing about playing this on an emulator is the ability to save the state, so you can save the game in the middle of a puzzle and go back to it later on.

 

Michael,

Sure thing. I can fix the cursor color no problem. It's a value I set up in my init code. Any suggestions? How about a gold or yellow? I am attaching a new version with the cursor in gold. I am sure that I will be working on sound as well as fixing up the winning routine as it's begging for something more flashy.

 

I also have written up a basic document on how to generate a puzzle. It's quite long, and needs to be viewed on a fixed length font for the basic ascii art to work. I think I will save it as a document and attach it since posting it might be a little long in the tooth for those who don't want to read it.

Thanks,

Isaac

sudoku.zip

BuildingASudokuPuzzlebyIsaacDavis.txt

Link to comment
Share on other sites

Michael,

Sure thing. I can fix the cursor color no problem. It's a value I set up in my init code. Any suggestions? How about a gold or yellow? I am attaching a new version with the cursor in gold.

That's better, but I was thinking you could keep the same hue, just make it brighter. Was it dark red originally? A bright red (not pink, though) should stand out okay, and the red color could serve as a kind of "warning" that you can't change the digit under the cursor because it's a given. :)

 

Also, thanks for the notes! I'll review them tomorrow evening.

 

Michael

Link to comment
Share on other sites

re: download...

 

again...wrong forum... ;)

Again... because people who use the 800 are staying away on their own... because they apparently have decided amongst themselves that this is, as you say, the "wrong forum." Is it because of the term "homebrew"? Is that term somehow "offensive" to 800 programmers? :ponder:

 

MR

Link to comment
Share on other sites

Again... because people who use the 800 are staying away on their own... because they apparently have decided amongst themselves that this is, as you say, the "wrong forum." Is it because of the term "homebrew"? Is that term somehow "offensive" to 800 programmers? :ponder:

 

No, it's not that it is offensive just not representative of the 8-bit computer section (and perhaps even the ST people). I lurk around the A8 forum and I don't remember the last time I saw the term "homebrew" in there regarding new releases. Same for the Commodore world too. I've never seen new releases (games etc.) for the C64, Plus/4, and VIC-20 reffered to as "homebrew".

 

However, I have seen the word "homebrew" used a lot in reference to new games for console[1] systems for the Atari (like the 2600, 5200, Lynx etc.) and other non-Atari consoles.

 

I think it's the association of the word "homebrew" with console systems that people who are only interested in the A8 releases kind of skip over this particular forum. Especially if they're not interested in reading about new releases for, say, the 2600.

 

It's not because they've collectively decided to shun the rest of the forum or find it offensive. :roll:

 

Garak

 

[1] No, this isn't the time to start a "consoles are computes" debate either.

Edited by Garak
Link to comment
Share on other sites

garak, thats an interesting point...

 

maybe because on consoles there were only 1st, 2nd and thirdparty developers but not private people...but now actually you can code on that at "home" and do your "brew" doesnt matter of 8bit,16bit or 64bit console... (--> xbox 360 homebrew actions by microsoft). in the past it was nearly impossible for the broad public.

 

on homecomputers everything was "homebrew"... ;) even a 10 print "hello world" 20 goto 10...

 

when i started to post my stuff here i started shortly in the homebrew forum but realised that the effect is disappointing. so i switchted back to the 8bit forum where the audience is for my work... so i learned that like many others as well... post there were the core audience is... even double posts had no effect...

 

so i let the "kernel"-geeks do their stuff but read the colecovision and the 2600 programming forum as the 6502 tricks by the 2600 cracks are usefull... but i do not test or download the 2600 stuff... simply because its not my world...

Link to comment
Share on other sites

just to go back to the sudoku stuff... look how many visits and posts the 2600 sudoku gets compared to this...

 

maybe i invest several months to do a

 

10 value=random(255)

20 input "Make a guess";choice

30 if choice=value then print "You win!":end

40 print "wrong":goto20

 

put it on card, make a 256 colour raster bar and put it on a huge 16k-2600 cart and sell it for some money..."for collectors"... btw... why not... ;)

Link to comment
Share on other sites

Wow, man. I read your posts and you come across as a very frustrated person. I'm really sorry that it bothers you so bad that some people enjoy the classic game developments for dedicated console systems more than old, 8-bit home color computers. I started out doing 6502 coding for C<64 and Apple ][ computers. I enjoyed it but in no way does it compare to coding for classic consoles. It's just what I prefer...and it sure seems others do as well.

 

It is what it is...

 

 

just to go back to the sudoku stuff... look how many visits and posts the 2600 sudoku gets compared to this...

 

maybe i invest several months to do a

 

10 value=random(255)

20 input "Make a guess";choice

30 if choice=value then print "You win!":end

40 print "wrong":goto20

 

put it on card, make a 256 colour raster bar and put it on a huge 16k-2600 cart and sell it for some money..."for collectors"... btw... why not... ;)

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...