This was the output, so clearly not the right one.
%s attacked Amigo: its Enemy was attacked, and its hand was defended
%s attacked Amigo: its Enemy was attacked, and its leg was defended
%s attacked Enemy: its Amigo was attacked, and its chest was defended
%s attacked Amigo: its Enemy was attacked, and its null was defended
%s attacked Enemy: its Amigo was attacked, and its null was defended
%s attacked Amigo: its Enemy was attacked, and its null was defended
%s attacked Enemy: its Amigo was attacked, and its null was defended
%s attacked Amigo: its Enemy was attacked, and its null was defended.
If anyone got this task and found it easy and logical,I would really appreciate 5 minutes of your time. Can't publish the code as it is not allowed for accepted solutions.
I passed all tests on first try. But, WHY?!?!
Resolved
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Andrejs Bogdanovs
4 May 2020, 10:00solution
Hi! Take a look in Solution class in line 26
System.out.println(String.format("%%s attacked %s: its %s was attacked, and its %s was defended",
robotFirst.getName(), robotSecond.getName(), attacked, defended));
Just delete % character.
+3