Skip to content

Commit 01517cc

Browse files
committed
test: add anti cheat test components
1 parent efad497 commit 01517cc

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import gleam/dynamic/decode
2+
3+
4+
@ext
5+
pub type Player {
6+
White
7+
Black
8+
}
9+
10+
pub fn player_decoder() {
11+
use player_string <- decode.then(decode.string)
12+
case player_string {
13+
"white" -> decode.success(White)
14+
"black" -> decode.success(Black)
15+
_ -> decode.failure(White, "Invalid player")
16+
}
17+
}
18+
19+
pub fn move(
20+
fen: String,
21+
turn: Player,
22+
failed_moves: List(String),
23+
) -> Result(String, String) {
24+
todo
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name = "javascript_template"
2+
version = "1.0.0"
3+
target = "javascript"
4+
5+
[javascript]
6+
runtime = "deno"
7+
8+
[javascript.deno]
9+
allow_all = true
10+
11+
# Fill out these fields if you intend to generate HTML documentation or publish
12+
# your project to the Hex package manager.
13+
#
14+
# description = ""
15+
# licences = ["Apache-2.0"]
16+
# repository = { type = "github", user = "", repo = "" }
17+
# links = [{ title = "Website", href = "" }]
18+
#
19+
# For a full reference of all the available options, you can have a look at
20+
# https://gleam.run/writing-gleam/gleam-toml/.
21+
22+
[dependencies]
23+
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
24+
glen = ">= 2.2.2 and < 3.0.0"
25+
gleam_javascript = ">= 1.0.0 and < 2.0.0"
26+
gleam_json = ">= 2.3.0 and < 3.0.0"
27+
gleam_http = ">= 3.7.2 and < 4.0.0"
28+
29+
[dev-dependencies]
30+
gleeunit = ">= 1.0.0 and < 2.0.0"

0 commit comments

Comments
 (0)