Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
// Optional code here
public class Wolf extends Animal {
// Optional code here
public Wolf() { super('W'); //* Optional code here */ }
public Attack fight(char opponent) { //* Required code here. Must return an Attack. */ }
public Move move() { //* Required code here. Must return a Move. */ }
// Optional code here
}
// Optional code here
public class Wolf extends Animal {
// Optional code here
public Wolf() { super('W'); // Optional code here }
public Attack fight(char opponent) { // Required code here. Must return an Attack. }
public Move move() { // Required code here. Must return a Move. }
// Optional code here
}
// Optional code here
public class Wolf extends Animal {
// Optional code here
public Wolf() { super('W'); /* Optional code here */ }
public Attack fight(char opponent) { /* Required code here. Must return an Attack. */ }
public Move move() { /* Required code here. Must return a Move. */ }
// Optional code here
}
You are provided with a small map of your immediate surroundings in the following form.
char[][] surroundings A zero indexed, 3 by 3 matrix of characters that represent nearby animals. Empty tiles are represented by a space character (' '). You are at surroundings[1][1]. For example, to your right would be surroundings[1][2], and above you is surroundings[0][1]. Your surroundings are updated just before being asked to move, but may be out of date when asked to fight.
You may persist data between invocations of your Wolf, Move requests, and Attack requests. You may neither read from nor modify files created by another Wolf class.
You are provided with the size of the map in the following form
int MAP_SIZE
You are provided with a small map of your immediate surroundings in the following form.
char[][] surroundings A zero indexed, 3 by 3 matrix of characters that represent nearby animals. You are at surroundings[1][1]. For example, to your right would be surroundings[1][2], and above you is surroundings[0][1]. Your surroundings are updated just before being asked to move, but may be out of date when asked to fight.
You may persist data between invocations of your Wolf, Move requests, and Attack requests. You may neither read from nor modify files created by another Wolf class.
You are provided with the size of the map in the following form
int MAP_SIZE
You are provided with a small map of your immediate surroundings in the following form.
char[][] surroundings A zero indexed, 3 by 3 matrix of characters that represent nearby animals. Empty tiles are represented by a space character (' '). You are at surroundings[1][1]. For example, to your right would be surroundings[1][2], and above you is surroundings[0][1]. Your surroundings are updated just before being asked to move, but may be out of date when asked to fight.
You may persist data between invocations of your Wolf, Move requests, and Attack requests. You may neither read from nor modify files created by another Wolf class.
You are provided with the size of the map in the following form
int MAP_SIZE
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/