Created
February 12, 2017 13:05
-
-
Save AiHiro/f57086420c9124fb85303a74343314b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
numbers = [num if num < 10 else 10 for num in np.linspace(1,13,13)] | |
cards = numbers*4 | |
print("distributeed card are...") | |
first,second = int(input()),int(input()) | |
print("Dealer's card is...") | |
DealerFirst = int(input()) | |
def removeCards(you,dealer): | |
for card in you: | |
cards.remove(card) | |
for card in dealer: | |
cards.remove(card) | |
return True | |
You = [first, second] | |
Dealer = [DealerFirst] | |
removeCards(You,Dealer) | |
nowCards = cards | |
totalOfYourScore = np.sum(You) | |
print(totalOfYourScore) | |
probabilities = [] | |
for val in numbers: | |
num = cards.count(val) | |
probabilities.append(num/np.size(cards)) | |
if val== 10: | |
break | |
print(probabilities) | |
x = np.linspace(1,np.size(probabilities),np.size(probabilities)) | |
y = probabilities | |
plt.plot(x,y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment