Java Advanced Exam - 26 Oct 2019/BookWorm
Judge ми дава 90/100. Последният тест ми гърми. Какво ли не опитах, но не се сещам какъв е граничния случай. Ето това е кода ми: https://pastebin.com/rAn8Gh5Y. Благодаря ви предварително за помощта!
Judge ми дава 90/100. Последният тест ми гърми. Какво ли не опитах, но не се сещам какъв е граничния случай. Ето това е кода ми: https://pastebin.com/rAn8Gh5Y. Благодаря ви предварително за помощта!
Не спазвае тази част от условието:
If he tries to move outside of the field, he is punished - he loses the last letter in the string, if there are any, and the player’s position is not changed.
Например:
private static void up(char[][] matrix) {
if (wormRow == 0){
if (matrix[matrix.length - 1][wormCol] == '-'){
if (worm.length() > 0){
worm = worm.substring(0, worm.length() - 1);
}
} else {
matrix[matrix.length - 1][wormCol] = '-';
}
} else {
// ...
}
}
// трябва да стане:
private static void up(char[][] matrix) {
if (wormRow == 0){
if (!worm.isEmpty()) {
worm = worm.substring(0, worm.length() - 1);
}
} else {
// ...
}
}
Аналогично и за останалите 3 метода за движение.
Благодаря ви за бързия отговор!
gbwhatsapp
gb whatsapp
I have customized an app named gbwhatsapp in which I saw some error but now successfully fixed.
nice snipped of code.
I got pandora apk link free download
Well You Can Check This One As Well Endless Nightmare MOD