+1
-1
silversuite.fen
+1
-1
silversuite.fen
+6
-2
src/starfish_testing.gleam
+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