Skip to content

Instantly share code, notes, and snippets.

@Frontear
Created March 23, 2023 20:40
Show Gist options
  • Save Frontear/6e38445e306edef006c6b44a2659c782 to your computer and use it in GitHub Desktop.
Save Frontear/6e38445e306edef006c6b44a2659c782 to your computer and use it in GitHub Desktop.
A program made for vanessa to parse hollywood u characters from a dataset file
Action Hero + Action Hero = Action Hero
Action Hero + anything = Action Hero
Agent + Agent = Agent or Reality TV
Agent + anything = Agent or Reality TV
Agent + Reality TV = Agent or Reality TV
Celeb Athlete + Stunt = Martial Artist
Celebutante + anything = Celebutante or Model
Celebutante + Celebutante = Model or Celebutante
Composer + Composer = Composer
Composer + Model or Celebutante = Fairy Tale
Director + Director = Director
Director + Fashionista + Movie Star = Action Hero
Director + Fashionista = Make-Up
Director + Fashionista = Wardrobe
Director + Movie Star + Fashionista + Stunt = Superhero (LIMITED EDITION)
Director + Pop Star = Music Mogul
Fairy Tale + Fairy Tale = Fairy Tale
Fashionista + Fashionista = Fashionista
Fashionista + Pop Star = Diva
Makeup + anything = Makeup or Wardrobe
Makeup + Makeup = Wardrobe or Makeup
Model + anything = Model or Celebutante
Model + Celebutante = Model or Celebutante
Model + Model = Model or Celebutante
Movie Star + Director = Agent
Movie Star + Director = Reality TV
Movie Star + Fashionista + Pop Star = Award Host (LIMITED EDITION)
Movie Star + Fashionista + Stunt = Fantasy (LIMITED EDITION)
Movie Star + Fashionista = Celebutante
Movie Star + Fashionista = Model
Movie Star + Movie Star = Movie Star
Movie Star + Pop Star + Fashionista = Harrison (A-Lister)
Movie Star + Pop Star = Broadway
Movie Star + Screenwriter = Celeb Blogger
Movie Star + Stunt = Magician
Movie Star + Stunt = Mo-Cap
Pop Star + Director = Composer
Pop Star + Director = Song (A-Lister)
Pop Star + Pop Star = Pop Star
Reality TV + anything = Reality TV or Agent
Reality TV + Reality TV = Agent or Reality TV
Special FX + anything = Special FX
Stunt + anything = Stunt
Stunt + Director = Special FX
Stunt + Director = Stunt driver
Stunt + Pop Star = Bodyguard
Wardrobe + anything = Wardrobe or Makeup
Wardrobe + Makeup = Wardrobe or Makeup
Wardrobe + Wardrobe = Wardrobe or Makeup
import pathlib
import collections
import beautifultable
def valid_combo(lst):
for x in lst:
if lst.count(x) > 1:
return False
return True
def parse_data():
data = collections.defaultdict(list)
with open(pathlib.Path(pathlib.Path(__file__).parent, "chars.txt"), "r") as f:
lines = [x.replace("\n", "") for x in f.readlines()]
for x in lines:
line = x.split(" = ")
combo = line[0].split(" + ")
result = " or ".join(sorted(line[1].split(" or ")))
if valid_combo(combo):
data[result].append([combo[i] if len(combo) > i else " " for i in range(4)])
return data
def main():
table = beautifultable.BeautifulTable()
table.columns.header = [ "Friend Unlocked", "Character 1", "Character 2", "Character 3", "Character 4" ]
for key in sorted(data := parse_data()):
for value in data[key]:
table.rows.append([key, *value])
print(table)
if __name__ == "__main__":
main()
@Frontear
Copy link
Author

Going to need to install beautifultable via pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment