-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRandom.vm
More file actions
executable file
·60 lines (60 loc) · 864 Bytes
/
Random.vm
File metadata and controls
executable file
·60 lines (60 loc) · 864 Bytes
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function Random.setSeed 0
push argument 0
pop static 0
push constant 0
return
function Random.rand 0
push static 0
push constant 20251
add
pop static 0
push static 0
push constant 0
lt
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
push static 0
push constant 32767
sub
push constant 1
sub
pop static 0
label IF_FALSE0
push static 0
return
function Random.randRange 2
push constant 1
pop local 0
label WHILE_EXP0
push local 0
push argument 0
lt
not
if-goto WHILE_END0
push local 0
push constant 2
call Math.multiply 2
push constant 1
add
pop local 0
goto WHILE_EXP0
label WHILE_END0
call Random.rand 0
push local 0
and
pop local 1
label WHILE_EXP1
push local 1
push argument 0
gt
not
if-goto WHILE_END1
call Random.rand 0
push local 0
and
pop local 1
goto WHILE_EXP1
label WHILE_END1
push local 1
return