repl.it
@katiewinton/

Mastermind

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
import random

triesLeft = 10

rules = 'There are six colors: orange (O), white (W), purple (P), blue (B), green (G), and yellow (Y). The computer will randomly generate a sequence of four colors. If the pattern were orange, white, purple, blue, the pattern format would be OWPB. There will not be any repeating colors. You will have ten tries to guess the sequence.'

first = random.randint(1, 6)
second = choice([i for i in range(1,6) if i not in first])
?