|
|
你玩家眼里能看到的,$ N/ u' G2 L3 H
不是它生成的原始随机数(32位整数),3 n2 R* F: y" k! o7 o9 \5 O( g4 ?
而是处理后的最终结果 —比如:牌点数 1~9、庄/闲结果
3 g& M! G: W$ r% Bimport random
1 H. l0 \+ n7 Erandom.seed(123456)
* @/ D( ~, ]9 F+ e, orand_val = random.getrandbits(32) #
8 _- Y6 r1 C3 }; `5 i0 L/ ocard = rand_val % 9 + 1 # 7 p6 \6 S0 d" N f# [& W
|
|