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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
-
|
|
|
|
|
|
|
|
-
|
|
!
-
|
|
!
|
#module RoundRandomShuffle numRnd, tblRnd, iCount
#modfunc _rsShuffle local r, local tmp
logmes str(numRnd)
repeat numRnd
r = rnd(numRnd)
tmp = tblRnd(cnt)
tblRnd(cnt) = tblRnd(r)
tblRnd(r) = tmp
loop
return
#modinit int p1
if p1 >= 1 {
numRnd = p1
iCount = 0
dim tblRnd, numRnd
repeat numRnd
tblRnd(cnt) = cnt
loop
_rsShuffle thismod
return 0
} else {
logmes "newmodのパラメータが異常です。"
return -1
}
#modfunc _rsRnd local result
result = tblRnd(iCount)
iCount++
if iCount == numRnd {
iCount = 0
_rsShuffle thismod
}
return result
#defcfunc rsRnd var p1
_rsRnd p1
return stat
#modfunc _rsGetNum
return numRnd
#defcfunc rsGetNum var p1
_rsGetNum p1
return stat
#global
newmod v, RoundRandomShuffle, 10
newmod v, RoundRandomShuffle, 5
newmod v, RoundRandomShuffle, 3
onclick goto *ClickAccept
*ClickAccept
redraw 0
color 255, 255, 255 : boxf
color
foreach v
pos cnt * 100, 0
c = cnt
repeat rsGetNum(v(c))
mes rsRnd(v(c))
loop
loop
redraw 1
stop
|