I'm not sure what you mean by creating an array with the winning combinations? Couldn't I just use the existing array and check where pieces have been placed on the board?
I came up with a...
Type: Posts; User: eyesackery
I'm not sure what you mean by creating an array with the winning combinations? Couldn't I just use the existing array and check where pieces have been placed on the board?
I came up with a...
After a bit more thought that method won't be much more intelligent than the random generated moves.
Does anyone have any suggestions how I can write the computer AI? At the moment the only option...
Hey Zaphod_b!
Thanks for the in depth and helpful reply! Putting those print statements throughout the code was such a good idea.
Being able to see what data the program was working with...
Here is a nought and crosses game I have been working on today.
Its based on the user playing the computer, where the computers moves are based on a random number generation. However for some...
Recursion on the whole has been difficult to understand, but I have been getting through a few easier problems and gaining understanding.
As far as this problem goes, I'll try to write the code I...
Hey guys, have been struggling with a recursion homework problem. Would be very appreciative if someone could give me a nudge in the right direction, or a hint. :)
The Question (The algorithm has...
import java.util.*; public class H1D4 {public static void main (String[] args) {while (JPL.test()) {
////////////////////////////// PROBLEM STATEMENT //////////////////////////////
// Given an...
Wow, great advice. The physical deck of cards made me visualize the problem a lot better.
This is how I plan to solve this problem.
I will create a loop that calls the rotateLeft(); method...
This is a problem I have been struggling with, think I'm almost there with it just need a nudge in the right direction. I'm not looking for the answer, just some 'hints' :)
The Problem...
Awesome! Thanks for the replies guys, I managed to figure it out thanks to your help. Now I'm stuck on this problem, if anyone could explain to me the logic I would be very thankful :)
This is what I originally tried to do, which works, but I know is terrible code.
Scanner keyboard = new Scanner(System.in);
int length = keyboard.nextInt();
int[] mainArray = new...
You mean like this?
Scanner keyboard = new Scanner(System.in);
int length = keyboard.nextInt();
int[] mainArray = new int[length];
int evenCount = 0, oddCount = 0;
for (int i =...
Hey guys, really having some trouble solving this Array problem.
I have been trying to use a for loop to loop through the array to find an odd or even number, then a second loop checks whether...