RPG attributes generator: Difference between revisions

RPG attributes generator en Run BASIC
(RPG attributes generator en True BASIC)
(RPG attributes generator en Run BASIC)
Line 3,487:
sum: 80
</pre>
 
=={{header|Run BASIC}}==
<lang runbasic>dim statnames$(6)
data "STR", "CON", "DEX", "INT", "WIS", "CHA"
for i = 1 to 6
read statnames$(i)
next i
dim stat(6)
acceptable = false
 
while 1
sum = 0 : n15 = 0
for i = 1 to 6
stat(i) = rollstat()
sum = sum + stat(i)
if stat(i) >= 15 then n15 = n15 + 1
next i
if sum >= 75 and n15 >= 2 then exit while
wend
 
for i = 1 to 6
print statnames$(i); ": "; stat(i)
next i
print "-------"
print "TOT: "; sum
end
 
function d6()
d6 = 1 + int(rnd(1) * 6)
end function
 
function rollstat()
a = d6() : b = d6() : c = d6() : d = d6()
rollstat = a + b + c + d - min(min(a, b), min(c, d))
end function</lang>
 
=={{header|Rust}}==
2,130

edits