1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/sysdata/libraries/stn/src/random.hb

15 lines
399 B
Plaintext
Raw Normal View History

2024-11-23 12:06:48 -06:00
$any := fn($Expr: type): Expr {
2024-10-25 10:37:38 -05:00
return *@eca(3, 4, &@as(Expr, idk), @sizeof(Expr))
2024-09-13 16:41:31 -05:00
}
2024-11-23 12:06:48 -06:00
$range := fn($Expr: type, min: Expr, max: Expr): Expr {
return *@eca(3, 4, &@as(Expr, idk), @sizeof(Expr)) % (max - min) + *@bitcast(&1) + min
2024-11-23 12:06:48 -06:00
}
$fill := fn($Expr: type, ptr: ^Expr): void {
return @eca(3, 4, ptr, @sizeof(Expr))
}
$fill_buffer := fn(buf: ^u8, len: uint): void {
return @eca(3, 4, buf, len)
}