Answers.Body: <p>No, at least if you're intending to use the rule change in your advantage. For instance, you could threat the enemy queen with pawns between them and there's no way for the computer to be aware of the danger, who will just let you take their queen for free. Think for instance 1.d4 d5 2.Bg5 and how is the computer supposed to know that it must move the queen away?</p>
  <p>There are also situations where the computer would have to stop playing. After 1.e4 e5 2.Bb5 the computer will suggest an illegal move, as it doesn't know that ...Ke7 is the only legal move.</p>
  <p>Since it's not aware of the rule change, it will also never use the rule tweak in its advatnage, so any reasonably skilled chess player would win the game easily.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-24T17:30:12.070Z
Answers.LastActivityDate: 2023-02-24T17:30:12.070Z
Answers.UserDisplayName: David
Answers.Body: <p>There are engines that can play chess variants when told the rules in some chess variant description language. I think <a href="https://github.com/ianfab/Fairy-Stockfish" rel="nofollow noreferrer">Fairy-Stockfish</a> is the most widely used one. The github page for it claims that <a href="https://github.com/ianfab/Fairy-Stockfish/wiki/Playing-strength" rel="nofollow noreferrer">master-level strength</a> can commonly be achieved just by giving it the rules of a user-defined chess variant, without adjusting it in any way. It claims that superhuman strength is usually possible when a fully trained NNUE network is used for evaluation. A <a href="https://github.com/fairy-stockfish/variant-nnue-pytorch" rel="nofollow noreferrer">training data generator</a> is also available on github.</p>
  <p>Disclaimer: I haven't used these tools myself, but I find these claims plausible. Fairy-Stockfish is used e.g. on lichess to provide computer opponents for various chess variants, and these computer opponents are known to be very strong, but I think these use NNUE networks to obtain a strong evaluation function.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T08:40:50.363Z
Answers.LastActivityDate: 2023-02-25T08:40:50.363Z
Answers.UserDisplayName: Polytropos
Body: <p>If there's a chess bot and I changed how the bishop moves so it can move through pieces can it beat me without the need to change the code?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-24T14:22:07.690Z
Comments.Text: Welcome to [chess.se]! I'm not really sure what you're asking - if you don't change the code, it will not know of the new rule (and probably not even allow you to play that kind of moves) ...
Comments.UserDisplayName: Glorfindel
Tags: <engines><programming>
Title: Can chess bots adapt to changes?
ThreadText: # Can chess bots adapt to changes?
  
  (Asked by: username_0 on 2023-02-24)
  
  If there's a chess bot and I changed how the bishop moves so it can move through pieces can it beat me without the need to change the code?
  
  **Tags:** engines, programming
  
  > **Comments:**
  > **username_1**: Welcome to [chess.se]! I'm not really sure what you're asking - if you don't change the code, it will not know of the new rule (and probably not even allow you to play that kind of moves) ...  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2023-02-24. Score: 1
  
  No, at least if you're intending to use the rule change in your advantage. For instance, you could threat the enemy queen with pawns between them and there's no way for the computer to be aware of the danger, who will just let you take their queen for free. Think for instance 1.d4 d5 2.Bg5 and how is the computer supposed to know that it must move the queen away?
  
  There are also situations where the computer would have to stop playing. After 1.e4 e5 2.Bb5 the computer will suggest an illegal move, as it doesn't know that ...Ke7 is the only legal move.
  
  Since it's not aware of the rule change, it will also never use the rule tweak in its advatnage, so any reasonably skilled chess player would win the game easily.
  
  
  ---
  
  ### Answer by username_3 on 2023-02-25. Score: 0
  
  There are engines that can play chess variants when told the rules in some chess variant description language. I think [Fairy-Stockfish](https://github.com/ianfab/Fairy-Stockfish) is the most widely used one. The github page for it claims that [master-level strength](https://github.com/ianfab/Fairy-Stockfish/wiki/Playing-strength) can commonly be achieved just by giving it the rules of a user-defined chess variant, without adjusting it in any way. It claims that superhuman strength is usually possible when a fully trained NNUE network is used for evaluation. A [training data generator](https://github.com/fairy-stockfish/variant-nnue-pytorch) is also available on github.
  
  Disclaimer: I haven't used these tools myself, but I find these claims plausible. Fairy-Stockfish is used e.g. on lichess to provide computer opponents for various chess variants, and these computer opponents are known to be very strong, but I think these use NNUE networks to obtain a strong evaluation function.
  
  
  ---
  
  