- // Add Peach + mario flags
- return gr.genRandInitFen(seed).slice(0, -17) + '{"flags":"1111"}';
+ const baseFen = gr.genRandInitFen(seed);
+ const fenParts = baseFen.split(" ");
+ let others = JSON.parse(fenParts[3]);
+ delete others["enpassant"];
+ others["flags"] = "1111"; //Peach + Mario flags
+ return fenParts.slice(0, 3).join(" ") + " " + JSON.stringify(others);