That's an enhanced for loop. See the tutorial: The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
If you can have the code recognize when it is near the...
Type: Posts; User: Norm
That's an enhanced for loop. See the tutorial: The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
If you can have the code recognize when it is near the...
Why? Can you debug the code to see why it doesn't choose the right value?
If that is the best move, why does the code chose some other move? Debug the code to see why it is not choosing 5.
I don't know the game or AI, I can only make suggestions to help you see what...
If the user plays: 4 3 2 1
where the computer should have played given the user input provided above?
How are you debugging the code? I use println() statements to print out the values of...
Much better. Now could you give a sample of the player's input that could be put into the code to make testing faster and easier? The input can be preloaded into the Scanner's constructor:
...
Some how the code has lost its formatting. Logically nested statements within {} should be indented to make the code readable.
All the statements should NOT start in the first column.