It's about chess...
-
Because I'm a software developer people think I can install their new RAM, set-up their printer, or rid their machine of viruses. It's a funny old world :)
People are full of strange fantasies...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Because I'm a software developer people think I can install their new RAM, set-up their printer, or rid their machine of viruses. It's a funny old world :)
I usually explain that to people in by asking if the last time they wanted to have their teeth cleaned the went to a proctologist.* * meant on multiple levels of inuendo
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010
-
I usually explain that to people in by asking if the last time they wanted to have their teeth cleaned the went to a proctologist.* * meant on multiple levels of inuendo
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010
:thumbsup:
-
Because I'm a software developer people think I can install their new RAM, set-up their printer, or rid their machine of viruses. It's a funny old world :)
-
xkcd: Magnus[^] Lot of times people think that just because I'm a software developer I'm good at chess too (I'm not that bad, but definitely not that good)... And seeing XKCD I was wondering why chess is so interesting after all these years... My guess - the (almost) endless number of variations of games...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Ah, chess... I think about it once in a while. Remember this question from October? The Lounge - CodeProject[^] I think of it this way: 0) There are sixty-four spaces on a chess board 1) Each space may be unoccupied or occupied by one token (I'll try not to say "piece") 2) There are six types of token: King, Queen, Bishop, Knight, Rook/Castle, Pawn 3) There are two colors of token: Black, White (usually) 4) That makes twelve distinct token values, plus we can use a "null" token to represent an empty space, for a total of thirteen values I chess position can therefore be reduced to a sixty-four digit base-13 value. Windows calculator calculates 13^64 as 1.9605347643076107333065976042357e+71 . A great many such values will not represent a valid chess position. So all you need to do is enumerate from zero to 1.9605347643076107333065976042357e+71, eliminate the invalid values and determine a pair of "best next position" values (one for black, one for white), and store them. Then during a game, a simple look-up is all that is needed to select your move. It becomes boring really; hardly any challenge at all. Here's what I wrote in October; this is the hard part:
[System.ComponentModel.DescriptionAttribute("Chess piece definition")]
public enum Piece
{
[System.ComponentModel.DescriptionAttribute("No piece, empty square")]
None = 0
,
[System.ComponentModel.DescriptionAttribute("Piece has a special or limiting movement rule")]
SpecialMask = 1
,
[System.ComponentModel.DescriptionAttribute("Piece can move only in ranks or files")]
OrthogonalMask = 2
,
[System.ComponentModel.DescriptionAttribute("Piece can move diagonally")]
DiagonalMask = 4
,
[System.ComponentModel.DescriptionAttribute("Black chess piece")]
BlackMask = 8
,
[System.ComponentModel.DescriptionAttribute("Knight")]
Knight = 1
,
[System.ComponentModel.DescriptionAttribute("Rook")]
Rook = 2
,
[System.ComponentModel.DescriptionAttribute("Pawn")]
Pawn = 3
,
[System.ComponentModel.DescriptionAttribute("Bishop")]
Bishop = 4
,
[System.ComponentModel.DescriptionAttribute("Queen")]
Queen = 6
,
[System.ComponentModel.DescriptionAttribute("King")]
King = 7
}:wtf:
-
xkcd: Magnus[^] Lot of times people think that just because I'm a software developer I'm good at chess too (I'm not that bad, but definitely not that good)... And seeing XKCD I was wondering why chess is so interesting after all these years... My guess - the (almost) endless number of variations of games...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Ah, chess... I think about it once in a while. Remember this question from October? The Lounge - CodeProject[^] I think of it this way: 0) There are sixty-four spaces on a chess board 1) Each space may be unoccupied or occupied by one token (I'll try not to say "piece") 2) There are six types of token: King, Queen, Bishop, Knight, Rook/Castle, Pawn 3) There are two colors of token: Black, White (usually) 4) That makes twelve distinct token values, plus we can use a "null" token to represent an empty space, for a total of thirteen values I chess position can therefore be reduced to a sixty-four digit base-13 value. Windows calculator calculates 13^64 as 1.9605347643076107333065976042357e+71 . A great many such values will not represent a valid chess position. So all you need to do is enumerate from zero to 1.9605347643076107333065976042357e+71, eliminate the invalid values and determine a pair of "best next position" values (one for black, one for white), and store them. Then during a game, a simple look-up is all that is needed to select your move. It becomes boring really; hardly any challenge at all. Here's what I wrote in October; this is the hard part:
[System.ComponentModel.DescriptionAttribute("Chess piece definition")]
public enum Piece
{
[System.ComponentModel.DescriptionAttribute("No piece, empty square")]
None = 0
,
[System.ComponentModel.DescriptionAttribute("Piece has a special or limiting movement rule")]
SpecialMask = 1
,
[System.ComponentModel.DescriptionAttribute("Piece can move only in ranks or files")]
OrthogonalMask = 2
,
[System.ComponentModel.DescriptionAttribute("Piece can move diagonally")]
DiagonalMask = 4
,
[System.ComponentModel.DescriptionAttribute("Black chess piece")]
BlackMask = 8
,
[System.ComponentModel.DescriptionAttribute("Knight")]
Knight = 1
,
[System.ComponentModel.DescriptionAttribute("Rook")]
Rook = 2
,
[System.ComponentModel.DescriptionAttribute("Pawn")]
Pawn = 3
,
[System.ComponentModel.DescriptionAttribute("Bishop")]
Bishop = 4
,
[System.ComponentModel.DescriptionAttribute("Queen")]
Queen = 6
,
[System.ComponentModel.DescriptionAttribute("King")]
King = 7
}:wtf:
Actually all chess programs are combining two things... 1. Basic knowledge of the chess rules 2. A lookup of pr-recorded strategies (for opening, play and end-play separately in most cases) The reason for that is that there is on really best-move for most parts of the game...Chess is not only about moving the pieces around but to build a defense/offense strategy that will provide you not only with small victories but winning the war too... There is a few estimates of the number of possible chess games (between 10^50 to 10^120) and they say there is more chess games than atoms in the universe (which of course has no base and only effective as a way to tell that there are unimaginably large number of games)...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
F-ES Sitecore wrote:
Because I'm a software developer people think I can install their new RAM, set-up their printer, or rid their machine of viruses.
Can, yes; willing, not so much.
Shhhhhh....keep that to yourself ;)
-
Ah, chess... I think about it once in a while. Remember this question from October? The Lounge - CodeProject[^] I think of it this way: 0) There are sixty-four spaces on a chess board 1) Each space may be unoccupied or occupied by one token (I'll try not to say "piece") 2) There are six types of token: King, Queen, Bishop, Knight, Rook/Castle, Pawn 3) There are two colors of token: Black, White (usually) 4) That makes twelve distinct token values, plus we can use a "null" token to represent an empty space, for a total of thirteen values I chess position can therefore be reduced to a sixty-four digit base-13 value. Windows calculator calculates 13^64 as 1.9605347643076107333065976042357e+71 . A great many such values will not represent a valid chess position. So all you need to do is enumerate from zero to 1.9605347643076107333065976042357e+71, eliminate the invalid values and determine a pair of "best next position" values (one for black, one for white), and store them. Then during a game, a simple look-up is all that is needed to select your move. It becomes boring really; hardly any challenge at all. Here's what I wrote in October; this is the hard part:
[System.ComponentModel.DescriptionAttribute("Chess piece definition")]
public enum Piece
{
[System.ComponentModel.DescriptionAttribute("No piece, empty square")]
None = 0
,
[System.ComponentModel.DescriptionAttribute("Piece has a special or limiting movement rule")]
SpecialMask = 1
,
[System.ComponentModel.DescriptionAttribute("Piece can move only in ranks or files")]
OrthogonalMask = 2
,
[System.ComponentModel.DescriptionAttribute("Piece can move diagonally")]
DiagonalMask = 4
,
[System.ComponentModel.DescriptionAttribute("Black chess piece")]
BlackMask = 8
,
[System.ComponentModel.DescriptionAttribute("Knight")]
Knight = 1
,
[System.ComponentModel.DescriptionAttribute("Rook")]
Rook = 2
,
[System.ComponentModel.DescriptionAttribute("Pawn")]
Pawn = 3
,
[System.ComponentModel.DescriptionAttribute("Bishop")]
Bishop = 4
,
[System.ComponentModel.DescriptionAttribute("Queen")]
Queen = 6
,
[System.ComponentModel.DescriptionAttribute("King")]
King = 7
}:wtf:
-
Your analysis doesn't allow for en passant or "You can/can't castle"...
I'm retired. There's a nap for that... - Harvey
Yes it does: [System.ComponentModel.DescriptionAttribute("Piece has a special or limiting movement rule")] SpecialMask = 1 Knight, King, and Pawn all have that Flag.
-
Kornfeld Eliyahu Peter wrote:
the (almost) endless number of variations of games
What we got here is a failure to communicate
How about a nice game of chess?
-
Yes it does: [System.ComponentModel.DescriptionAttribute("Piece has a special or limiting movement rule")] SpecialMask = 1 Knight, King, and Pawn all have that Flag.
Having the flag doesn't complete the problem. The state of a board position needs to include whether an en passant move or a rook/king move has recently or already taken place. Just knowing that a move could have taken place doesn't work. [... not sure what you mean about knight. I think you meant rook.]
I'm retired. There's a nap for that... - Harvey
-
Having the flag doesn't complete the problem. The state of a board position needs to include whether an en passant move or a rook/king move has recently or already taken place. Just knowing that a move could have taken place doesn't work. [... not sure what you mean about knight. I think you meant rook.]
I'm retired. There's a nap for that... - Harvey
Pfft. That's details. I meant Knight. Rooks have nothing special other than being at the mercy of the King during a castling move. The goal of that exercise was merely to assign 4-bit values to the tokens in a "logical" manner. I have no ambition to implement the system as described.