Closed rygh4775 closed 5 years ago
(rand5() + rand5()) % 7
import random
def Rand7():
rand = [[0,1,2,3,4], \
[5,6,0,1,2], \
[3,4,5,6,0], \
[1,2,3,4,5], \
[6,-1,-1,-1,-1]]
ret = rand[Rand5()][Rand5()]
if ret < 0 :
return Rand7()
else :
return ret
def Rand5():
return random.randrange(0,5)
print(Rand7())