11-19-2020, 07:35 PM
Often when I read the language reference I am really left none the wiser. For example:
mapEntry
The most informative information I can find is: "Maps are used to stored mappings from one set of numbers to another." But what are maps? I don't know. Are there a fixed number of maps? Can I create my own maps? Looking at the chess .lud file, I think can use this to find the location of a particular piece, but I am not sure.
value
So I can work out that I can set an initial value for a piece's value when it is defined. I can retrieve the value using the value function. Does the "flips" concept relate to this value or not? Can I set the value mid game? Does the value have any other game effects or is it just a number? For example does the value effect AI play? Most relevant to me, is there a use of "sites" that would allow me to find the location of any piece of a certain value. (I am guessing "no" for the last one, but it would be neat.)
Okay I found this in the Game Logic Guide: "The value parameter is used to assign each piece a specific value which can be used for different purposes during the game such as the strength or the ranking of the piece." I think this gives the answers: no, yes, just a number, no.
For the last one may be I could do
Would this be at least a plausible thing to do? If so how would this handle a stack of pieces with different values and owners?
Pending
I have a vague sense that Pending is used to set a game state for a site that only lasts for until the next move. This is not as far as I can see stated clearly. (I deduce this from its use in definition of En Passant.)
mapEntry
The most informative information I can find is: "Maps are used to stored mappings from one set of numbers to another." But what are maps? I don't know. Are there a fixed number of maps? Can I create my own maps? Looking at the chess .lud file, I think can use this to find the location of a particular piece, but I am not sure.
value
So I can work out that I can set an initial value for a piece's value when it is defined. I can retrieve the value using the value function. Does the "flips" concept relate to this value or not? Can I set the value mid game? Does the value have any other game effects or is it just a number? For example does the value effect AI play? Most relevant to me, is there a use of "sites" that would allow me to find the location of any piece of a certain value. (I am guessing "no" for the last one, but it would be neat.)
Okay I found this in the Game Logic Guide: "The value parameter is used to assign each piece a specific value which can be used for different purposes during the game such as the strength or the ranking of the piece." I think this gives the answers: no, yes, just a number, no.
For the last one may be I could do
Code:
(all Sites (sites Occupied by:Mover top:false) if:(= 2 (value Piece at:(site))))
Would this be at least a plausible thing to do? If so how would this handle a stack of pieces with different values and owners?
Pending
I have a vague sense that Pending is used to set a game state for a site that only lasts for until the next move. This is not as far as I can see stated clearly. (I deduce this from its use in definition of En Passant.)