Answers.Body: <p>This is kind of similar to the line (with colors reversed) 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 dxe4 6. Qg4</p>
  
  <p>It's basically an identical position with colors reversed except white's knight is already on c3 which is actually a really good square for the knight.  In fact I believe the main line of the line listed above is 6.. Nf6 7. Qg7 Rg8 8. Qh6 Rg6 9. (Queen somewhere) Nc6 with idea of playing e5.</p>
  
  <pre><code>[fen ""]
  
  1.e4 e6 2.d4 d5 3.Nc3 Bb4 4.a3 Bxc3+ 5.bxc3 dxe4 6.Qg4 Nf6 7.Qxg7 Rg8 8.Qh6 Rg6 9.Qd2 Nc6
  </code></pre>
  
  <p>Based on this I think the plan 1. Nf3 Qxg2 2. Rg1 Qh3 3. Rg3 Qd7 4. e4 looks strong.</p>
  
  <pre><code>[fen "r1b1kbnr/2p2ppp/p1p5/3pP1q1/8/2N1P3/PPP2PPP/R1BQK1NR w KQkq - 0 1"]
  
  1.Nf3 Qxg2 2.Rg1 Qh3 3.Rg3 Qd7 4.e4
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-30T13:41:54.960Z
Answers.LastActivityDate: 2013-09-07T00:33:13.060Z
Answers.LastEditDate: 2013-09-07T00:33:13.060Z
Answers.UserDisplayName: WorruB
Answers.Body: <p>IMO the best continuation is <code>Nf3</code>. Black is mostly forced to take the pawn on <code>g2</code>. After <code>Rg1</code>, white can play <code>e4</code> with fairly good advantage.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-30T08:05:43.963Z
Answers.LastActivityDate: 2013-07-30T08:05:43.963Z
Answers.UserDisplayName: Nishanth
Answers.Body: <p>You have to defend the pawn on g2, so you should move the queen d1- f3. The best response for the blacks will be queen g5-e5 or bishop c8-g4. If the white moves their pawns they will weaken their structure. They have to make the rocada as fast as possible. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-30T08:22:21.847Z
Answers.LastActivityDate: 2013-07-30T08:22:21.847Z
Answers.UserDisplayName: speedyGonzales
Answers.Body: <p>I will try to give you a simple mathematical answer.  It is clearly oversimplified, but might be a way to think that helps you program your engine.</p>
  
  <p>Assuming that your chess engine can calculate simple forced moves and the value of pawns it should find that White now must choose between defending the e5 pawn or the g2 pawn.  What if we could simply count the number of squares attacked (including squares occupied by other pawns or pieces, even your own)?</p>
  
  <p><strong>Defending the e5 pawn:</strong>  One variation is 1. Nf3 Qxg2 2.Rg1 Qh3.  Black attacks 54 squares, while White attacks 54 squares.</p>
  
  <p><strong>Defending the g2 pawn:</strong>  1. Qf3 Qxe5.  Black attacks 57 squares, while White attacks 50 squares.</p>
  
  <p>Defending the e5 pawn puts White on as many attacked squares as White, while when defending the g2 pawn White is 7 squares down.</p>
  
  <p>Of course, in the variation defending the e5 pawn playing 3. e4 is strong for White as it opens up for the bishop on c1.  Just count the number of squares.</p>
  
  <p><strong>I repeat</strong>, this is very simplified, but in general the more active you are (the more squares your pawns and pieces attack), the better off you are all other things being equal.  <strong>This is one way used by programmers to give a mathematical value to how active a position is.</strong></p>
  
  <p>(I might have counted a wrong, but not by much - it shows the general idea)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-30T18:56:42.943Z
Answers.LastActivityDate: 2013-07-30T18:56:42.943Z
Answers.UserDisplayName: Halvard
Body: <p>I'm building a chess engine and trying to figure out how good are the moves generated. Can you tell what is the best move for white in following position and why? Thanks.</p>
  
  <pre><code>[fen "r1b1kbnr/2p2ppp/p1p5/3pP1q1/8/2N1P3/PPP2PPP/R1BQK1NR w KQkq - 0 1"]
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-07-30T19:49:59.300Z
Comments.Text: If you are building an engine of your own, you will want to download other engines to help answer questions like this, since you will have hundreds more of them. Two very good free engines are Stockfish and Houdini 1.5.
Comments.UserDisplayName: dfan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-07-31T02:33:26.660Z
Comments.Text: Stockfish says 1. Nf3 Qxg2 2. Rg1 Qh3 3. e4 dxe4 4. Nxe4
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-07-31T08:34:06.107Z
Comments.Text: @dfan that's a good point. I tried Stockfish last time but couldn't get it working. Is there any tutorial? Can you make it run with Winboard?
Comments.UserDisplayName: bytefire
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-07-31T08:35:56.523Z
Comments.Text: @dfan An engine can help answer what the best move is, but not why.
Comments.UserDisplayName: Halvard
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-09-07T18:39:06.643Z
Comments.Text: @bytefire `I tried Stockfish last time but couldn't get it working. Is there any tutorial` did you check the `UCL`? i had similar issues running houdini, was solved by checking that, by default it's not checked
Comments.UserDisplayName: Lynob
Tags: <analysis><puzzles>
Title: Best White Move
ThreadText: # Best White Move
  
  (Asked by: username_0 on 2013-07-30)
  
  I'm building a chess engine and trying to figure out how good are the moves generated. Can you tell what is the best move for white in following position and why? Thanks.
  
  ```
  [fen "r1b1kbnr/2p2ppp/p1p5/3pP1q1/8/2N1P3/PPP2PPP/R1BQK1NR w KQkq - 0 1"]
  
  ```
  
  **Tags:** analysis, puzzles
  
  > **Comments:**
  > **username_1**: If you are building an engine of your own, you will want to download other engines to help answer questions like this, since you will have hundreds more of them. Two very good free engines are Stockfish and Houdini 1.5.  
  > **username_2**: Stockfish says 1. Nf3 Qxg2 2. Rg1 Qh3 3. e4 dxe4 4. Nxe4  
  > **username_0**: @username_1 that's a good point. I tried Stockfish last time but couldn't get it working. Is there any tutorial? Can you make it run with Winboard?  
  > **username_3**: @username_1 An engine can help answer what the best move is, but not why.  
  > **username_4**: @username_0 `I tried Stockfish last time but couldn't get it working. Is there any tutorial` did you check the `UCL`? i had similar issues running houdini, was solved by checking that, by default it's not checked  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_5 on 2013-07-30. Score: 5 | Accepted answer
  
  This is kind of similar to the line (with colors reversed) 1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. a3 Bxc3+ 5. bxc3 dxe4 6. Qg4
  
  It's basically an identical position with colors reversed except white's knight is already on c3 which is actually a really good square for the knight. In fact I believe the main line of the line listed above is 6.. Nf6 7. Qg7 Rg8 8. Qh6 Rg6 9. (Queen somewhere) Nc6 with idea of playing e5.
  
  ```
  [fen ""]
  
  1.e4 e6 2.d4 d5 3.Nc3 Bb4 4.a3 Bxc3+ 5.bxc3 dxe4 6.Qg4 Nf6 7.Qxg7 Rg8 8.Qh6 Rg6 9.Qd2 Nc6
  
  ```
  
  Based on this I think the plan 1. Nf3 Qxg2 2. Rg1 Qh3 3. Rg3 Qd7 4. e4 looks strong.
  
  ```
  [fen "r1b1kbnr/2p2ppp/p1p5/3pP1q1/8/2N1P3/PPP2PPP/R1BQK1NR w KQkq - 0 1"]
  
  1.Nf3 Qxg2 2.Rg1 Qh3 3.Rg3 Qd7 4.e4
  
  ```
  
  
  ---
  
  ### Answer by username_6 on 2013-07-30. Score: 3
  
  IMO the best continuation is `Nf3`. Black is mostly forced to take the pawn on `g2`. After `Rg1`, white can play `e4` with fairly good advantage.
  
  
  ---
  
  ### Answer by username_7 on 2013-07-30. Score: 3
  
  You have to defend the pawn on g2, so you should move the queen d1- f3. The best response for the blacks will be queen g5-e5 or bishop c8-g4. If the white moves their pawns they will weaken their structure. They have to make the rocada as fast as possible.
  
  
  ---
  
  ### Answer by username_3 on 2013-07-30. Score: 2
  
  I will try to give you a simple mathematical answer. It is clearly oversimplified, but might be a way to think that helps you program your engine.
  
  Assuming that your chess engine can calculate simple forced moves and the value of pawns it should find that White now must choose between defending the e5 pawn or the g2 pawn. What if we could simply count the number of squares attacked (including squares occupied by other pawns or pieces, even your own)?
  
  **Defending the e5 pawn:** One variation is 1. Nf3 Qxg2 2.Rg1 Qh3. Black attacks 54 squares, while White attacks 54 squares.
  
  **Defending the g2 pawn:** 1. Qf3 Qxe5. Black attacks 57 squares, while White attacks 50 squares.
  
  Defending the e5 pawn puts White on as many attacked squares as White, while when defending the g2 pawn White is 7 squares down.
  
  Of course, in the variation defending the e5 pawn playing 3. e4 is strong for White as it opens up for the bishop on c1. Just count the number of squares.
  
  **I repeat**, this is very simplified, but in general the more active you are (the more squares your pawns and pieces attack), the better off you are all other things being equal. **This is one way used by programmers to give a mathematical value to how active a position is.**
  
  (I might have counted a wrong, but not by much - it shows the general idea)
  
  
  ---
  
  