Ну че не так с моим поединком? Вроде побеждает кто то..))
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
//напишите тут ваш код
this.age = anotherCat.age;
this.weight = anotherCat.weight;
this.strength = anotherCat.strength;
int pts1 = 0;
int pts2 = 0;
if(age> anotherCat.age) pts1++;
else pts2++;
if(weight> anotherCat.weight) pts1++;
else pts2++;
if(strength> anotherCat.strength) pts1++;
else pts2++;
if(pts1>pts2) return true;
if(pts2>pts1) return true;
else return false;
}
public static void main(String[] args) {
Cat cat1 = new Cat();
Cat cat2 = new Cat();
cat1.fight(cat2);
}
}