hello. I am making a text version of Chutes and Ladders for a project I have to do for school. I am almost done i think, but I have a problem with my Chutes and Ladders part of the program. This is what I have so far.
code//
package APcompsci.Myprogs;
import cs1.Keyboard;
public class game1 {
private int [][] map= new int[10][10];
private final int SPACE = 0;
private final int PERSON = -1;
private double s = 0;
private boolean over = true;
private int total = 0;
private int total1 = 0;
private int r = 0;
private int c = 0;
Die d = new Die();
public void initialboard() {
//sets a new board up
for ( c = 0; c < 10; c++)
for (r = 0; r < 10; r++){
map[r][c] = SPACE;
map[5][6] = 88;
map[2][9] = 55;
map[4][9] = 33;
map[3][8] = 50;
map[9][7] = 77;
}
}
public void display() {
for ( c = 0; c< 10; c++){
System.out.println("");
for ( r = 0; r< 10; r++)
System.out.print("" + map[r][c] + "\t");
}
}
public void move(){
int u , count = 0, r = 0, c = 0, t = 0, q = 0;;
System.out.println("\n" + "Start at 1");
do{
map[r][c] = 0;
System.out.println("\n" + "press 1 to roll!!!");
u = Keyboard.readInt();
d.roll();
System.out.println("\n" + "you have rolled a " + d.getFaceValue());
total += d.getFaceValue();
System.out.println("the total is " + (total + 1));
r = total;
t = total - d.getFaceValue();
double s = total - d.getFaceValue();
if ((r / 10) > (s / 10)){
q = r/10;
r = r - q * 10;
c = c + 1;
}
else if ((r/10) <= (s/10) && ((r/10) == (t/10))){
q = r/10;
r = r - q * 10;
}
else {
r = total;
}
if (total >= 100){
break;
}
map[r][c] = PERSON;
chutes();
ladders();
display();
count++;
}while (total < 100);
System.out.println("You rolled " + count + " times to finish!");
}
public void chutes(){
int total1 = 0;
if (PERSON == map[2][9]){
map[2][9] = 55;
map[4][5] = PERSON;
total -= 37;
System.out.println("CHUTE!!!");
}
if (PERSON == map[4][9]){
map[4][9] = 33;
map[2][3] = PERSON;
total -= 62;
System.out.println("CHUTE!!!");
}
if (PERSON == map[3][8]){
map[3][8] = 50;
map[9][4] = PERSON;
total -= 34;
System.out.println("CHUTE!!!" );
}
if (PERSON == map[9][7]){
map[9][7] = 77;
map[7][6] = PERSON;
total -= 12;
System.out.println("CHUTE!!!");
display();
}
}
public void ladders(){
if (PERSON == map[5][6]){
map[5][6] = 88;
map[7][8] = PERSON;
total += 12;
System.out.println("LADDER!!!");
}
}
}
This is part that is wrong...
The good thing is that it does chute to a certain place when the PERSON lands on a Chute or a ladder, but when I roll again, it continues from the chute or ladder place instead of the new place where it's supposed to be and the PERSON just stays in the new spot. I've been working on this for like 3 hours and I've gotten no where...

. If you can just guide me or help me to get somewhere that would be GREAT!!!