Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: ztrumpet on October 03, 2010, 06:14:59 pm
-
Here's the progress on a Sudoku program that I'm working on. It's about 10% complete. I need to know three things:
a) Who would want this? I want to make it, so regardless, it's getting made. :P
b) Does anyone know where there's about 50 Sudoku puzzles that I could copy and put in the game?
c) What should the Menu have in it? I have a couple of ideas, but I want to know what you guys think. :)
Thanks! ;D
-
I love sudoku!
Here's the progress on a Sudoku program that I'm working on. It's about 10% complete. I need to know three things:
a) Who would want this? I want to make it, so regardless, it's getting made. :P
b) Does anyone know where there's about 50 Sudoku puzzles that I could copy and put in the game?
c) What should the Menu have in it? I have a couple of ideas, but I want to know what you guys think. :)
Thanks! ;D
a) ME!
b) No, sorry.
c) Let's see... Undo, Mark, Quit, Save, Load, Custom, Solution (if you can).
-
a) meeeeee. sudoku's awesome.
b) here (http://www.websudoku.com/?select=1&level=1)
c) i have nothing :(
-
"Billions of Free Sudoku Puzzles" ... wow, sudoku's obviously got a lot of combos!
Not as many as the Rubik's Cube, of course ;)
-
yeah. and if you click the link to the "deluxe edition" or whatever they have 4x4, 6x6, 12x12, 16x16, and a couple variations of sudoku. but you have to download it.. and even then you only have a 60 minute trial until you have to pay money. i remember when i just started basic programming i wanted to make sudoku but didn't know how.
-
Looks really cool!
1. I want it ;D
2. I'm just gonna go with what nemo gave :P
3. Hmmm...save, load, restart, and new.
-
Wow, awesome! Back then, I tried to make a sudoku solver but eventually I quit because I lacked the programming skills needed for such a task. :P Maybe I should start it again someday...
1. MEEEEEEE!!!
2. See nemo's suggestion above :P
3. New, Save, Load, Restart, Quit
-
Looks nice. Unfortunately I'm not a fan of Sudoku, though, so I'm probably gonna pass on this one :(
Hopefully a lot of people will enjoy it :).
-
nice!
1. I like puzzling, but i prefer programming :P
2. here is a generator (http://www.opensky.ca/~jdhildeb/software/sudokugen/)
3. New, Save, Load, How am I doing (HAID), Restart, Quit
-
How many sudoku are going to be preloaded? Do you think an on calc generator is possible? Are you going to scramble the preloaded so that it is even more random?
:D
-
How many sudoku are going to be preloaded?
They will be 81 bytes each and I'm estimating 50 levels.
Do you think an on calc generator is possible?
I think it's possible, but I am unsure on size or speed. I doubt if I'll include one in this program, though.
Are you going to scramble the preloaded so that it is even more random?
No.
:D
:D
-
Gotcha, why no scrambler?
-
I don't know how one would work. If you have some pseudo-code, then it's a possibility. :)
-
okay, with some rowswapping and that little t thing we can do this in no time :D
012345678
0 000111222
1 000111222
2 000111222
3 333444555
4 333444555
5 333444555
6 666777888
7 666777888
8 666777888
Alright so here is our sudoku board. Can you see that if we swap column 012 with 345 we dont change the solvability of the puzzle? In addition, we can swap and group of 3 columns (012, 345 or 678) with any of the others and still maintain solvability. In adition, we can swap column 0 with column 1, 1 with 2, or 0 with 2. In any group of 3 (012,345, or 678) we can swap any of the single columns without making the puzzle any more difficult of unsolvable. We can then use the fancy t thing, flip the matrix, and do the same thing with all the rows. And as a final note, you can rotate a sudoku as much as you want and it doesn't do anything :D. So all we need is swapping rows and flipping! Both have fast and built in routines to do that for us :)
So it would look something like this:
For(G,0,1)
For(F,1,5)
Rand(0,2)*3->I
Rand(0,2)*3->J //that *isnt* I
Swap(I,J)
Swap(I+1,J+1)
Swap(I+2,J+3)
End
For(R,0,2)
For(G,1,5)
Rand(0,2)->I
Rand(0,2)->J //that *isnt* I
Swap(R*3+I,R*3+J)
End
End
FlipMatrix
End
For(F,0,Rand(0,3)
FlipMatrix
End
Should all work but its all theoretical! XD
-
OH!
I get it! That's a very easy thing to do - I didn't realize I could do that. I will certainly be implementing this! Thanks Builderboy! ;D
-
Heh glad i could be of help :D That was a mighty fun post to write :)
-
Challenge:
I've decided to attempt the unadvised: Rotating strings. The challenge is who can come up the the smallest and fastest routine in basic that turns this:
":
111111111
222222222
333333333
444444444
555555555
666666666
777777777
888888888
999999999
:" (line breaks added for clarity)
into this:
":
987654321
987654321
987654321
987654321
987654321
987654321
987654321
987654321
987654321
:" (line breaks added again for clarity)
I will have a solution as well, but I want to see what you guys come up with. ;D Good luck! :D
-
assuming the string is in Str1...
" .one space
For(Z,-8,0
For(Y,9,1,-1
Ans+sub(Str1,9Y+Z,1
End:End
sub(Ans,2,81
i'd assume this is the way to go about it, but i'm looking up string commands on tibasic dev to see if there's a simpler way as i post this. i think this is the smallest... fastest is a different challenge.
-
Sounds like a UTI challenge problem :P
I'll see what I can come up with, though I bet Builder, nemo, or you will probably get it.
Edit:
See :P
-
would it be ok if the string rotated the other way?
rather than:
111111111
222222222
333333333
444444444
555555555
666666666
777777777
888888888
999999999
becoming
987654321
987654321
987654321
987654321
987654321
987654321
987654321
987654321
987654321
can it be
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
123456789
-
Yikes x.x string rotating? Hurmm i will have to puzzle over this, but currently i cant see any way better than Nemo's. Switching to strings for memory reasons i assume?
-
Nemo, they can be flipped either way; I don't care. ;D
Thanks for that. :) I still have to come up with a routine of my own...
Let's see how fast someone can make it! ^-^
-
Does the routine have to actually flip it or is it for a display routine? Because if it just has to be rotated when displayed then I could look at my routines from my spriter.
-
It must be actually flipped. ;)
-
Dang, that means I actually have to experiment :P
-
So are you using Strings for memory reasons?
-
Nah, it's for speed...
At least that's the plan. I'll write both versions and then decide the one I like better. :) Strings are much more flexible, though, and I like them better. ;D
-
Speed really? o.O But Matrices have a built in command for all the things you need silly :P
-
Would it be possible to store with strings and then put the chosen puzzle into a matrix and then use the built-in commands?
-
Would it be possible to store with strings and then put the chosen puzzle into a matrix and then use the built-in commands?
Yes, and that's what I'll do if I use matrices. However, I wanted to try strings too. ;D
-
Ah ok :P
-
Okay :) Well i cant come up with a better routine than nemo D: unless something tricky is hiding...
-
Okay, then I dare you to only use Ans to hold the string! (For loops may be used though...) ;D
-
Ask and you shall receive :P
Str1
For(B,0,8
For(A,0,8
Ans+sub(Ans,9A+9-B,1
End
End
sub(Ans,82,81→Str2
Str1
For(B,0,8
For(A,0,8
Ans+sub(Ans,73+B-9A,1
End
End
sub(Ans,82,81→Str2
Str1 holds the original string to be rotated and then Str2 gets the new rotated string. I'm not sure if they can be optimized anymore, but I don't believe so.
Also, if you didn't figure it out. One rotates one way and the other rotates the other.