From 3d9266c50ec3e86fc962cfda43d9d7154b63eb27 Mon Sep 17 00:00:00 2001 From: Richard Quinlivan Date: Sat, 9 Feb 2019 18:02:29 -0500 Subject: [PATCH] why not --- hello.py | 3 --- profiles.py | 19 ++++++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 hello.py diff --git a/hello.py b/hello.py deleted file mode 100644 index fae165f..0000000 --- a/hello.py +++ /dev/null @@ -1,3 +0,0 @@ -def main(): - -main() diff --git a/profiles.py b/profiles.py index 08c7c00..d06191d 100644 --- a/profiles.py +++ b/profiles.py @@ -43,12 +43,25 @@ def __str__(self): return str(self.name) def find_hated(self,profileList): - pass + hatred = 0 for profile in profileList: - hatred = 0 + if (profileList[p].gender != self.genderPreference) or not(profileList[p].age.yours in self.age.preference) or (self.gender != profileList[p].genderPreference) or not (self.age.yours in profileList[p].age.preference) : + continue + for k in self.__dict__: + if k == "name" or k == "gender" or k == "genderPreference": + continue + elif k == "height" or k == "weight" or k == "age": + val = abs(self.__dict__[k].yours-profileList[p].__dict__[k].yours)**2/100 + if val <= 5: + hatred += val + else: + hatred += 5 + else: + if self.__dict__[k].yours != profileList[p].__dict__[k].yours: + hatred += 1 - self.matchPercent.append(sum) + matchList.append(Oppositeness) def find_opposite(self,profileList): matchList = []