hello i have a maze and im trying to find a paths in this maze. i want to create a stack and also want to find paths which is created by letters. So i was trying to that if my paths values are started false when i visit turns true in this way i do not visit again. when i see letters trying to put stack and should be stopped when see big "E" for example in this maze paths are aaaE, aabcccE. tahmin means in my language like estimate.
hello i have a maze and im trying to find a paths in this maze. i want to create a stack and also want to find paths which is created by letters. So i was trying to that if my paths values are started false when i visit turns true in this way i do not visit again. when i see letters trying to put stack and should be stopped when see big "E" for example in this maze paths are aaaE, aabcccE.
tahmin means in my language like estimate.
deger means in my language like value.
i was wondering I could not do stack and stack implementation and also if i have any other mistake can you help me in java language.
public class path01 {
public char deger;
public boolean tahmin = false;
public path01(char deger) {
this.deger = deger;
}
public char getDeger() {
return deger;
}
public void setDeger(char deger) {
this.deger = deger;
}
public boolean isTahmin() {
return tahmin;
}
public void setTahmin(boolean tahmin) {
this.tahmin = tahmin;
}
}
public class driverc {
private static path01[][] map = new path01[5][5];
public static void main(String[] args) {
// TODO Auto-generated method stub
map[0][0] = new path01('+');
map[0][1] = new path01('-');
map[0][2] = new path01('+');
map[0][3] = new path01('-');
map[0][4] = new path01('+');
map[1][0] = new path01('a');
map[1][1] = new path01('a');
map[1][2] = new path01('a');
map[1][3] = new path01('E');
map[1][4] = new path01('|');
map[2][0] = new path01('|');
map[2][1] = new path01('b');
map[2][2] = new path01('+');
map[2][3] = new path01('+');
map[2][4] = new path01('|');
map[3][0] = new path01('|');
map[3][1] = new path01('c');
map[3][2] = new path01('c');
map[3][3] = new path01('c');
map[3][4] = new path01('+');
map[4][0] = new path01('|');
map[4][1] = new path01('-');
map[4][2] = new path01('-');
map[4][3] = new path01('E');
map[4][4] = new path01('|');
print();
}
public static void print() {
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
System.out.print(map[i][j].getDeger());
}
System.out.println();
}
}
public static void traverse() {
for (int i = 0; i < map.length; i++) {
for (int j = 0; j < map[i].length; j++) {
map[i][j].setTahmin(true);
}
}
}
}
Step by step
Solved in 4 steps