Wrote the rest of the code anywah, because it is fun.

Also included a reasonable use of 'goto':
Generating a sample has a (rare) case of failing. In that case you just want to try again,
but most of the time a return happens somewhere in the middle.

Having some kind of while(true) surrounding this feels unpleasant. Now it is very clear
there is a "try again" path.

The C# source does everything with doubles, where I just want integers, so I still have to fix that.