forked from IF-LK-2020/wordle
added info <n>
This commit is contained in:
@@ -217,6 +217,23 @@ public class Game {
|
||||
send(".");
|
||||
} else if (msg.length() == 6) {
|
||||
|
||||
String rawLine = msg.substring(5);
|
||||
int line = -1;
|
||||
try {
|
||||
line = Integer.parseInt(rawLine) - 1;
|
||||
} catch (NumberFormatException e) {
|
||||
send("-ERR wrong argument.");
|
||||
}
|
||||
if (line >= 0 && line < 5) {
|
||||
if (words[line] != null) {
|
||||
send("+OK " + words[line] + " " + generateCode(words[line]));
|
||||
} else {
|
||||
send("-ERR game hasn't progressed to this line yet.");
|
||||
}
|
||||
} else {
|
||||
send("-ERR couldn't parse line.");
|
||||
}
|
||||
|
||||
} else {
|
||||
sendUniversalError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user