(translated by Google translator)
Hi all.
I just published the latest version of the "Nature" program. This is the program ID: RPSQ181.000-4
In this version, a person manually controls only the speed of the game.
This control is performed by pressing the "W" and "S" keys.
The control code is temporary. Therefore, the code is as simple as possible.
In this version of the program, the movement of the Rabbit and the Snake is controlled only by written code.
The code that controls the Rabbit is in the "Nature" program. This code uses only randomness.
But, the code that controls the Snake's movement is more complex. Although this is not AI, this code already evaluates the current situation on the playing field.
In order to study the "LDCall.CallInclude()" function, I placed the code of the Mind of the Snake in the included file.
This is the program ID: LDWX717.000
This file doesn't do anything on its own. It contains one subroutine that the main program "Nature" calls to get the Snake's decision about its next move.
(oops, I forgot to check with the "Nature" program for the presence of a compiled included file in the folder
)
- In short, you first need to compile the include file into the folder in which the compiled main "Nature" file will be launched.
- Then, using SB-Prime, you need to write the name of the included exe-file into a variable that is located at the very beginning of the “Nature” file. For example, like this: s_includedFileName = "Included Snake AI 004.exe"
- Then you need to compile the “Nature” file into the same folder.
That's it, now you can run the "Nature" file and watch the funny struggle between two technologies.
-------
The rules of the game have been slightly changed.
So far, the Snake sees the Rabbit always and anywhere on the playing field.
The Rabbit never sees the Snake at all. While the Snake is sneaking up on the Rabbit, the Rabbit does not see it, because the Snake has a good camouflage.
When the Snake makes its attack on the Rabbit, then it is too late for the Rabbit to see the Snake.
And if the Rabbit makes a random jump and runs away from under the very nose of the Snake, then the Rabbit also cannot see the Snake, because the Snake has an excellent camouflage.
Thus, the combination of immobility and unexpected jumps is the Rabbit's means of protecting himself from the teeth of the Snake.
But the Rabbit's ability to jump over the Snake's body gives the Rabbit an excellent opportunity to defend itself.
Even when I controlled the Snake manually, I immediately felt how much nerves the Rabbit could ruin the Snake until the Snake caught the Rabbit.
I wonder what the Rabbit will be able to do against the Snake when the Rabbit gains Intelligence. But their fights can be very interesting.
( Tip: I recommend launching the “Nature” program not from the SB-Prime editor. It's better to run the executable file directly. When I ran the program from the editor, then I sometimes got strange errors.)
Let's test it!