-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-integers.typ
46 lines (33 loc) · 978 Bytes
/
test-integers.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#set document(date: none)
#import "/src/lib.typ": *
#let print-arr(arr) = {
if type(arr) != array {
[#raw(str(arr) + " ")]
} else {
[#raw(arr.map(it => str(it)).join(" "))]
}
}
#{
let n = 100
let rng = gen-rng(42)
let arr = ()
(rng, arr) = integers(rng, low: 0, high: 100, size: n)
print-arr(arr); parbreak()
rng = gen-rng(42)
for i in range(n) {
(rng, arr) = integers(rng, low: 0, high: 100)
print-arr(arr)
}
parbreak()
(rng, arr) = integers(rng, low: 0, high: 10)
raw(repr(arr)); parbreak()
(rng, arr) = integers(rng, low: 0, high: 10, size: none)
raw(repr(arr)); parbreak()
(rng, arr) = integers(rng, low: 0, high: 10, size: 1)
raw(repr(arr)); parbreak()
(rng, arr) = integers(rng, low: 0, high: 10, size: 0)
raw(repr(arr)); parbreak()
rng = gen-rng(42)
(rng, arr) = integers(rng, low: 0, high: 100, size: n, endpoint: true)
print-arr(arr); parbreak()
}