Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: JWinslow23 on November 29, 2014, 09:01:27 pm

Title: Sudoku 8X+
Post by: JWinslow23 on November 29, 2014, 09:01:27 pm
Hey guys, I'm back! :D

I made a new game demo, this time of Sudoku!
(http://img.ourl.ca/SudokuJWin.gif)

Use the arrow keys to move the selection cursor. Press a number key (0-9) to enter a number in a square (0 means erase). In each empty square, pencilmarks have been added to show the possible candidates for the square. If there are no candidates, you made a wrong step in filling a square and have to try again. The program quits if all squares are filled in correctly or you press CLEAR.

There is a sample puzzle coded in, but if you want to change the puzzle, change GDB1 in the source file and recompile. The setup should be obvious for a puzzle, but please let me know if you have any questions.

Source file (ASUDOKU.8xp) and program file (SUDOKU.8xp) attached. Tell me your opinions so far.
Title: Re: Sudoku 8X+
Post by: chickendude on November 29, 2014, 11:09:26 pm
Wow, this looks really great, i love how you organized everything! It would be nice to have a pack with several puzzles in it, though. Downloading immediately :D

I also love your 2048 clone. Your games are filling up my calc ;)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on November 29, 2014, 11:45:30 pm
Wow, this looks really great, i love how you organized everything! It would be nice to have a pack with several puzzles in it, though. Downloading immediately :D

I also love your 2048 clone. Your games are filling up my calc ;)
Thank you. This layout was actually the reason I made it, because every other Sudoku clone I saw either had no pencilmarks, showed them poorly, or was on the 89.

The final game will hopefully have a random puzzle generator. I'm getting to work on that.

Also, do you just have my Axe games, or my BASIC games as well? I have more BASIC games than are on ticalc.org, but it would take a clever search to find them...
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on November 29, 2014, 11:46:51 pm
Nice to see you back :D, you should stick around more :D


I like the game layout so far, although I think screenshots could use some better WabbitEmu settings. :P
Title: Re: Sudoku 8X+
Post by: JWinslow23 on November 29, 2014, 11:51:31 pm
Nice to see you back :D, you should stick around more :D


I like the game layout so far, although I think screenshots could use some better WabbitEmu settings. :P
Noticed that as soon as I posted, but was already getting off the computer when I posted. I changed the settings, though, and the next screenshots will have gray, I promise ;)

Also, school keeps me busy, and I had no real motivation to post here (there's at least one little quick-and-dirty BASIC program on my calc I never got around to posting, and even though I figured out a fix for the win bug in TI-2048, I never updated :\ ). But now I have finally posted something, and have a motivation to come back.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on November 30, 2014, 01:39:23 am
Aah ok. I was worried you were done with Omni because you posted Vine projects and videos on Twitter every few hour each day, but no longer cross-posted them here, and at one point I thought you got fed up with Omni due to lack of Code Golf entries or something. I'm glad that isn't the case, though. :)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on November 30, 2014, 01:43:02 am
Aah ok. I was worried you were done with Omni because you posted Vine projects and videos on Twitter every few hour each day, but no longer cross-posted them here, and at one point I thought you got fed up with Omni due to lack of Code Golf entries or something. I'm glad that isn't the case, though. :)
Don't worry, I never got fed up, just busy. The contests took up more time than I thought. If you were moderator, you'd understand :P (also, lack of projects and ideas for projects :-\ )

Once I get done with manual pencilmarks, I'll post an update ASAP. ;)
Title: Re: Sudoku 8X+
Post by: Sorunome on November 30, 2014, 05:36:02 am
I love the idea on how to edit the sudoku field ^.^
Title: Re: Sudoku 8X+
Post by: chickendude on November 30, 2014, 07:10:26 am
A couple thoughts and ideas:
-it would be really cool to have an undo button. I don't think it'd be too hard to do as you'd just need an array of the last few entries (like a miniature stack).
-it would also be nice to not have the pencil marks automatically update, ie. be able to type them in yourself. Maybe holding [2nd] or [Alpha] while pressing a number could update the pencil marks? With them updating automatically it can make it a bit too easy. So perhaps an option to turn that on/off?
-maybe adding a quicker way to jump between the 3x3 squares? (eg. [ + ]/[ - ] to cycle horizontally and [ x ]/[ ÷ ] to cycle vertically)
-it also might make sense to add [Del] as an alternative to [ 0 ] for erasing a number.

All in all i think it's really great, though with the pencil marks it's a bit easy. I hope you continue to work on it, i think it's already the best Sudoku program for the 83+. Nice work yet again! Ah, and yeah, i've only got your Axe games, i didn't know you had BASIC stuff, too.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on November 30, 2014, 10:14:46 am
Aah ok. I was worried you were done with Omni because you posted Vine projects and videos on Twitter every few hour each day, but no longer cross-posted them here, and at one point I thought you got fed up with Omni due to lack of Code Golf entries or something. I'm glad that isn't the case, though. :)
Don't worry, I never got fed up, just busy. The contests took up more time than I thought. If you were moderator, you'd understand :P (also, lack of projects and ideas for projects :-\ )

Once I get done with manual pencilmarks, I'll post an update ASAP. ;)
Trust me I know. I was Omni forum moderator until 2011 and there was a 400 posts/day spike that lasted half a year :P
Title: Re: Sudoku 8X+
Post by: JWinslow23 on November 30, 2014, 05:31:01 pm
Aah ok. I was worried you were done with Omni because you posted Vine projects and videos on Twitter every few hour each day, but no longer cross-posted them here, and at one point I thought you got fed up with Omni due to lack of Code Golf entries or something. I'm glad that isn't the case, though. :)
Don't worry, I never got fed up, just busy. The contests took up more time than I thought. If you were moderator, you'd understand :P (also, lack of projects and ideas for projects :-\ )

Once I get done with manual pencilmarks, I'll post an update ASAP. ;)
Trust me I know. I was Omni forum moderator until 2011 and there was a 400 posts/day spike that lasted half a year :P
Well, then, I respect you. XD

I love the idea on how to edit the sudoku field ^.^
Thanks! Credit to Xeda Elnara for the keycode-to-number routine!

A couple thoughts and ideas:
-it would be really cool to have an undo button. I don't think it'd be too hard to do as you'd just need an array of the last few entries (like a miniature stack).
-it would also be nice to not have the pencil marks automatically update, ie. be able to type them in yourself. Maybe holding [2nd] or [Alpha] while pressing a number could update the pencil marks? With them updating automatically it can make it a bit too easy. So perhaps an option to turn that on/off?
-maybe adding a quicker way to jump between the 3x3 squares? (eg. [ + ]/[ - ] to cycle horizontally and [ x ]/[ ÷ ] to cycle vertically)
-it also might make sense to add [Del] as an alternative to [ 0 ] for erasing a number.

All in all i think it's really great, though with the pencil marks it's a bit easy. I hope you continue to work on it, i think it's already the best Sudoku program for the 83+. Nice work yet again! Ah, and yeah, i've only got your Axe games, i didn't know you had BASIC stuff, too.
No undo button, but I did do manual pencilmarks. I will update shortly. I might take your advice on the +, -, *, and / buttons, and I will DEFINITELY make Del another erase key.

Update shortly!
Title: Re: Sudoku 8X+
Post by: JWinslow23 on November 30, 2014, 06:17:05 pm
Bump.

Update! Now added manual pencilmarking. Press ALPHA to toggle between pencil and pen mode (pen mode by default; in pencil mode, the grey cursor changes). Press a number on an empty square in pencil mode to add or remove the pencilmark for that number. You can move between squares in this mode.

Also, Del now erases squares in pen mode.

Screenie:
(http://img.ourl.ca/SudokuPencilmarks.gif)

Source (ASUDOKUX.8xp) and program file (SUDOKU.8xp) attached. Please, give feedback!
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 01, 2014, 06:09:14 pm
Bump.

Project update! Now added random puzzle generator that automatically creates a random puzzle upon startup. Occasionally, the puzzles may have more than one solution, and once I figure out a way to generate puzzles that does not have this flaw, I will update once again.

As usual, screenie:
(http://img.ourl.ca/SudokuPuzzleGen.gif)

Source (ASUDOKUX.8xp) and program file (SUDOKU.8xp) attached. As usual, put in your opinion about the program.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on December 01, 2014, 09:01:06 pm
Good job on those additions. :D
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 01, 2014, 09:14:10 pm
Good job on those additions. :D
Thanks. I'm working hard to make a Sudoku puzzle generator that doesn't give puzzles with more than one solution.

In other news, my project has been featured as one of Cemetech's November POTMs! (http://www.cemetech.net/forum/viewtopic.php?t=10946)
Title: Re: Sudoku 8X+
Post by: JamesV on December 02, 2014, 04:02:06 am
This looks awesome!
Title: Re: Sudoku 8X+
Post by: chickendude on December 02, 2014, 04:52:54 am
It doesn't just look awesome, it is ;) Nice work, and thanks for adding that stuff in so quickly! Updating my calc now...
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on December 02, 2014, 09:52:07 am
Good job on those additions. :D
Thanks. I'm working hard to make a Sudoku puzzle generator that doesn't give puzzles with more than one solution.

In other news, my project has been featured as one of Cemetech's December POTMs! (http://www.cemetech.net/forum/viewtopic.php?t=10946)
Also I like how it looks so far. WHen you first started it I was a bit worried it would be just another clone of the 2000 Sudoku games on ticalc.org that had no graphic except the Line() command. I'm glad it turned out to be closer to your other games in style, like Flappy Bird, 2048 and Swing Copter. :)


Also congrats!
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 02, 2014, 10:15:00 am
Good job on those additions. :D
Thanks. I'm working hard to make a Sudoku puzzle generator that doesn't give puzzles with more than one solution.

In other news, my project has been featured as one of Cemetech's December POTMs! (http://www.cemetech.net/forum/viewtopic.php?t=10946)
Also I like how it looks so far. WHen you first started it I was a bit worried it would be just another clone of the 2000 Sudoku games on ticalc.org that had no graphic except the Line() command. I'm glad it turned out to be closer to your other games in style, like Flappy Bird, 2048 and Swing Copter. :)


Also congrats!
Thanks! And I wouldn't do something done by millions of other people before if it didn't at least look different.
Title: Re: Sudoku 8X+
Post by: JamesV on December 02, 2014, 07:09:41 pm
When I played it, I noticed that pressing 0 or DEL to erase a number would cause some gfx glitch on the main (left) board - or is this just me? I was using WabbitEmu running a TI-83+BE ROM :)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 02, 2014, 11:02:51 pm
When I played it, I noticed that pressing 0 or DEL to erase a number would cause some gfx glitch on the main (left) board - or is this just me? I was using WabbitEmu running a TI-83+BE ROM :)
It shouldn't have any problems on the TI-83+...it works fine on the TI-84+ I use for testing. What's supposed to happen is that the square gets erased on the left. What happens with you?
Title: Re: Sudoku 8X+
Post by: JamesV on December 03, 2014, 12:08:21 am
It shouldn't have any problems on the TI-83+...it works fine on the TI-84+ I use for testing. What's supposed to happen is that the square gets erased on the left. What happens with you?
I took a screenshot to demonstrate. You'll see I enter the number 1, then I press 0 to clear it and get some garbage showing in the main board. It's possible that this might be some curious WabbitEmu thing - I'll try it on my TI-83+BE, TI-83+SE & TI-84+BE calcs later when I'm home :)
(http://imageshack.com/a/img673/4491/OfHMol.gif)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 03, 2014, 08:56:01 am
It shouldn't have any problems on the TI-83+...it works fine on the TI-84+ I use for testing. What's supposed to happen is that the square gets erased on the left. What happens with you?
I took a screenshot to demonstrate. You'll see I enter the number 1, then I press 0 to clear it and get some garbage showing in the main board. It's possible that this might be some curious WabbitEmu thing - I'll try it on my TI-83+BE, TI-83+SE & TI-84+BE calcs later when I'm home :)
(http://imageshack.com/a/img673/4491/OfHMol.gif)
Not sure why that should happen...to write the numbers there, I write the (n+1)th character in the string "(three spaces character)123456789"...and if that problem happens when you erase with 0 or Del, then it should happen with drawing the board in the first place...I'll test it on my TI-83+ later today.
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 03, 2014, 07:35:37 pm
Bump.

Update! Now there are random puzzles with selectable difficulty...and they are all guaranteed to be solvable! You can specify the difficulty with a number in Ans; 5 for Beginners, 4 for Easy, 3 for Newspaper Level, 2 for Hard, and 1 for ARE YOU INSANE?!?!?

As usual, a screenie for your viewing pleasure:
(http://img.ourl.ca/SudokuRandomPuzzles.gif)

Source (ASUDOKUX.8xp) and program file (SUDOKU.8xp) attached. Please tell me what you think!
Title: Re: Sudoku 8X+
Post by: Deep Toaster on December 04, 2014, 01:24:17 pm
Nice! Is there an algorithm you're using to generate random puzzles? If so I'd be interested in seeing it :)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 04, 2014, 01:50:46 pm
Nice! Is there an algorithm you're using to generate random puzzles? If so I'd be interested in seeing it :)
What I do is take a random puzzle from a selection of a few puzzles and permute them randomly in such a way that they're still solvable.
Title: Re: Sudoku 8X+
Post by: Sorunome on December 04, 2014, 03:03:14 pm
Ui, that's nice! And yay some randomness :P
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 04, 2014, 06:13:18 pm
Ui, that's nice! And yay some randomness :P
Well, the puzzles I use as bases were also generated randomly. :P Seriously, you have no idea how long I worked on making the generator in its current state...
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 04, 2014, 08:38:56 pm
Bump.

SUPER ULTRA AMAZING MEGA-UPDATE! Now in a releasable form, this comes with a menu, selectable difficulty, a very fun winning message (solve a sudoku puzzle to see it ;) ), and EVERYTHING else I had before! XD

Screenie:
(http://img.ourl.ca/SudokuMenu.gif)

Source (ASUDOKUX.8xp) and program file (SUDOKU.8xp) attached. Please give feedback!

I am going to upload this to every archive I know. ;)
Title: Re: Sudoku 8X+
Post by: JamesV on December 04, 2014, 09:29:58 pm
Awesome! This still gives me the glitchy thing when pressing 0 or DEL, although I admit I forgot to test it on real hardware yet sorry :( Did it happen for you JWinslow?
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 04, 2014, 09:51:19 pm
Awesome! This still gives me the glitchy thing when pressing 0 or DEL, although I admit I forgot to test it on real hardware yet sorry :( Did it happen for you JWinslow?
No, it works just fine on my TI-83+ OS 1.19. I wonder what the problem was...

EDIT: I uploaded Sudoku to the Cemtech archives! (http://www.cemetech.net/programs/index.php?mode=file&id=1205)
Title: Re: Sudoku 8X+
Post by: chickendude on December 05, 2014, 11:34:01 am
Ok, this is going on my calc right now, gonna play some Sudoku before going to bed. Seriously, all the new additions the past few days are just amazing, really nice work! The only thing that is a bit weird is the cursor in the menu, why is it pointing away from the choices? It looks like it should be the other way around.

And for the record, [ 0 ] / [Del] work fine on my OS 1.19 83+ as well.

EDIT: Maybe pressing [2nd] or [Enter] (or any key) should take you back to the main menu instead of only [Clear] when you win. I was also trying to think of a way to have pencil marks show up on the full board, and maybe it's a bit overkill but what about having a 3x3 grid where each dot is a #? For example: (X = on/black pixel, 0 = off/white pixel)
X0X
000
0X0
..would show that 1, 3, and 8 have been marked.

Anyway, i was never that great at Sudoku, maybe now i'll get a little better :P
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 05, 2014, 11:14:52 pm
Ok, this is going on my calc right now, gonna play some Sudoku before going to bed. Seriously, all the new additions the past few days are just amazing, really nice work! The only thing that is a bit weird is the cursor in the menu, why is it pointing away from the choices? It looks like it should be the other way around.

And for the record, [ 0 ] / [Del] work fine on my OS 1.19 83+ as well.

EDIT: Maybe pressing [2nd] or [Enter] (or any key) should take you back to the main menu instead of only [Clear] when you win. I was also trying to think of a way to have pencil marks show up on the full board, and maybe it's a bit overkill but what about having a 3x3 grid where each dot is a #? For example: (X = on/black pixel, 0 = off/white pixel)
X0X
000
0X0
..would show that 1, 3, and 8 have been marked.

Anyway, i was never that great at Sudoku, maybe now i'll get a little better :P
Well, it was supposed to be that a left arrow was on the left, and a right arrow was on the right. That's how I coded it, and I honestly don't know what the problem is. But I will make it so that there is one arrow, it faces right, and ENTER takes you back to the main menu.

And the entire point of the pencilmarks in the subgrid is because I couldn't find a way to do it in the small grid. What you're suggesting IS a bit overkill, you're right.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on December 08, 2014, 02:16:13 am
I finally downloaded this so I'll get it on my calc to play when I have some extra time :)

(Not that I'm good at Sudoku, though x.x)
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 15, 2014, 10:58:35 am
I finally downloaded this so I'll get it on my calc to play when I have some extra time :)

(Not that I'm good at Sudoku, though x.x)
Heh. XD

Alright, I have put off updating this for way too long. I hadn't made a whole bunch of changes, either; just a minor menu change and control change (ENTER now puts you back to the menu). This is pretty much complete now...I'll post an update as soon as I have the time.
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 15, 2014, 07:25:08 pm
Bump.

This very well could be my last update. This comes with minor menu and control changes. ENTER now returns to the main menu.

Screenie:
(https://img.ourl.ca/SudokuFinal.gif)

Source and program file attached.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on December 16, 2014, 09:44:47 pm
Awesome. Will this be the ticalc version? :D
Title: Re: Sudoku 8X+
Post by: JWinslow23 on December 16, 2014, 09:51:06 pm
Awesome. Will this be the ticalc version? :D
Yes. Wow, I completely forgot to update :\ Thanks for reminding me to update the archives.
Title: Re: Sudoku 8X+
Post by: DJ Omnimaga on December 17, 2014, 09:35:11 am
No problem :)