dist clauses from scratch: a fair coin, and a loaded diedist has two weight operators, and they differ once an entry is a range:
value := weight -- that value gets this weight. [lo:hi] := weight -- every value in the range gets this weight each, so a wider range gets more of the total. [lo:hi] :/ weight -- the range gets this weight in total, split evenly across its values.
Fix the class below.
Requirements
coin is a fair coin: 0 and 1 come up about equally often.roll is a loaded die, always 1 to 6. It lands on 6 about half the time; the other half is spread evenly over 1 to 5, so each of those comes up about a tenth of the time.One working answer: brokenbench's own fix for this exercise. Try a few runs first.
What changes, against the code you started with:
docker run --pull always --rm -p 127.0.0.1:8787:8787 ghcr.io/adibis/brokenbench-runnerLooking for a runner on this computer…
The first start downloads about 250 MB; after that it starts in seconds and only downloads again when there's an update. Your code goes to the runner on your computer, not to chipdv.io.