|
|
你玩家眼里能看到的,
3 ~# M- }% ^, b% J2 {! H+ s3 R不是它生成的原始随机数(32位整数),
}, F/ Y, ]2 e而是处理后的最终结果 —比如:牌点数 1~9、庄/闲结果0 ?# m$ }7 ]( ]
import random5 D" c8 [! `. ]% E0 c# I7 @9 z
random.seed(123456)- h) o0 W% ?# a$ }* s( N
rand_val = random.getrandbits(32) # 4 O3 U- i6 R1 W, y" ]
card = rand_val % 9 + 1 # 9 l5 D d( w4 U! a
|
|