[eluser]joneslee[/eluser]
Hi all experts
I am learning PHP and CI and now struggle with the algorithm to implement the Lucky Draw Wheel Game. The game consists a wheel with many slices (like Wheel of Fortunes), the wheel will get turned and the player will get the prize written in the slice when the wheel completely stop and arrow point to that slice. There are prizes slices and no-prize slices. The game will randomly pick one result out of the wheel based on the winning probability. Here is an example prizes list:
- Ticket Voucher (Qty: 300 pieces)
- Nintendo DS (Qty: 100 pieces)
- PSP (Qty: 50 pieces)
- Apple MacPro (Qty: 5 pieces)
- SGI Tezro (Qty: 1 piece)
Based on the quantity, the game should give Ticket Voucher higher success rate than other prizes. Can someone suggest me an good approach?
Many thanks,