Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Sudoku Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Presidency20




PostPosted: Tue Jan 05, 2010 6:57 pm   Post subject: Sudoku Program

What is it you are trying to achieve?
I am trying to achieve the creation of a sudoku game. I want my kids to get used to playing sudoku its great for the mind.

What is the problem you are having?
There is more than one problem. I am getting the sudoku puzzles from text files. I import the puzzles inside string but i cant store it as an integer using <strint>. What will be the proper use of a grid Graphics??? or is there a text based grid in Turing? How will I get input from the person trying to play the game?? and how can I stop the person from changing the numbers originally used from the text file?


Describe what you have tried to solve this problem
I did most explaining above ^^

I am using a function to make sure there arent any of the same numbers in the same row column or grid. I cant fully acheive this function without changing my input text file code into integer variables.

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
N/A


Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Tue Jan 05, 2010 10:37 pm   Post subject: RE:Sudoku Program

If you want picture-based grid graphics, look at my Minesweeper Tutorial, it's a good starting place for that (and has a set of free digit pictures already prepared!). A text grid is also possible, and would probably be best done with Text.Locate() and specified-length put commands (see the documentation for Text.Locate and put).

What exactly happens when you try to use strint to convert the strings you're reading to integers? You haven't provided a symptom, error message, or code for us to reproduce the error. There's more than one thing that could be going on.

Input is usually taken with get, getch or Input.KeyDown, depending on game type and control scheme. Read up on them and decide for yourself.

You can't stop people from editing text files. It's just not even remotely possible. You could make them read-only, but any user can circumvent that with a couple seconds of thought.
mirhagk




PostPosted: Wed Jan 06, 2010 7:38 am   Post subject: RE:Sudoku Program

if the numbers are numbers in the text file then you can't import them correctly as strings. In order to make sure that the file imports just as you want it to, create the files with a turing file, and then just reverse the process to import them.

As for people editing text files, you could encrypt them in such a way that if they are edited the file won't work. (not hard to do, and you'd lose that file but you should have copies anyways and they won't try more than once or twice)
imbored




PostPosted: Wed Jan 06, 2010 7:18 pm   Post subject: RE:Sudoku Program

if i were to do that program i would use something simple like 2d array because i am not some pro so i like to keep it simple. and do verification with arrays instead of making it complicated. Since its just integers you are dealing with. it shouldn't be that hard i think.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: