This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 20 Dec 2006 10:45:11 pm    Post subject:

I've been working on a sudoku game, which I will strive to make the best possible. So far, features include the following:
--Almost totally randomly generated sudokus (gen time is very short!)
Pathetic, I know. Here are some features I'd like to include in the release:
--Can fill in possibilities
--Can check legitimacy of the sudoku you entered
--As implied by the above, you can enter your own sudoku
--Sudokus are saved if you quit.
--Difficulty determined by number of boxes left to fill in.
It's looking sweet right now....I have ideas for the possibilities thing, and I love my random generator Very Happy. Although....all it really does is take a random pre-loaded sudoku and mix it up. Here are the progs I have done so far:

Check.8xp -- Checks the legitimacy of the sudoku in [A]
A.8xp -- Selects (only 3 pre-loaded ones so far) and mixes up a sudoku. Once in a while a illegal one comse up, but it works for a lot of the time.

Here's my idea for possibilities: The possibilities are in the matrix as a less-than-whole decimal. Upon request (meaning the user asks for it), the decimal is dissected by a bunch of fPart('s and displayed onscreen.

As a side note: the Sudoku Solver in the archives here doesn't always mean the sudoku is correct when it says solved. It told me that a sudoku with two 7's in the first box was "Solved". prgmCHECK has no such errors.

Screenie of the to-be field. I want this to not use any pics.


If you're wondering why the generator is named "A", it's because it's easier to access it on the PRGM menu, rather than scrolling thru X number of programs.


Last edited by Guest on 20 Dec 2006 11:39:18 pm; edited 1 time in total
Back to top
trigkid213


Member


Joined: 30 Mar 2006
Posts: 208

Posted: 20 Dec 2006 11:10:37 pm    Post subject:

In program CHECK, I wouldn't go quite so far as to say an invalid sudoku is illegal... Wink
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 20 Dec 2006 11:12:15 pm    Post subject:

Sorry. Couldn't think of a better word. It's not locked, so edit it if you feel like it Smile.

Can you figure out why a sudoku is invalid every once in a while? It's always two 9's in a column, and when it tells you "Illegal", then Z will indicate which column the two 9's are in. The extra 9 pops out from nowhere-every other box/row/column has a 9 already. Can anyone figure this out?


Last edited by Guest on 20 Dec 2006 11:22:07 pm; edited 1 time in total
Back to top
trigkid213


Member


Joined: 30 Mar 2006
Posts: 208

Posted: 20 Dec 2006 11:37:56 pm    Post subject:

It's because in the 5th row of your first pre-loaded matrix you have two 9s and no 3.
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 20 Dec 2006 11:38:59 pm    Post subject:

Yeah, I just figured that out 3 (4,5..) seconds ago Laughing
The updated one is in the first post.
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 21 Dec 2006 12:57:15 am    Post subject:

Thats pretty quick, I like it. It checks faster than I thought it would. :biggrin:
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 21 Dec 2006 08:08:01 am    Post subject:

I agree. It only takes a second. It was your idea, so thanks!
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 21 Dec 2006 10:29:14 am    Post subject:

No problem, I'm glad someone finds my ideas useful.

I timed it, takes about ~5 seconds on my 83+. Do you have a 83+SE/84?
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 21 Dec 2006 12:40:26 pm    Post subject:

Yeah, it doesn't take very long Smile. Currently I'm working on the sudoku interface Smile. However, I discovered that XTRAVAR's matrices don't work, so I'll have to use some obscure matrix to save stuff i.e. [I]. It's coming along well, but it runs kind of slow--it re-draws 2 lines every time you move, and it has to compensate for the box-divider lines. You'll see what I mean when I release a new version.

Btw, your name seems to betray your personality, or at least the one I see on the internet. Tod Boring? You don't seem too boring, and your avy doesn't suggest you're that boring either *looks at frog avy again*.

Btw, I also decided that compressing a string into a single element would also be easier. Does anyone know where I could find how to do this?

There's a helpful link that describes masking squares: here.

EDIT: I masked 40 squares, and i solved it. It matched the one that was generated exactly. Smile Now to test it again--the 40 squares are masked randomly.


Last edited by Guest on 21 Dec 2006 07:21:02 pm; edited 1 time in total
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 21 Dec 2006 07:23:13 pm    Post subject:

Harrierfalcon wrote:
Yeah, it doesn't take very long Smile.  Currently I'm working on the sudoku interface Smile.  However, I discovered that XTRAVAR's matrices don't work, so I'll have to use some obscure matrix to save stuff i.e. [I].  It's coming along well, but it runs kind of slow--it re-draws 2 lines every time you move, and it has to compensate for the box-divider lines.  You'll see what I mean when I release a new version.

Btw, your name seems to betray your personality, or at least the one I see on the internet.  Tod Boring? You don't seem too boring, and your avy doesn't suggest you're that boring either *looks at frog avy again*.
[post="93232"]<{POST_SNAPBACK}>[/post]

Xtravar seemed to work from me, did you make sure you were using it in a basic program? Kinda freaky to see two L1's in the memory management screen. Wink It should be interesting to see what you come up with for the interface.

Your german skills serve you well. (either that or google lol) todlangweilig = extremely boring. I try not to be too boring though. Smile You should see the frog full sized, its huge. I can't find it right now, but it's on google somewhere.
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 21 Dec 2006 07:46:35 pm    Post subject:

I assume you scaled it down. Obviously. Don't worry--you're not boring.
I'm taking German as my language--most of my friends are German, my dad took German in high school, my uncle served in the Army in Germany. Although admittedly, I'm pretty sure I'm the only Asian taking German Very Happy.

I dunno about Xtravar--I'll try it again.

UPDATE: It works, but it will take a little longer to make the saved game, as I have to run XTRAVAR every time, then recall Ans. Although it appears I can run XTRAVAR, and store Ans into a string Smile, so I only have to recall the string.

Btw, do you know there I can find out how to compress a string into a single element?
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 22 Dec 2006 01:01:05 am    Post subject:

Harrierfalcon wrote:
I assume you scaled it down.  Obviously.  Don't worry--you're not boring.
I'm taking German as my language--most of my friends are German, my dad took German in high school, my uncle served in the Army in Germany.  Although admittedly, I'm pretty sure I'm the only Asian taking German Very Happy.

I dunno about Xtravar--I'll try it again.

UPDATE: It works, but it will take a little longer to make the saved game, as I have to run XTRAVAR every time, then recall Ans.  Although it appears I can run XTRAVAR, and store Ans into a string Smile, so I only have to recall the string.

Btw, do you know there I can find out how to compress a string into a single element?
[post="93267"]<{POST_SNAPBACK}>[/post]

I took german for 4 years(8th-11th) in high school, my best friend also was in german. A good number of my friends were in german as well. one of which, was an Asian guy. Your not alone in the world. :P

Well that depends on what you mean by single element. If you mean a list, it would have to be a number. You would only have 7-9 bytes to play with. What are you trying to do, that'll give us an idea of what kind of options we have?
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 22 Dec 2006 01:29:46 am    Post subject:

todlangweilig wrote:
I took german for 4 years(8th-11th) in high school, my best friend also was in german. A good number of my friends were in german as well. one of which, was an Asian guy. Your not alone in the world. :P

Well that depends on what you mean by single element. If you mean a list, it would have to be a number. You would only have 7-9 bytes to play with. What are you trying to do, that'll give us an idea of what kind of options we have?
[post="93284"]<{POST_SNAPBACK}>[/post]

I just finished my first semester of German, and all is going well. Mein Deutschlehrer ist sehr gut. YAY! I'm not alone in the world!! Very Happy Very Happy :D

All I need to do is store the possibilities as a string, and compress that string into a single numerical value, that will be in the matrix.
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 22 Dec 2006 08:41:09 am    Post subject:

Harrierfalcon wrote:
I just finished my first semester of German, and all is going well.  Mein Deutschlehrer ist sehr gut.  YAY! I'm not alone in the world!! Very Happy Very Happy :D

All I need to do is store the possibilities as a string, and compress that string into a single numerical value, that will be in the matrix.
[post="93288"]<{POST_SNAPBACK}>[/post]

Thats good, having a good teacher will improve your studies greatly. Take some advice, make sure you learn the basics. Make sure you learn your grammar, it will only help you. I didn't pick up on a lot of things in my first year, and that only caused me problems in later years when we had to build on the previous concepts. This will save you needless fustration later on.

It should be possible, give me some time to think about it. Do you mind if I use a Asm program to do the str -> number conversion? Hmm, Weregoose might have some code to that in basic though, I check on that later.
Back to top
vuurrobin


Advanced Member


Joined: 09 Aug 2006
Posts: 428

Posted: 22 Dec 2006 09:06:50 am    Post subject:

if the string only contains numbers, then couldn't you just use the [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]expr( command. like this:

[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]"123245->str1
expr(str1
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 22 Dec 2006 09:30:36 am    Post subject:

i think he means names. This is a way that i use, but you need to play with the code a little bit.
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 22 Dec 2006 11:04:47 am    Post subject:

vuurrobin wrote:
if the string only contains numbers, then couldn't you just use the [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]expr( command. like this:

[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]"123245->str1
expr(str1
[post="93296"]<{POST_SNAPBACK}>[/post]

That should do what we need. I was working on packing and unpacking programs. vuurrobin's solution is much better than my packing program. I hadn't even gotten it to take a string as an inpu yet. Very Happy

However, the unpacking program may be of use to you. UNPAK takes a number in variable A. It would look like this for all possibilities, 987654321. If say, 6 isn't a possiblity, then A should look like 987054321. It returns L2 containing {1, 2, 3, 4, 5, 0, 7, 8, 9} if A = 987054321.

Here's the code for UNPAK. I will also attach the UNPAK(which is called UNPAK2 fyi) and PAK programs

Code:
For(X, 1, 9
A/10^(X
iPart(10fPart(Ans->L2(x
End


You can parse through the list and displays it how you want like this:
[font="courier new;font-size:9pt;line-height:100%;color:darkblue"]
for(x, 1, 9
if L2(x
//code for displaying here
end
end

If there is a command to get rid of zeros in a list, then we could get rid of the if statement in the code above.

The TESTPAK program tests unpak and unpak2, by running them for 100 interations of a loop. Takes about 40s. Make sure A is valid before running. To run unpak, store 1 to Ans, any other number will run unpak2. Use unpak2, its smaller and faster; I added unpak to keep testpak from breaking.
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 22 Dec 2006 11:40:39 am    Post subject:

Thanks a lot! I hadn't thought of that. Cheers! Ja, das ist super und nicht langweilig! You'll get credit when I release the final version. Of course, I probably won't use your programs as subroutines, but just recall them into the main program. I might edit the code a little though. Just replacing L2 and stuff. That is OK right?

Erasing some zero's out of the list would cause an INVALID DIM the way I plan on using them.

EDIT: I have the engine done so far! I'm going to add an in-game menu, but here's what I have so far:
--3 Preloaded sudokus that are scrambled up to 'generate' a sudoku
--Graph Screen User Interface (GSUI?)
--Possibilities for each square, you just have to hit [enter] to see that boxes ones. (Thanks to todlangweilig)
--Runs with a small bit of lag, but Sudoku isn't speed critical....is it?
I don't feel the need to attach what I have so far, but if you want to see it, let me know.


Last edited by Guest on 22 Dec 2006 07:26:04 pm; edited 1 time in total
Back to top
todlangweilig


Advanced Member


Joined: 14 Feb 2006
Posts: 470

Posted: 24 Dec 2006 02:32:22 am    Post subject:

Quote:
Thanks a lot! I hadn't thought of that. Cheers! Ja, das ist super und nicht langweilig! You'll get credit when I release the final version. Of course, I probably won't use your programs as subroutines, but just recall them into the main program. I might edit the code a little though. Just replacing L2 and stuff. That is OK right?

No problem. Ich bin froh dass, du mein(e?) Idee ist gut dankst. (I think thats right, it's been so long, and I never learned it correctly) I don't mind if you recall them into the main program, you can use my ideas/programs however you see fit. I'm just providing ideas, implement them as you see fit. Smile
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 24 Dec 2006 11:30:15 pm    Post subject:

Danke sehr, although I don't think ideas come in a tangible form.....do they? I'm coming along well, I have most features implemented, the engine runs fast, possibilities, in-game menu, all that jazz. Saving and loading is also implemented. I found that revealing 40 numbers will always force the solution in the original sudoku, so I'll just keep noodling it to figure out However, I am torn between keeping and dropping the user-entered sudoku. I think it would be a great feature, but I don't know any way to solve to sudoku, with only 1 solution. I can use prgmCHECK to check its validity, but is that enough?
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are UTC - 5 Hours

 

Advertisement