A tool for testing starfish

Allow comments and newlines in fen file

+1 -1
silversuite.fen
··· 48 rnbq1rk1/pp3ppp/4pn2/2pp4/1bPP4/2NBPN2/PP3PPP/R1BQ1RK1 b - - 1 7 49 r1bq1rk1/pppn1pbp/3p1np1/4p3/2PPP3/2N2NP1/PP3PBP/R1BQ1RK1 b - e3 0 8 50 rnbq1rk1/pp3pbp/2pp1np1/4p3/2PPP3/2N1BP2/PP2N1PP/R2QKB1R w KQ - 0 8 51 - r1bq1rk1/pppnn1bp/3p4/3Pp1p1/2P1Pp2/2N2P2/PP2BBPP/R2QNRK1 w - - 0 13
··· 48 rnbq1rk1/pp3ppp/4pn2/2pp4/1bPP4/2NBPN2/PP3PPP/R1BQ1RK1 b - - 1 7 49 r1bq1rk1/pppn1pbp/3p1np1/4p3/2PPP3/2N2NP1/PP3PBP/R1BQ1RK1 b - e3 0 8 50 rnbq1rk1/pp3pbp/2pp1np1/4p3/2PPP3/2N1BP2/PP2N1PP/R2QKB1R w KQ - 0 8 51 + r1bq1rk1/pppnn1bp/3p4/3Pp1p1/2P1Pp2/2N2P2/PP2BBPP/R2QNRK1 w - - 0 13
+6 -2
src/starfish_testing.gleam
··· 4 import gleam/int 5 import gleam/io 6 import gleam/list 7 - import gleam/result 8 import gleam/string 9 import simplifile as file 10 import starfish ··· 19 let assert Ok(games) = 20 fen_file 21 |> file.read 22 - |> result.map(string.split(_, "\n")) 23 as "Failed to read game file" 24 25 io.println("Loaded games.") 26
··· 4 import gleam/int 5 import gleam/io 6 import gleam/list 7 import gleam/string 8 import simplifile as file 9 import starfish ··· 18 let assert Ok(games) = 19 fen_file 20 |> file.read 21 as "Failed to read game file" 22 + 23 + let games = 24 + games 25 + |> string.split("\n") 26 + // Use `#` for comments in the file 27 + |> list.filter(fn(game) { game != "" && !string.starts_with(game, "#") }) 28 29 io.println("Loaded games.") 30