Go back to previous page
Forum URL: http://www.cut-the-knot.org/cgi-bin/dcforum/forumctk.cgi
Forum Name: This and that
Topic ID: 139
#0, Mastermind - Maximum number of trials
Posted by José Alberto (Guest) on Aug-05-01 at 05:26 PM
Hi all

Thanks in advance for answering my question.

I'm programming a MasterMind game and I'm stuck on how to assign the maximum number of tries that should be permitted. I read in this web page that, for the 4 balls and 6 colors variant (the normal one), a solution is guaranteed (by an algorithm) in 5 tries or less. My question is:

1) Not everyone knows the algorithm nor can deduce it that fast; which number of maximum tries would be decent to permit?

2) How about the r^n variation, where n is number of balls and r is number of colors? Is there a way to determine a "decent" number of trials permitted?

Thank you so much.

My e-mail: jovera@internet.com.mx

Josè Alberto Bonilla
Mexico DF
Studying:
- Applied mathematics (ITAM)
- Actuarial science (ITAM)


#1, RE: Mastermind - Maximum number of trials
Posted by alexb on Aug-07-01 at 10:23 AM
In response to message #0
>I'm programming a MasterMind game and
>I'm stuck on how to
>assign the maximum number of
>tries that should be permitted.
>I read in this web
>page that, for the 4
>balls and 6 colors variant
>(the normal one), a solution
>is guaranteed (by an algorithm)
>in 5 tries or less.

This is exactly as much as I know.

>My question is:
>
>1) Not everyone knows the algorithm
>nor can deduce it that
>fast; which number of maximum
>tries would be decent to
>permit?

Well, this is a matter of design. You may probably have several difficulty levels with progressivlely fewer guesses alowed.

>2) How about the r^n variation,
>where n is number of
>balls and r is number
>of colors? Is there a
>way to determine a "decent"
>number of trials permitted?

I've no notion. Perhaps you can use a scroll window.