douglasbagnall / p4wn

a smallish turn-of-the-century javascript chess engine
http://p4wn.sf.net
113 stars 33 forks source link

Computer puts itself in checkmate #15

Closed a-type closed 9 years ago

a-type commented 9 years ago

I encountered your engine on math.com and played a computer set to "easiest" level.

At the end of the game, the computer managed to put itself in check by taking a protected piece with its king (computer is white):

  1.  d2-d4 
      d7-d5 
  2.  b1-c3 
      e7-e6 
  3.  e2-e4 
      d5xe4 
  4.  c3xe4 
      g8-f6 
  5.  f2-f3 
      f6xe4 
  6.  f3xe4 
      d8-d6 
  7.  c2-c3 
      b8-c6 
  8.  g1-f3 
      c8-d7 
  9.  e4-e5 
      d6-d5 
 10.  f3-d2 
      c6xe5 
 11.  f1-c4 
      e5xc4 
  --undo--
 11.  c3-c4 
      d5xd4 
 12.  d2-b3 
      d4xd1+
 13.  e1xd1 
      f8-c5 
 14.  b3xc5 
      f7-f5 
 15.  c5xb7 
      e8-g8 
 16.  b7-c5 
      a7-a5 
 17.  c5xd7 
      e5xd7 
 18.  c1-f4 
      c7-c5 
 19.  g2-g3 
      h7-h5 
 20.  f1-g2 
      a8-c8 
 21.  h1-e1 
      g7-g5 
 22.  f4xg5 
      a5-a4 
 23.  e1xe6 
      g8-h7 
 24.  e6-d6 
      d7-b8 
 25.  b2-b3 
      a4xb3 
 26.  a2xb3 
      f8-e8 
 27.  d6-d5 
      f5-f4 
 28.  g5xf4 
      b8-c6 
 29.  d5xc5 
      h5-h4 
 30.  g3xh4 
      e8-f8 
 31.  f4-d6 
      f8-g8 
 32.  g2-e4+
      h7-h8 
 33.  e4-f5 
      c8-e8 
 34.  c5xc6 
      e8-e3 
 35.  b3-b4 
      g8-g1+
 36.  d1-d2 
      g1xa1 
 37.  d2xe3 
      a1-a4 
 38.  c4-c5 
      a4xb4 
 39.  f5-e6 
      b4xh4 
 40.  c6-c8+
      h8-h7 
 41.  c5-c6 
      h7-h6 
 42.  d6-f8+
      h6-g5 
 43.  c6-c7 
      h4xh2 
 44.  c8-e8 
      h2-h4 
 45.  c7-c8 
      g5-g6 
 46.  e6-f5+
      g6-f7 
 47.  e8-e7+
      f7xe7 
 48.  f8xe7 
 checkmate!

Yes I did make an undo in there... I wasn't quite thinking straight on that move.

douglasbagnall commented 9 years ago

thanks Grant,

I believe that this bug was fixed several years ago but http://chess.math.com seems to be using a version from 2002.

So its a WONTFIX.