Monday, February 21, 2011

Chapter 3

Completed chapter 3.  There are some exercises left, but they involve some modifications of bitmaps, which isn't what I'm trying to learn.  This was a very involved chapter, a lot of code, some new concepts, interesting over all.
Once again, had to debug on two occurrences, once to find a missing 'using' statement - C# just took over at that point, and "fixed" up (changed basically) what I was typing by changing the name of the class to a similar name.  I was looking at the book not paying attention to the screen, and ended up with wrong class names, which don't have same constructors/methods.

Looking into the future, I'm thinking of getting OGRE 3D 1.7 Beginner's Guide
It seems to be the same type of a book (a tutorial of a kind), concentrating on 3D-development.

Tuesday, February 15, 2011

Sudoku enhanced

Updated my rather bland text output of Sudoku to also print out data in a more graphical way.  It isn't yet capable of taking input, yet displaying updated boxes in color helps find which boxes need updating.

The display was a copy from my attempted Minesweeper clone.

The logic was further enhanced to solve hard mode of http://www.websudoku.com  Unfortunately it cannot yet crack the 'Evil' mode, as the second screen-shot shows.  (all boxes with multiple values aren't solved, they list possible values)

Saturday, February 12, 2011

Sudoku

Sudoku is a fun game to play.  I wanted to write a program to solve sudoku for a while now.  Took some time and wrote up one today.  It can solve easy and medium puzzles off http://www.websudoku.com/.  I'm aware of a few limitations in it, so I don't expect it to solve all types of puzzles, but it does a lot.
I can always add brute-force for some extra hard puzzles, but I'd like to add as much smarts into it as I can before going down that road.

For now, I'm happy with the project the way it is, I give it this type of input file:
410290005
002000490
000004326
000600000
209030107
000001000
134900000
078000500
600018039

And this is the output:
413296875
862573491
597184326
781649253
249835167
356721948
134957682
978362514
625418739

I'm not a very graphical person, and haven't made a gui for it.  That can be done later, hopefully I'll be back to my book tomorrow.

Tuesday, February 8, 2011


Chapter 2. This one had a lot of code to type in. The game seems a lot more advanced as well, and I'm not familiar with it. An interesting occurrence has happened, there's is a bug. I presume, the issue is a typo I did, not a problem in the book, but instead of checking all code line by line, I am about to debug the issue.
What works: The main screen comes up. The game-screen also comes up.
What does not work: Clicking around does nothing, I believe I'm trying to play it correctly, but nothing is happening.

After a couple of hours debugging various issues, and finding two typo's I have made, finally gave up and did a diff of supplied code and what I typed in. The issue was I put a plus instead of a multiply sign. The final screen-shot shows how the game should look like. The game is now operational.

It was quite a learning experience, I'm convinced that in future, to debug GUI programs I'll need to have text representations of them, in order to make sure that logic is working, and the issue is in display. It's possible that with experience these things will become easier though.