I only cheat when I can't win

I looked at the process model and the options in the Napoleon's Tomb Linux game and I was not pleased with the outcome for a perfectly played game. I like to have a reasonable chance of success or a game is just irritating. I don't like being frustrated by the computer and I want it to make me happy! I have to commend the developers of KDE games for the quality of the software in that package. It is compact, intuitive, solid, and very easy to use. It took me about 15 minutes to determine the structure of the operation of the code and make the changes to allow me a reasonable chance of success, by adding 4 more slush piles to the game. Compile is quick, and I only needed to make one change to napoleon.h and 6 changes to napoleon.cpp.

The code is object oriented C++ and is very well structured. Clearly a work of art in the usability of the code for multiple purposes. It would be very simple to add a new card game to the package and perhaps I will do that sometime.

Even so, I noticed something which is the real problem with software as a whole. It is perhaps the limit of the mind to comprehend the consequence of sequence and to create something which does not have a mode which is at least unusual and at worst will stop the machine.

When playing chess there are people who can look many moves ahead and plot the decision tree to their advantage and in that game, the furthest look gets the best results if a mistake is not made. The complexity of that and software is similar as there are paths that can be taken and when coding a person might prune a tree and say that nothing is going to happen there that I care to deal with.

In this case I accidentally did something which I expected to be a NULL operation from the user interface and to my surprise it did something which could be infinitely recursive. I had looked at the code, at that point of operation, already, and had decided the same thing that the programmers had decided, perhaps. Nothing interesting here as it just loops through and exits if nothing is to be done. It had lower levels that it checked and the status of the lower levels determined the action at this level. So what happened is that a condition which was actually valid in a sense emerged from the lower levels and a person would not make that choice because it would be no gain and so the act of doing it would be wasteful and thus a person would not choose that option. The computer on the other hand does not weigh whether what it does is stupid and redundant or wasteful. It chose that option, even though it was an entropic hole.

A person cannot choose options that simply waste energy to have no effect, though many people choose to do that as a form of entertainment, however in decision making for a program, a programmer would want to avoid things that serve no purpose and just waste CPU time.

Very odd and I learned something from this. Perhaps code should be more human and when a choice is made, it should be made with the sense of consequence and utility.

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen