1. Random Module
In python, the function random() can not be directly called. However, we need to import a random module and generate random numbers by calling the static method. By importing this random module, it implements pseudo-random number generators for various distributions.
2. Random Function Details
3. Running Result

4. Ancient Dice Game Introduction
骰宝背景介绍:
骰宝是一种古老的中国骰子游戏,在古代尤为盛行。玩家押注三个在笼子中转动的骰子的旋转结果。您可以同时押注在桌面上的一个或多个数字。游戏的牌桌分割成几部分押注“区域”,每一个区域代表不同类的骰子结果或组合。
游戏开始时 ,放置筹码在桌面上任何地方代表一个或多个骰子组合。下注完成后,装有骰子的笼子将开始旋转, 结果将显示在屏幕的右上方。
游戏股则
「小」三粒骰子平面之点数总和由4点至10点;
「大」三粒骰子平面之点数总和由11点至17点;
「全围」三粒骰子平面由1至6点数相同;
Game rule translation:
In ancient China, it was one of the most popular games in casinos. To start the game, there are three cups covering the dice on the table. The player can gamble for the sum of three rotating dice under the cup. Before the game starts, players guess the sum of the dice.
There are three kinds of results that could be generated:
- 「Small」The sum of three dices are from 4 to 10.
- 「Big」The sum of three dices are from 11 to 17.
- 「Full Circle」Three dices are the same.
5. Dice Game Source Code
6. Dice Game Running Result
