Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mastermind
#1
Im taking a basic python course in university and my class project is creating something like mastermind.

We have to create a program that guesses the 4-digit number you're thinking (digits from 1 to 6) in 9 tries or less. The only questions I can ask are: 'how many numbers are correct in the correct position?' and 'how many numbers are correct in the incorrect position?'.

Right now I have a program that loops 9 times through the 2 questions after guessing a number and stores the number and answers in a list. My problem is that my guesses are simply random numbers that do not take into account previous answers. I'd appreciate any tips on how to improve the guessed number every time. I can do it manually but I just can't figure out how to put it in Python.
Reply


Messages In This Thread
Mastermind - by Davidlit95 - Oct-12-2017, 01:30 PM
RE: Mastermind - by ichabod801 - Oct-12-2017, 03:03 PM
RE: Mastermind - by Davidlit95 - Oct-16-2017, 10:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help (mastermind game) sseansssean 2 2,920 Jul-06-2020, 12:47 PM
Last Post: deanhystad
  Mastermind game Staren 6 4,762 Feb-03-2018, 03:12 PM
Last Post: Staren

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020