Game fixes 6-stein, segmentation fault

I knew this flaw was in the game and failed to fix it. The symptoms are a segmentation fault due to the access of memory outside an array bounds when the mouse is clicked in window 2 to the right of the puzzle hints.. The code below in the mouse handler for Window number 2, fixes the problem. It is already updated in my source and I am continuing to fix some issues. The puzzle solver can be a bit more intelligent and misses a couple easy answers, but I know where they are applied and it will make the hint number smaller and the difficulty a small bit higher. The variable "mat" is used as an index into a constructed array of triple element hints. The element 99 is used as a counter of the array usage and so a solution was designed into use of the array and I simply failed to take that step of implementation before publishing the code. It is after all version 0 and sometimes you just have to start doing what you need to do, so you can operate in the real. It is hard to consider what is a real issue before the fact. I tried, but reality makes a big difference in how much something is considered. Beyond this I am not aware of any serious flaws, other than cosmetic or simply weaknesses.

case MotionNotify: hintToApply=(event.xmotion.y)/((ScreenY)/elements); if((event.xmotion.x)>ColumnWidth){hintToApply=1+elements+((event.xmotion.y)/((ScreenY)/elements));} if( hintToApply >= ((rulesArray[99])) ) { hintToApply=-1; } else { hintToApply=rulesArray[hintToApply]; } hintToHighlight=((event.xmotion.y)/((ScreenY)/elements)); if((event.xmotion.x)>ColumnWidth){hintToHighlight=hintToHighlight+elements+1;} break;

It is an interesting game like thing. IMHO

I modified the code above to remove the = sign and make the limit of selection 2 higher. It failed to allow selection of last and next to last rule. That is incorporated in the game. I don't think this is a deliverable, it just serves to show how Xwindows mouse, keys, SDL sound, Opengl textures, file handling, and associative logic can be implemented. I will continue to add things to this so I can test methods in the framework, and use the understanding to help design better code for a real application. I am thinking I am going to incorporate .obj files and a world system to allow a 3D kind of game that creates worm holes between visible game space to allow travel in an N-dimensional world system that is composed of logical associations which are represented as game players. I will remove some of the test code in the next release also.I have been using the term "hint" and "rule" as it applies to this puzzle interchangeably because both fit and I never completely decided how to characterize the hints / rules. So I will select one or the other and grep-sed to fix that. The changes and additions are ongoing and I won't put up any more code changes in progress until they are solid.

0 comments:

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen