Search:

Type: Posts; User: wayfaring_stranger

Search: Search took 0.23 seconds.

  1. Summing n terms of a Fibonacci Sequence

    public class FibonacciSequence extends Sequence implements Sequenceable{

    private double secondTerm;

    public FibonacciSequence(){
    super(1);
    this.secondTerm = 1;...
  2. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    ok i figured it out i have it working now. thanks for your help and patience
  3. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    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...
  4. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    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...
  5. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    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...
  6. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    private int firstEmpty(int column) {

    for( int i = column; i <= column; i++)
    {
    for(int j = 0; j <= ROWS-1; j++)
    {
    ...
  7. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    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...
  8. Re: need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    Sorry it is a connect four game using 2d arrays as the grid
  9. need help with my program, not clear on diagonals or methods 3, 4 & 6 logic

    import java.util.Scanner;

    /**
    * Grid class
    *
    * Layout of Grid [0] [1] [2] ... [0] [1] [2]
    *
    */
    public class Grid {
Results 1 to 9 of 9