@pkmn/engine 0.1.0-dev.1cea12bf → 0.1.0-dev.1d311928
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/build/pkg/addon/browser.d.ts +1 -1
- package/build/pkg/addon/browser.js +2 -1
- package/build/pkg/addon/browser.js.map +1 -1
- package/build/pkg/addon/node.js +2 -1
- package/build/pkg/addon/node.js.map +1 -1
- package/build/pkg/addon/wasm.d.ts +2 -0
- package/build/pkg/addon/wasm.js +53 -0
- package/build/pkg/addon/wasm.js.map +1 -0
- package/build/pkg/addon.d.ts +23 -3
- package/build/pkg/addon.js +8 -17
- package/build/pkg/addon.js.map +1 -1
- package/build/pkg/data/layout.json +15 -2
- package/build/pkg/data/protocol.json +23 -9
- package/build/pkg/gen1.d.ts +13 -17
- package/build/pkg/gen1.js +6 -10
- package/build/pkg/gen1.js.map +1 -1
- package/build/pkg/index.d.ts +35 -100
- package/build/pkg/index.js +6 -68
- package/build/pkg/index.js.map +1 -1
- package/build/tools/debug.js +2 -3
- package/build/tools/debug.js.map +1 -1
- package/build/tools/display/debug.jsx +21 -8
- package/build/tools/display/debug.jsx.map +1 -1
- package/build/tools/display/index.js +18 -8
- package/build/tools/display/index.js.map +1 -1
- package/build/tools/display/ui.jsx +7 -7
- package/build/tools/display/ui.jsx.map +1 -1
- package/build/tools/display/util.js +1 -1
- package/build/tools/display/util.js.map +1 -1
- package/build.zig +114 -68
- package/package.json +26 -121
- package/src/bin/install-pkmn-engine +2 -2
- package/src/lib/bindings/node.zig +121 -0
- package/src/lib/bindings/wasm.zig +52 -0
- package/src/lib/common/debug.zig +39 -8
- package/src/lib/common/options.zig +4 -0
- package/src/lib/common/protocol.zig +4 -8
- package/src/lib/common/rational.zig +7 -5
- package/src/lib/common/rng.zig +1 -3
- package/src/lib/gen1/calc.zig +200 -51
- package/src/lib/gen1/chance.zig +40 -22
- package/src/lib/gen1/data/moves.zig +2 -4
- package/src/lib/gen1/data/species.zig +1 -3
- package/src/lib/gen1/data/types.zig +1 -2
- package/src/lib/gen1/data.zig +7 -11
- package/src/lib/gen1/helpers.zig +5 -18
- package/src/lib/gen1/mechanics.zig +107 -79
- package/src/lib/gen2/calc.zig +9 -17
- package/src/lib/gen2/data/items.zig +1 -3
- package/src/lib/gen2/data/moves.zig +2 -4
- package/src/lib/gen2/data/species.zig +1 -3
- package/src/lib/gen2/data/types.zig +1 -2
- package/src/lib/gen2/data.zig +11 -15
- package/src/lib/gen2/generated.zig +18 -23
- package/src/lib/gen2/helpers.zig +5 -12
- package/src/lib/gen2/mechanics.zig +41 -38
- package/src/lib/node.zig +3 -116
- package/src/lib/pkmn.zig +7 -2
- package/src/lib/wasm.zig +18 -9
- package/src/tools/display/ui.css +12 -9
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const js = @import("../common/js.zig");
|
|
2
|
+
const pkmn = @import("../pkmn.zig");
|
|
3
|
+
const std = @import("std");
|
|
4
|
+
|
|
5
|
+
const assert = std.debug.assert;
|
|
6
|
+
|
|
7
|
+
const c = @cImport({
|
|
8
|
+
@cDefine("NAPI_VERSION", "8");
|
|
9
|
+
@cInclude("node_api.h");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
pub fn register(env: c.napi_env) c.napi_value {
|
|
13
|
+
const object = js.Object.init(env);
|
|
14
|
+
const properties = [_]c.napi_property_descriptor{
|
|
15
|
+
js.Property.init("options", .{ .value = options(env) }),
|
|
16
|
+
js.Property.init("bindings", .{ .value = bindings(env) }),
|
|
17
|
+
};
|
|
18
|
+
assert(c.napi_define_properties(env, object, properties.len, &properties) == c.napi_ok);
|
|
19
|
+
return object;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
fn options(env: c.napi_env) c.napi_value {
|
|
23
|
+
const object = js.Object.init(env);
|
|
24
|
+
const properties = [_]c.napi_property_descriptor{
|
|
25
|
+
js.Property.init("showdown", .{ .value = js.Boolean.init(env, pkmn.options.showdown) }),
|
|
26
|
+
js.Property.init("log", .{ .value = js.Boolean.init(env, pkmn.options.log) }),
|
|
27
|
+
js.Property.init("chance", .{ .value = js.Boolean.init(env, pkmn.options.chance) }),
|
|
28
|
+
js.Property.init("calc", .{ .value = js.Boolean.init(env, pkmn.options.calc) }),
|
|
29
|
+
};
|
|
30
|
+
assert(c.napi_define_properties(env, object, properties.len, &properties) == c.napi_ok);
|
|
31
|
+
return object;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fn bindings(env: c.napi_env) c.napi_value {
|
|
35
|
+
const array = js.Array.init(env, .{ .length = 1 });
|
|
36
|
+
js.Array.set(env, array, 0, bind(env, pkmn.gen1));
|
|
37
|
+
return array;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
fn bind(env: c.napi_env, gen: anytype) c.napi_value {
|
|
41
|
+
const choices_size: u32 = @intCast(gen.CHOICES_SIZE);
|
|
42
|
+
const logs_size: u32 = @intCast(gen.LOGS_SIZE);
|
|
43
|
+
const object = js.Object.init(env);
|
|
44
|
+
const properties = [_]c.napi_property_descriptor{
|
|
45
|
+
js.Property.init("CHOICES_SIZE", .{ .value = js.Number.init(env, choices_size) }),
|
|
46
|
+
js.Property.init("LOGS_SIZE", .{ .value = js.Number.init(env, logs_size) }),
|
|
47
|
+
js.Property.init("update", .{ .method = update(gen) }),
|
|
48
|
+
js.Property.init("choices", .{ .method = choices(gen) }),
|
|
49
|
+
};
|
|
50
|
+
assert(c.napi_define_properties(env, object, properties.len, &properties) == c.napi_ok);
|
|
51
|
+
return object;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fn update(gen: anytype) c.napi_callback {
|
|
55
|
+
return struct {
|
|
56
|
+
fn call(env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_value {
|
|
57
|
+
var argc: usize = 4;
|
|
58
|
+
var argv: [4]c.napi_value = undefined;
|
|
59
|
+
assert(c.napi_get_cb_info(env, info, &argc, &argv, null, null) == c.napi_ok);
|
|
60
|
+
assert(argc == 4);
|
|
61
|
+
|
|
62
|
+
var data: ?*anyopaque = undefined;
|
|
63
|
+
var len: usize = 0;
|
|
64
|
+
assert(c.napi_get_arraybuffer_info(env, argv[0], &data, &len) == c.napi_ok);
|
|
65
|
+
assert(len == @sizeOf(gen.Battle(gen.PRNG)));
|
|
66
|
+
|
|
67
|
+
var battle: *gen.Battle(gen.PRNG) = @alignCast(@ptrCast(data.?));
|
|
68
|
+
const c1: pkmn.Choice = @bitCast(js.Number.get(env, argv[1], u8));
|
|
69
|
+
const c2: pkmn.Choice = @bitCast(js.Number.get(env, argv[2], u8));
|
|
70
|
+
|
|
71
|
+
var vtype: c.napi_valuetype = undefined;
|
|
72
|
+
assert(c.napi_typeof(env, argv[3], &vtype) == c.napi_ok);
|
|
73
|
+
const result = switch (vtype) {
|
|
74
|
+
c.napi_undefined, c.napi_null => battle.update(c1, c2, &gen.NULL),
|
|
75
|
+
else => result: {
|
|
76
|
+
assert(c.napi_get_arraybuffer_info(env, argv[3], &data, &len) == c.napi_ok);
|
|
77
|
+
assert(len == gen.LOGS_SIZE);
|
|
78
|
+
|
|
79
|
+
const buf = @as([*]u8, @ptrCast(data.?))[0..gen.LOGS_SIZE];
|
|
80
|
+
var stream: pkmn.protocol.ByteStream = .{ .buffer = buf };
|
|
81
|
+
// TODO: extract out
|
|
82
|
+
var opts = pkmn.battle.options(
|
|
83
|
+
pkmn.protocol.FixedLog{ .writer = stream.writer() },
|
|
84
|
+
gen.chance.NULL,
|
|
85
|
+
gen.calc.NULL,
|
|
86
|
+
);
|
|
87
|
+
break :result battle.update(c1, c2, &opts);
|
|
88
|
+
},
|
|
89
|
+
} catch unreachable;
|
|
90
|
+
|
|
91
|
+
return js.Number.init(env, @as(u8, @bitCast(result)));
|
|
92
|
+
}
|
|
93
|
+
}.call;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fn choices(gen: anytype) c.napi_callback {
|
|
97
|
+
return struct {
|
|
98
|
+
fn call(env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_value {
|
|
99
|
+
var argc: usize = 4;
|
|
100
|
+
var argv: [4]c.napi_value = undefined;
|
|
101
|
+
assert(c.napi_get_cb_info(env, info, &argc, &argv, null, null) == c.napi_ok);
|
|
102
|
+
assert(argc == 4);
|
|
103
|
+
|
|
104
|
+
var data: ?*anyopaque = undefined;
|
|
105
|
+
var len: usize = 0;
|
|
106
|
+
assert(c.napi_get_arraybuffer_info(env, argv[0], &data, &len) == c.napi_ok);
|
|
107
|
+
assert(len == @sizeOf(gen.Battle(gen.PRNG)));
|
|
108
|
+
|
|
109
|
+
var battle: *gen.Battle(gen.PRNG) = @alignCast(@ptrCast(data.?));
|
|
110
|
+
const player: pkmn.Player = @enumFromInt(js.Number.get(env, argv[1], u8));
|
|
111
|
+
const request: pkmn.Choice.Type = @enumFromInt(js.Number.get(env, argv[2], u8));
|
|
112
|
+
|
|
113
|
+
assert(c.napi_get_arraybuffer_info(env, argv[3], &data, &len) == c.napi_ok);
|
|
114
|
+
assert(len == gen.CHOICES_SIZE);
|
|
115
|
+
|
|
116
|
+
const out = @as([*]pkmn.Choice, @ptrCast(data.?))[0..gen.CHOICES_SIZE];
|
|
117
|
+
const n = battle.choices(player, request, out);
|
|
118
|
+
return js.Number.init(env, @as(u8, @bitCast(n)));
|
|
119
|
+
}
|
|
120
|
+
}.call;
|
|
121
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const pkmn = @import("../pkmn.zig");
|
|
2
|
+
const std = @import("std");
|
|
3
|
+
|
|
4
|
+
const assert = std.debug.assert;
|
|
5
|
+
|
|
6
|
+
const Enum = if (@hasField(std.builtin.Type, "enum")) .@"enum" else .Enum;
|
|
7
|
+
|
|
8
|
+
pub const options = pkmn.options;
|
|
9
|
+
|
|
10
|
+
pub fn gen(comptime num: comptime_int) type {
|
|
11
|
+
const g = @field(pkmn, "gen" ++ std.fmt.comptimePrint("{d}", .{num}));
|
|
12
|
+
return struct {
|
|
13
|
+
pub const CHOICES_SIZE = size(g.CHOICES_SIZE);
|
|
14
|
+
pub const LOGS_SIZE = size(g.LOGS_SIZE);
|
|
15
|
+
|
|
16
|
+
pub fn update(
|
|
17
|
+
battle: *g.Battle(g.PRNG),
|
|
18
|
+
c1: pkmn.Choice,
|
|
19
|
+
c2: pkmn.Choice,
|
|
20
|
+
options_: ?[*]u8,
|
|
21
|
+
) callconv(.C) pkmn.Result {
|
|
22
|
+
return (if (options_) |o| result: {
|
|
23
|
+
const buf = @as([*]u8, @ptrCast(o))[0..g.LOGS_SIZE];
|
|
24
|
+
var stream: pkmn.protocol.ByteStream = .{ .buffer = buf };
|
|
25
|
+
// TODO: extract out
|
|
26
|
+
var opts = pkmn.battle.options(
|
|
27
|
+
pkmn.protocol.FixedLog{ .writer = stream.writer() },
|
|
28
|
+
g.chance.NULL,
|
|
29
|
+
g.calc.NULL,
|
|
30
|
+
);
|
|
31
|
+
break :result battle.update(c1, c2, &opts);
|
|
32
|
+
} else battle.update(c1, c2, &g.NULL)) catch unreachable;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
pub fn choices(
|
|
36
|
+
battle: *g.Battle(g.PRNG),
|
|
37
|
+
player: u8,
|
|
38
|
+
request: u8,
|
|
39
|
+
buf: [*]u8,
|
|
40
|
+
) callconv(.C) u8 {
|
|
41
|
+
assert(player <= @field(@typeInfo(pkmn.Player), @tagName(Enum)).fields.len);
|
|
42
|
+
assert(request <= @field(@typeInfo(pkmn.Choice.Type), @tagName(Enum)).fields.len);
|
|
43
|
+
|
|
44
|
+
const n = CHOICES_SIZE;
|
|
45
|
+
return battle.choices(@enumFromInt(player), @enumFromInt(request), @ptrCast(buf[0..n]));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
fn size(n: usize) u32 {
|
|
51
|
+
return std.math.ceilPowerOfTwo(u32, @as(u32, @intCast(n))) catch unreachable;
|
|
52
|
+
}
|
package/src/lib/common/debug.zig
CHANGED
|
@@ -3,9 +3,19 @@ const std = @import("std");
|
|
|
3
3
|
const debug = std.debug;
|
|
4
4
|
const io = std.io;
|
|
5
5
|
|
|
6
|
+
const Array = if (@hasField(std.builtin.Type, "array")) .array else .Array;
|
|
7
|
+
const Enum = if (@hasField(std.builtin.Type, "enum")) .@"enum" else .Enum;
|
|
8
|
+
const Optional = if (@hasField(std.builtin.Type, "optional")) .optional else .Optional;
|
|
9
|
+
const Pointer = if (@hasField(std.builtin.Type, "pointer")) .pointer else .Pointer;
|
|
10
|
+
const Struct = if (@hasField(std.builtin.Type, "struct")) .@"struct" else .Struct;
|
|
11
|
+
const Union = if (@hasField(std.builtin.Type, "union")) .@"union" else .Union;
|
|
12
|
+
|
|
6
13
|
pub fn print(value: anytype) void {
|
|
7
|
-
debug.lockStdErr();
|
|
8
|
-
defer debug
|
|
14
|
+
if (@hasDecl(debug, "lockStdErr")) debug.lockStdErr() else debug.getStderrMutex().lock();
|
|
15
|
+
defer if (@hasDecl(debug, "unlockStdErr"))
|
|
16
|
+
debug.unlockStdErr()
|
|
17
|
+
else
|
|
18
|
+
debug.getStderrMutex().unlock();
|
|
9
19
|
const stderr = io.getStdErr().writer();
|
|
10
20
|
|
|
11
21
|
nosuspend {
|
|
@@ -19,7 +29,7 @@ pub fn print(value: anytype) void {
|
|
|
19
29
|
}) catch return;
|
|
20
30
|
} else {
|
|
21
31
|
switch (@typeInfo(@TypeOf(value))) {
|
|
22
|
-
|
|
32
|
+
Struct => |info| {
|
|
23
33
|
if (info.is_tuple) {
|
|
24
34
|
inline for (info.fields, 0..) |f, i| {
|
|
25
35
|
inspect(@field(value, f.name));
|
|
@@ -42,17 +52,17 @@ fn inspect(value: anytype) void {
|
|
|
42
52
|
nosuspend {
|
|
43
53
|
const err = "Unable to format type '" ++ @typeName(@TypeOf(value)) ++ "'";
|
|
44
54
|
switch (@typeInfo(@TypeOf(value))) {
|
|
45
|
-
|
|
55
|
+
Array => |info| {
|
|
46
56
|
if (info.child == u8) return stderr.print("{s}", .{value}) catch return;
|
|
47
57
|
@compileError(err);
|
|
48
58
|
},
|
|
49
|
-
|
|
59
|
+
Pointer => |ptr_info| switch (ptr_info.size) {
|
|
50
60
|
.One => switch (@typeInfo(ptr_info.child)) {
|
|
51
|
-
|
|
61
|
+
Array => |info| {
|
|
52
62
|
if (info.child == u8) return stderr.print("{s}", .{value}) catch return;
|
|
53
63
|
@compileError(err);
|
|
54
64
|
},
|
|
55
|
-
|
|
65
|
+
Enum, Union, Struct => return inspect(value.*),
|
|
56
66
|
else => @compileError(err),
|
|
57
67
|
},
|
|
58
68
|
.Many, .C => {
|
|
@@ -67,8 +77,29 @@ fn inspect(value: anytype) void {
|
|
|
67
77
|
@compileError(err);
|
|
68
78
|
},
|
|
69
79
|
},
|
|
70
|
-
|
|
80
|
+
Optional => stderr.print("{?}", .{value}) catch return,
|
|
71
81
|
else => stderr.print("{}", .{value}) catch return,
|
|
72
82
|
}
|
|
73
83
|
}
|
|
74
84
|
}
|
|
85
|
+
|
|
86
|
+
const showdown = @import("./options.zig").showdown;
|
|
87
|
+
const Result = @import("./data.zig").Result;
|
|
88
|
+
const Choice = @import("./data.zig").Choice;
|
|
89
|
+
|
|
90
|
+
pub fn dump(gen: u8, battle: anytype, frame: ?struct { Result, Choice, Choice }) void {
|
|
91
|
+
const file = std.fs.cwd().createFile("logs/dump.bin", .{}) catch return;
|
|
92
|
+
defer file.close();
|
|
93
|
+
var w = file.writer();
|
|
94
|
+
w.writeByte(@intFromBool(showdown)) catch return;
|
|
95
|
+
w.writeByte(gen) catch return;
|
|
96
|
+
w.writeInt(i16, 0, .little) catch return;
|
|
97
|
+
w.writeInt(i32, 0, .little) catch return;
|
|
98
|
+
w.writeStruct(battle) catch return;
|
|
99
|
+
w.writeStruct(battle) catch return;
|
|
100
|
+
if (frame) |f| {
|
|
101
|
+
w.writeStruct(f[0]) catch return;
|
|
102
|
+
w.writeStruct(f[1]) catch return;
|
|
103
|
+
w.writeStruct(f[2]) catch return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -7,10 +7,12 @@ pub const Options = struct {
|
|
|
7
7
|
log: ?bool = null,
|
|
8
8
|
chance: ?bool = null,
|
|
9
9
|
calc: ?bool = null,
|
|
10
|
+
mod: ?bool = null,
|
|
10
11
|
advance: ?bool = null,
|
|
11
12
|
ebc: ?bool = null,
|
|
12
13
|
key: ?bool = null,
|
|
13
14
|
miss: ?bool = null,
|
|
15
|
+
overwrite: ?bool = null,
|
|
14
16
|
internal: ?bool = null,
|
|
15
17
|
};
|
|
16
18
|
|
|
@@ -23,10 +25,12 @@ pub const chance = get("chance", false);
|
|
|
23
25
|
/// Whether or not damage calculator support is enabled.
|
|
24
26
|
pub const calc = get("calc", false);
|
|
25
27
|
|
|
28
|
+
pub const mod = showdown or get("mod", false);
|
|
26
29
|
pub const advance = get("advance", true);
|
|
27
30
|
pub const ebc = get("ebc", true);
|
|
28
31
|
pub const key = get("key", false);
|
|
29
32
|
pub const miss = get("miss", true);
|
|
33
|
+
pub const overwrite = get("overwrite", true);
|
|
30
34
|
pub const internal = get("internal", false);
|
|
31
35
|
|
|
32
36
|
fn get(comptime name: []const u8, default: bool) bool {
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
const std = @import("std");
|
|
2
1
|
const builtin = @import("builtin");
|
|
3
|
-
|
|
4
|
-
const pkmn = @import("../pkmn.zig");
|
|
5
|
-
|
|
6
2
|
const data = @import("data.zig");
|
|
7
3
|
const options = @import("options.zig");
|
|
4
|
+
const pkmn = @import("../pkmn.zig");
|
|
5
|
+
const std = @import("std");
|
|
8
6
|
|
|
9
7
|
const assert = std.debug.assert;
|
|
10
|
-
const print = std.debug.print;
|
|
11
|
-
|
|
12
8
|
const enabled = options.log;
|
|
13
|
-
|
|
14
|
-
const Player = data.Player;
|
|
15
9
|
const ID = data.ID;
|
|
10
|
+
const Player = data.Player;
|
|
11
|
+
const print = std.debug.print;
|
|
16
12
|
|
|
17
13
|
const endian = builtin.cpu.arch.endian();
|
|
18
14
|
const Endian = std.builtin.Endian;
|
|
@@ -15,7 +15,9 @@ const ComptimeFloat =
|
|
|
15
15
|
|
|
16
16
|
/// Specialization of a rational number used by the engine to compute probabilties.
|
|
17
17
|
/// For performance reasons the rational is only reduced lazily and thus `reduce` must be
|
|
18
|
-
/// invoked explicitly before reading.
|
|
18
|
+
/// invoked explicitly before reading. Note that this laziness means that this implementation
|
|
19
|
+
/// sometimes overflows in places where an eager reduced implementation would not - to achieve
|
|
20
|
+
/// the same behavior as an eager implementation simply call `reduce` after each operation.
|
|
19
21
|
pub fn Rational(comptime T: type) type {
|
|
20
22
|
return extern struct {
|
|
21
23
|
const Self = @This();
|
|
@@ -25,10 +27,10 @@ pub fn Rational(comptime T: type) type {
|
|
|
25
27
|
/// Denominator. Must always be >= 1. Not guaranteed to be reduced in all cases.
|
|
26
28
|
q: T = 1,
|
|
27
29
|
|
|
28
|
-
// With floats we can't rely on an overflow bit to let us know when to reduce, so we
|
|
29
|
-
// start reducing when we get sufficiently close to the limit of the mantissa
|
|
30
|
-
// we expect updates to involve numbers < 2**10, so we should be safe
|
|
31
|
-
// are 2**10 away from "overflowing" the mantissa)
|
|
30
|
+
// With floats we can't rely on an overflow bit to let us know when to reduce, so we
|
|
31
|
+
// instead start reducing when we get sufficiently close to the limit of the mantissa
|
|
32
|
+
// (in our domain we expect updates to involve numbers < 2**10, so we should be safe
|
|
33
|
+
// not reducing before we are 2**10 away from "overflowing" the mantissa)
|
|
32
34
|
const REDUCE = if (@typeInfo(T) == Float)
|
|
33
35
|
std.math.pow(T, 2, std.math.floatMantissaBits(T) - 10)
|
|
34
36
|
else
|
package/src/lib/common/rng.zig
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const std = @import("std");
|
|
2
|
-
|
|
3
1
|
const options = @import("options.zig");
|
|
2
|
+
const std = @import("std");
|
|
4
3
|
|
|
5
4
|
const assert = std.debug.assert;
|
|
6
5
|
const expectEqual = std.testing.expectEqual;
|
|
7
|
-
|
|
8
6
|
const showdown = options.showdown;
|
|
9
7
|
|
|
10
8
|
pub fn PRNG(comptime gen: comptime_int) type {
|