I made a Mastermind like game
Hi
This is my first code ever so please be kind. I just finished some online tutorial and wanted to test what I remembered from it. Thank you in advance for your time.
#game mastermind
#code breaking game
#X = not in phrase
#O = in phrase and in the right place
#A = in phrase but at the wrong place
import random
print('Mastermind !')
maxnumber=input('Input your maximum number between 4 and 9 (9 being the hardest) : ')
phrase = [random.randint(1,int(maxnumber))]
for x in range(3):
a = random.randint(1,int(maxnumber))
while a in phrase:
a = random.randint(1,int(maxnumber))
phrase.append(a)
playerphrase= 0000
counter = 0
maxcounter=input('How many turns do you want to give yourself (3 is not doable 4 is hard and it gets easier
/r/Python
https://redd.it/k1fmq5
Hi
This is my first code ever so please be kind. I just finished some online tutorial and wanted to test what I remembered from it. Thank you in advance for your time.
#game mastermind
#code breaking game
#X = not in phrase
#O = in phrase and in the right place
#A = in phrase but at the wrong place
import random
print('Mastermind !')
maxnumber=input('Input your maximum number between 4 and 9 (9 being the hardest) : ')
phrase = [random.randint(1,int(maxnumber))]
for x in range(3):
a = random.randint(1,int(maxnumber))
while a in phrase:
a = random.randint(1,int(maxnumber))
phrase.append(a)
playerphrase= 0000
counter = 0
maxcounter=input('How many turns do you want to give yourself (3 is not doable 4 is hard and it gets easier
/r/Python
https://redd.it/k1fmq5
reddit
I made a Mastermind like game
Hi This is my first code ever so please be kind. I just finished some online tutorial and wanted to test what I remembered from it. Thank you in...