Tastes good!
Well, I bet on wedge 2 now, so one of us will win.
Actually, if you loose I can give you extra PlayBTC just for playing along.
Remember, if you have more than 10, you have more than you can get other ways. The button to get more only resets to 10 PlayBTC...
I am beginning to understand this now TBH, although I still have a few questions.
1. I see that wedge 2 and 3 are locked until a bet has been put on wedge 1. What if I want to bet on wedge 3 but nobody has bet on wedge 1 yet, then I am forced to bet on wedge 1. Why is it like this?
Ah, yes, this is a design decision I had to make for the cake rendered there to show correct colors for the wedge. Basically so the buttons matches the wedge. And the needle would point to wrong wedge otherwise. Now, I could disable the order of able to bet on wedge, and everything would be calculated correctly. However, the colors wouldn't line up, and the result page would mix it up in different orders. So instead of neat and clean like this:
0-60
60-100
100-200
200-360
for example, it would be like:
100-200
60-100
200-360
0-60
Again, everything would be calculated correctly (I've tested this), but it wouldn't look as great. Besides, it doesn't really matter, unless you really like one particular color more than the other.
Which reminds me that one of the additional features I would add later on would be to be able to select colors yourself (for the wedges).
But I might fix this "design flaw" later, and unlock betting on whatever wedge from start. For now I hope you can live with it.
2.What is the cake value range for?
There needs to be a range so we can decide who wins. But the range is arbitrary. The formula maps to whatever range, so it could be anything really. I just set limit between 0 and 1000 for, in case you have a number in there you like and I have to limit it to something. You can even have a range between 0 and 1, which is kinda funny. I have 0 to 360 as default, because, well, it makes sense for a circle.
The range is then mapped to the wedges depending on the amount of bitcoins compared to the other wedges. This so the more bitcoins than the others, the bigger range, and thus bigger chance of winning.
3. If wedge 1 has 0.2BTC total bet on it, and wedge 2 has 0.4BTC total bet on it, does that mean that wedge 2 has double the chance of winning compared to wedge 1?
That is correct. In that case it would be:
Wedge 1: 33.33%
Wedge 2: 66.67%
This basically means that wedge 2 will have double the range than wedge 1, but no grantee to win.