← Back to all posts
I need help on how to make my game print more than 1 clue after each user input

I need help on how to make my game print more than 1 clue after each user input Without the cyclomatic complexity going too high

My code:

This Part Is The User Introduction

import time
name = input()
print ("Hello " + name + ", Let's Play Code Breaker!")
print ("The rules of this game are:")
time.sleep(1)
print ("I will choose four random numbers (1-10) in a specific order and you have ten turns to guess the entire number sequence.")
time.sleep(1)
print ("If you guess a sequence and it has a number that is correct but in the wrong order, then I will say WHITE.")
time.sleep(1)
print ("If you have a number that is both correct and in the right order then I will say BLACK.")
time.sleep(1)
print ("If you have a number that is neither correct nor in the right order then I will say RED.")
time.sleep(1)
print ("These clues will not be given in a order. They are completly random.")
print ("You have to use these clues to make an educated guess on what my number sequence is.")
print ("Now, let's play!")
print ("Start Guessing!")

This Part Is For The Set Up Of The Inputs, Other Variables, Loop And Attempt Counter

import random
Num1 = random.randrange (1,11,1)
Num2 = random.randrange (1,11,1)
Num3 = random.randrange (1,11,1)
guesses = 0
while guesses < 10:
guess1 = int(input())
guess2 = int(input())
guess3 = int(input())

This Part Is For The Guesses That Are Right And In Right Order

if guess1 == Num1:
print ("BLACK")
guesses = guesses + 1
continue
if guess2 == Num2:
print ("BLACK")
guesses = guesses + 1
continue
if guess3 == Num3:
print ("BLACK")
guesses = guesses + 1
continue

This Part Is For The Number Guesses That Are Right But In Wrong Order (1st Number)

if guess1 == Num2:
print ("WHITE")
guesses = guesses + 1
continue
if guess1 == Num3:
print ("WHITE")
guesses = guesses + 1
continue

This Part Is For The Number Guesses That Are Right But In Wrong Order (2nd Number)

if guess2 == Num1:
print ("WHITE")
guesses = guesses + 1
continue
if guess2 == Num3:
print ("WHITE")
guesses = guesses + 1
continue

This Part Is For The Number Guesses That Are Right But In Wrong Order (3rd Number)

if guess3 == Num1:
print ("WHITE")
guesses = guesses + 1
continue
if guess3 == Num2:
print ("WHITE")
guesses = guesses + 1
continue

This Part Is For The Number Guesses That Are Neither Right Nor In The Right Position

else:
print ("RED")
guesses = guesses + 1
continue
#This Part Is For The Game Over User Section
while guesses == 10:
print ("Game Over, My Number Sequence Was " + str(Num1), str(Num2), str(Num3) + "!")
break