Wapati: thank you for responding with courtesy and maturity. And to answer your question, "Yes" I was somewhat dismayed by the internal logic and structure of Pocket Sudoku.
louwin: if you are legitimately interested in .NET programming--at least in regards to Sudoku--I suggest you take a look at some open source C# code I posted at http://www.humble-programmer.com/bb_sudoku.htm. It is a reasonably straight-forward sudoku generator/solver that attempts to strike a balance between performance and code readability. Moreover, I would be happy to answer any questions you may have about it. _________________ Cheers!
I take your point, lkSudoku, but I do have 20 years in 5 or 6 BASICs, though not OO it is still a high level language. I did touch on VB5 a long time ago.
I should learn C# (I keep telling myself that every day) as I stumble around in the program. There are a hundred things I don't understand and another hundred things I don't know how to do like how do you declare a method in one source file so it can be called from another method in another file? How do you declare data so it is accessible from lots of methods? How much time do you have?
I am treating this as a learning exercise as well as modifying the program to my very specific requirements. You never know, one day I may write my own Sudoku Solver/generator borrowing logic from all and sundry. Game play from here, generation logic from there and so on. I can hear you groan "we don't need ANOTHER solver/generator"!!!!
I have started several tutes but the learning is so slow and the questions I have don't get answered. I don't know who these tutes are aimed at but obviously not at me. I have tried tutes from CodeProject, and several "Learn C#" tutes from half a dozen sites. I will try to perservere....
I have acheived some success, if I must say so myself. I have totally reworked the display to the way I like it when I use solve puzzles on paper with a pen, a pencil and an eraser. e.g. I have incorporated about 5 additional font sizes in the pencil mark display. Again, I display naked singles in a font (in red) just smaller than the givens. Hidden singles I display also in large font amid the other candidates to show that it is a hidden as opposed to naked. The display modifications do not solve the puzzle just displays the pencil marks how i write them on paper in pencil.
Do you know of a tute that would answer the two questions I posed? If so, I would love a link.
Humble Programmer, thank you, I did find your site and I downloaded the source this morning. I am sorry to say I haven't had the time to peruse it yet (I am looking forward to it though!). I have 4 daughters and 5 grandkids and babysit 4 full days a week (during which I play a LOT of Sudoku but don't program near enough!)
I have also been given source of a generation routine that generates 30 to 40 thousand grids a second (the routine was written in VB.NET but the author kindly transalated it to C# for me). But I'm more after a faster "difficulty setting routine" than a faster generation routine.
I am IMPATIENT and love to get my hands dirty. I (hopefully) have a long time to acheive my aims and even longer to enjoy them. I hate to have unanswered questions but I program around them. I improvise. If I can't call a display method in another source file I read my required results in the debugger.
Another thing I don't understand, after playing 3 or 4 games the available memory (of which there is only about 40Mb) drops by 10Mb and this appears to contribute to the delay in "difficulty setting". I can't find where this memory goes (some sort of bleed?) (garbage collection?). A "soft reset" restores the memory availability.
Sorry I ramble a bit....
Humble, I would REALLY be interested in your implementation of your source on the PPC. I would kill to see it! I also noticed that your site doesn't boast of an executable so I couldn't run your solver/generator or check out YOUR gameplay. How do you handle "difficulty setting"? I would love to play your PPC version on my 640x480 HP hx4700 PPC. I fear I may ask too many questions about your code.
Thank you for your replies, they are really appreciated.
I do not know C#, but I know C++ and Java, and I consider C# as the Microsoft imitation of Java
how do you declare a method in one source file so it can be called from another method in another file? How do you declare data so it is accessible from lots of methods?
In object oriented languages, a method is a modifier of the class object, you declare a method in the class, then you instansiate an object of that class, and call the method for the specific object; There are also functions that can be called without an instance, these are called static methods, and cannot use the class non static members, usually there is a class header declaring its data members and functions, and a source file implementing the declared functions
In C++ there are 3 levels of access to class members and functions:
private - can only be accessed by the class internally
protected - can be accessed by all derived classes also
public - can be accessed everywhere
Another thing I don't understand, after playing 3 or 4 games the available memory (of which there is only about 40Mb) drops by 10Mb and this appears to contribute to the delay in "difficulty setting". I can't find where this memory goes (some sort of bleed?) (garbage collection?).
My guess is that there is somekind of memory leak; if C# is like java, it has a garbage collector that frees all memory for objects that are not referenced, so there are probably some references in the program to objects that remain between games although not used in the next games
Posted: Wed Jan 13, 2010 10:42 pm Post subject: VS2008 compiler
Thanks lkSudoku but....
There is a method called Status as below that displays a message in the status area:-
private void Status(string text)
The first thing I did was change the private to public but the compiler still didn't like it.
I posted the question in the VS2008 forum but didn't get a reply, too simple a question for those clever people? I tried reading about private, public and many others in a tute but it was still as clear as mud after I finished reading.
Humble, I copied your batch file and activated it and got an error that Program.cs was missing. I tried copying MY Program.cs and changing the namespace constant but ran into other more complicated errors beyond my experience. Sorry, newbie alert!
It's not simple to tell what is the compiler error based on the sole function decleration, but I can think of a few problems
- Perhaps the class containing the Status function is inherited from a class which defines the same function as private
- Perhaps you did not instantiate or referenced the correct object when calling its method
You could create a new public function in the class containing Status, and call the private function from that public function
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum