blokhead,
I disagree with your strategy based on my limited knowledge of the game hangman. It is my understanding that the game continues until you have either revealed the word or made too many incorrect guesses. I think the best strategy then would be to guess the letter that appears in the most of the candidate words. I too haven't looked at the OP's code but my strategy doesn't necessarily pick the most popular letter but the one that appears in the most words. If you are correct you get new information (position of that letter) and are no closer to losing the game. If you are wrong, you eliminate the most possible wrong answers. I will code this strategy up to see how it does in a follow on post.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|