The first obvious problem is that his peasant will go up and down in a couple of fields when nearby fields are all claimed. It can be fixed simply by adding a random mechanism when all directions score the same.
The second problem is a bug that when his knight trace chased enemies' peasant to the world's angle, it will stop a block away from the target without attacking it. I don't know what's going wrong in the algorithm. This bug needs to be fixed.
The third one, which I think is most important, is a question about knight strength. In Ben Karsin's Ruler, knight runs away when its strength goes down to a degree. This strategy does protect knight from being killed, but it significant reduces the usable power of knight. Because when a knight runs for live when its strength goes below, for example, 10%, that means only 90% of a knight's power is usable. Although run-away knights can go to capture enemy knight, it makes enemies' knight able to attack anything as they wish, such as castle. In my opinion, warrior is honored to die in the battlefield bravely. So I don't agree in run-away strategy. Maybe let one or two knights go to capture enemies' peasant when strength gets low is OK, but most of the knight should fight to death.
Following is the summary of violations in the code.
Summary of violations
File | Lines | Violation | Comments |
MyRuler.java | 16,29,30,* | ICS-SE-Eclipse-2 | Code indented 3 spaces or tab, not 2 throughout. |
MyRuler.java | 16,29,138,* | EJS - 7 | Lack of space between operations and parenthesis. |
MyRuler.java | 104,106 | EJS - 76 | Use experssion instead of block statement. |
MyRuler.java | 114,116 | EJS - 5 | '{' in a new line, not in the last of upper line. |
MyRuler.java | 181,182,183 | EJS - 6 | Lines too long. |
MyRuler.java | 142,196,276 | EJS - 9 | Do not use a meaningful name. |
MyRuler.java | 74,81,90,* | EJS - 37 | Used C-sytle comments to explain implementation, not one-line comments |
MyRuler.java | 250 | N/A | The first if statement contains a blank expression, though is not prohibited by the rules, it made me somewhat confused. |
MyRuler.java | 224,50,54,* | EJS - 7 | no blank lines to seperate each member of the class |