Answers.Body: <p>It's possible, e.g.</p>
  <pre><code>[FEN &quot;2Q4k/2R4b/8/8/8/8/K7/8 b - - 0 1&quot;]
  
  1...Bg8+
  2. Ka3?? 1/2-1/2
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-25T01:02:19.937Z
Answers.LastActivityDate: 2020-11-25T02:13:16.770Z
Answers.LastEditDate: 2020-11-25T02:13:16.770Z
Answers.UserDisplayName: Allure
Body: <p>I am not a chess player but I have a homework where I have to code a chess program. I would like to know if it is possible for a player's piece to be in check, the player to move out of check, and in turn put the other player in a stalemate, from just one move?</p>
  <p>For example: White is in check -&gt; White moves out of check -&gt; Black is stalemated</p>
  <p>I haven't found any examples of it so far, but I also haven't found anything saying it's never possible, so if anyone can say either way that would be great!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-25T02:50:55.337Z
Comments.Text: Yes it can, i believe the answer provided is quite valid. From a programming perspective; all you need to worry about is IF no legal move AND NOT in check THEN stalemate to deal with this scenario. Checkmate being IF no legal move AND in check then Checkmate.
Comments.UserDisplayName: Dheebs
Tags: <programming><check><stalemate>
Title: Can you move from one side being checked to other side in stalemate?
ThreadText: # Can you move from one side being checked to other side in stalemate?
  
  (Asked by: username_0 on 2020-11-25)
  
  I am not a chess player but I have a homework where I have to code a chess program. I would like to know if it is possible for a player's piece to be in check, the player to move out of check, and in turn put the other player in a stalemate, from just one move?
  
  For example: White is in check -> White moves out of check -> Black is stalemated
  
  I haven't found any examples of it so far, but I also haven't found anything saying it's never possible, so if anyone can say either way that would be great!
  
  **Tags:** programming, check, stalemate
  
  > **Comments:**
  > **username_1**: Yes it can, i believe the answer provided is quite valid. From a programming perspective; all you need to worry about is IF no legal move AND NOT in check THEN stalemate to deal with this scenario. Checkmate being IF no legal move AND in check then Checkmate.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-11-25. Score: 4
  
  It's possible, e.g.
  [FEN "2Q4k/2R4b/8/8/8/8/K7/8 b - - 0 1"]
  
  1...Bg8+
  2. Ka3?? 1/2-1/2
  
  
  ---
  
  