calculate
Run Diablo II odds, expected values, rune math, breakpoints, frame counts, and small Monte Carlo simulations from a sandboxed Python subset instead of estimating them.
Instructions
Run numbers instead of estimating them: drop odds over N runs, expected values, rune maths, breakpoints, frame counts, small Monte Carlo sims. code is a tiny Python subset: numbers, strings, lists, dicts, arithmetic, assignments, if/for/while, comprehensions, print(), list/dict/set/string methods, and these functions: abs min max sum round len range int float str sorted enumerate zip any all divmod pow format, sqrt exp log log10 log2 floor ceil comb perm factorial gcd prod fsum pi e inf, mean median stdev, random randint uniform choice choices shuffle sample seed. No imports or files. It ends after 5 s of CPU or 256 MB. The value of the last line is shown, plus anything printed. Example: 'p = 1/2950\nruns = 500\nprint(f"{1-(1-p)**runs:.1%} for at least one")'. Show the result, not the code, unless someone asks how you worked it out; for a sim, say it's a simulation and how many trials.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |