public class FibonacciSequence extends Sequence implements Sequenceable{
private double secondTerm;
public FibonacciSequence(){
super(1);
this.secondTerm = 1;...
Type: Posts; User: wayfaring_stranger
public class FibonacciSequence extends Sequence implements Sequenceable{
private double secondTerm;
public FibonacciSequence(){
super(1);
this.secondTerm = 1;...
ok i figured it out i have it working now. thanks for your help and patience
ok I think I have a pretty good grasp of 2D arrays now.. I am pretty confident I have all the methods right now except my isColValid method. When I run the program and play 6 black... nothing shows...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
at Grid.checkForWin(Grid.java:189)
at Grid.gameOver(Grid.java:256)
at Grid.playGame(Grid.java:309)
at...
Ok I got some help from my schools lab tutor about the check for empty. Now I am getting an Array out of bounds error in my checkForWin method I have been through it a hundred times and can't figure...
private int firstEmpty(int column) {
for( int i = column; i <= column; i++)
{
for(int j = 0; j <= ROWS-1; j++)
{
...
In the isColValid method I have to return true if a column falls on the Grid and false otherwise. IN the firstEmpty method I have to return the row of the first empty cell or -1 if there is no empty...
Sorry it is a connect four game using 2d arrays as the grid
import java.util.Scanner;
/**
* Grid class
*
* Layout of Grid [0] [1] [2] ... [0] [1] [2]
*
*/
public class Grid {