{"action":"opened","issue":{"url":"https://api.github.com/repos/jhlywa/chess.js/issues/87","labels_url":"https://api.github.com/repos/jhlywa/chess.js/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/jhlywa/chess.js/issues/87/comments","events_url":"https://api.github.com/repos/jhlywa/chess.js/issues/87/events","html_url":"https://github.com/jhlywa/chess.js/issues/87","id":119018579,"number":87,"title":"Unable to load correct PGN","user":{"login":"yanongena","id":7580533,"avatar_url":"https://avatars.githubusercontent.com/u/7580533?v=3","gravatar_id":"","url":"https://api.github.com/users/yanongena","html_url":"https://github.com/yanongena","followers_url":"https://api.github.com/users/yanongena/followers","following_url":"https://api.github.com/users/yanongena/following{/other_user}","gists_url":"https://api.github.com/users/yanongena/gists{/gist_id}","starred_url":"https://api.github.com/users/yanongena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanongena/subscriptions","organizations_url":"https://api.github.com/users/yanongena/orgs","repos_url":"https://api.github.com/users/yanongena/repos","events_url":"https://api.github.com/users/yanongena/events{/privacy}","received_events_url":"https://api.github.com/users/yanongena/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-26T10:49:04Z","updated_at":"2015-11-26T10:49:04Z","closed_at":null,"body":"It seems that there might be a bug in the load_pgn method. \r\nWhen using following PGN: \r\n\r\n[Event \"Live Chess\"]\r\n[Site \"Chess.com\"]\r\n[Date \"2015.11.10\"]\r\n[White \"Passero82\"]\r\n[Black \"bgknight\"]\r\n[Result \"0-1\"]\r\n[WhiteElo \"1175\"]\r\n[BlackElo \"1255\"]\r\n[TimeControl \"30|0\"]\r\n[Termination \"bgknight won by resignation\"]\r\n\r\n1.e4 e5 2.Nf3 d6 3.d4 Bg4 4.dxe5 Bxf3 5.Qxf3 dxe5 6.Qf5 Nc6 7.Bb5 Nge7 8.Qxe5 Qd7 9.O-O Nxe5 10.Bxd7+ Nxd7\r\n 11.Rd1 O-O-O 12.Nc3 Ng6 13.Be3 a6 14.Ba7 b6 15.Na4 Kb7 16.Bxb6 cxb6 17.b3 b5 18.Nb2 Nge5 19.f3 Rc8 20.Rac1 Ba3\r\n 21.Rb1 Rxc2 22.f4 Ng4 23.Rxd7+ Kc6 24.Rxf7 Bxb2 25.Rxg7 Ne3 26.Rg3 Bd4 27.Kh1 Rxa2 28.Rc1+ Kb6 29.e5 Rf8 30.e6 Rxf4\r\n 31.e7 Re4 32.Rg7 Bxg7 0-1\r\n\r\n\r\nand use:\r\nvar chess = new Chess();\r\nchess.load_pgn(pgn); \r\n\r\nit returns false however applications like Fritz are able to read the PGN properly so I started to investigate and added some additional debug info in the load_pgn method. \r\n\r\nIn this specific PGN, it seems like the algoritm thinks that the move 7... Nge7 is not a valid move. \r\n\r\nIn this code from the load_pgn method:\r\nfor (var half_move = 0; half_move < moves.length - 1; half_move++) {\r\n                move = get_move_obj(moves[half_move]);\r\n\r\n                /* move not possible! (don't clear the board to examine to show the\r\n                 * latest valid position)\r\n                 */\r\n                if (move == null) {\r\n                    console.log(\"Invalid move for \" + half_move + \" \" + moves[half_move]);\r\n                    return false;\r\n                } else {\r\n                    make_move(move);\r\n                }\r\n            }\r\n\r\nmove == null for the half move 13 which is 7... Nge7\r\n\r\nI have another PGN with the exact move:\r\n\r\n[Event \"Live Chess\"]\r\n[Site \"Chess.com\"]\r\n[Date \"2015.11.10\"]\r\n[White \"awhichi\"]\r\n[Black \"Passero82\"]\r\n[Result \"0-1\"]\r\n[WhiteElo \"1103\"]\r\n[BlackElo \"1165\"]\r\n[TimeControl \"30|0\"]\r\n[Termination \"Passero82 won by checkmate\"]\r\n\r\n1.e4 e5 2.d4 exd4 3.Qxd4 Nc6 4.Qe3 d6 5.Bc4 Be6 6.Bb5 Nge7 7.Bxc6+ Nxc6 8.Nc3 Be7 9.Bd2 O-O 10.O-O-O Ne5\r\n 11.Nf3 Nc4 12.Qe2 c5 13.a3 Qb6 14.Bf4 Qxb2# 0-1\r\n\r\nload_pgn also fails to load the PGN here for the same move: Nge7. "}}