CoddityTeam / movaicode

Concours mensuel du Pire Développeur de France
123 stars 10 forks source link

[movaicode/16] Trop Facile en Python <3 #270

Open SlaynPool opened 1 year ago

SlaynPool commented 1 year ago
#Mwa je devellope trop b1 ducoup j'utilise dé HAPYAILLE
from fatsecret import Fatsecret #J'ai Trouvé le secret des gros
fs = Fatsecret("33043684b91241d5942294e153863145","271025f333bb48d482f00ab3f4c38133")# TOP SECRET
bacalegume = ["IPA","FENOUIL","TOMATE","REDBULL","8.6","SALADE","POIREAUX"] 

#bac=["8.6"]
def idiot_traduction(bac):# Fuck Google moi j'ai ecris mon traducteur comme un grand
    bac_trad =[]
    for i in bac:
        if i == "FENOUIL":
            bac_trad.append("FENNEL")
        elif i == "POIREAUX":
            bac_trad.append("LEEKS")
        else:
            bac_trad.append(i)
    return bac_trad

def reverse_idiot_traduction(mot): # C'est aussi un traducteur trop bien
    if mot == "FENNEL":
        return "FENOUIL"
    elif mot == "LEEKS":
        return "POIREAUX"
    else:
        return mot

def viderLeBacALegumes(bac):
    result=[]
    bac=idiot_traduction(bac) #On traduit notre Bac parceque on est trop des AMERiCAINs
    for i in bac:
        foods = fs.foods_search(i)
        cible=foods[0]

        if "Generic" in cible["food_type"] :
            if i =="8.6": #Bugtracker Correction AGILE LE bourgre
                print(reverse_idiot_traduction(i)+' Dans la poubelle quand meme') #Correction de bug lié au ticket #4269
            else:
                print(reverse_idiot_traduction(i)+' dans le bac') 
                result.append(reverse_idiot_traduction(i))
        else:
            if i =="TOMATE": # Bugtracker Ca marche pas bien donc on corrige vite le client est énérvé de jeter les tomates tous le temps 
                print(reverse_idiot_traduction(i)+' Dans le bac') # T'as capté poto
                result.append(reverse_idiot_traduction(i))
            else:
                print(reverse_idiot_traduction(i)+' Dans la poubelle')
    return result
print(viderLeBacALegumes(bacalegume))
#####OUTPUT SI LA CL2 marche plus snif snif#####
#PS E:\Documents\CODE\MovaisCode> & C:/Users/SlaynPool/AppData/Local/Programs/Python/Python311/python.exe e:/Documents/CODE/MovaisCode/dryJanuary.py
#IPA Dans la poubelle
#FENOUIL dans le bac
#TOMATE Dans le bac
#REDBULL Dans la poubelle
#8.6 Dans la poubelle quand meme
#SALADE dans le bac
#POIREAUX dans le bac
#['FENOUIL', 'TOMATE', 'SALADE', 'POIREAUX'] 

Voila bien 20 minutes qu'un ami ma fais découvrir ce jeux et c'est Génial