-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dice.py
47 lines (42 loc) · 876 Bytes
/
Dice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 27 14:28:59 2018
@author: prakhar
"""
import matplotlib.pyplot as plt
import numpy as np
import random as rd
def Dice():
x=int(rd.random()*6+1)
if x==6:
x+=int(rd.random()*6+1)
if x==12:
x+=int(rd.random()*6+1)
if x==18:
return 0
return x
'''
Some other things I might add later:
'''
#series=[]
#n=100
#
#for j in range(n):
# player1=0
# player2=0
#
# for i in range(216):
# player1+=(Dice())
# player2+=(Dice())
#
# if(player1>=100):
# #print("Player1 Wins!")
# series.append(0)
# break
# elif(player2>=100):
# #print("Player2 Wins!")
# series.append(1)
# break
#
#print(series)
#print(int(100*sum(series)/n),"vs",int(100*(1-sum(series)/n)))