Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Frequency distribution of rolling a certain number on xDy
sides = 6 dice = 8 table = {} for i = 1, sides do table[i] = 1 end for i = 1, dice - 1 do temp_table = {} terms = 1 start = i while start <= sides * i do temp_table[start + terms] = 0 for j = start, math.min(sides * i, start + terms - 1) do temp_table[start + terms] = temp_table[start + terms] + table[j] end if terms < sides then terms = terms + 1 else start = start + 1 end end table = temp_table end for k = dice, dice * sides do print(k, table[k]) end
run
|
edit
|
history
|
help
0
Binary to Integers / Integers to Binary
ok
python like round function in lua
Surface Area of things (Incomplete)
wwww
example for a friend
test
Weight system (Will make a C# one soon too!)
Monty Hall Problem Simulated
Hakusu