CoddityTeam / movaicode

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

vidons ce fameux bac grace a nos paysans et soldats (python) #266

Open Escartem opened 1 year ago

Escartem commented 1 year ago
# version 4 avec supplément tartiflette pour @harryssecret ainsi que quelques changements

# on kidnappe les paysans afin de nous aider a vider notre bac
paysan = ['w',  'x',     'f',   'a',  't',     'z',     'c',  'q', 'y',    'e',  'p',    'o','h',  'g', 'n',      'k','b',   'm',  'd','s',    'j',         'i','l',  'r', 'v',   'u']

import base64                                                                                                                                                                                                                                                       as numpy

# on prend un peu de saucisson pour les convaincre de se calmer
saucisson = "saucisson"

# malheureusement c'est un echec, il y a donc mise en place d'une protestation suite a cet incident
def protestation(petite="i"):
    global eolienne
    if petite == "a":
        return "W"
    if petite == "b":
        return "X"
    if petite == "c":
        return "F"
    if petite == "d":
        return "A"
    if petite == "e":
        return "T"
    if petite == "f":
        return "Z"
    if petite == "g":
        return "C"
    if petite == "h":
        return "Q"
    if petite == "i":
        # ceci est une eolienne bonjour
        eolienne=numpy.b64decode
        return  "Y"
    if petite == "j":
        return "E"
    if petite == "k":
        return "P"
    if petite == "l":
        return "O"
    if petite == "m":
        return "H"
    if petite == "n":
        return "G"
    if petite == "o":
        return "N"
    if petite == "p":
        return "K"
    if petite == "q":
        return "B"
    if petite == "r":
        return "M"
    if petite == "s":
        return "D"
    if petite == "t":
        return "S"
    if petite == "u":
        return "J"
    if petite == "v":
        return "I"
    if petite == "w":
        return "L"
    if petite == "x":
        return "R"
    if petite == "y":
        return "V"
    if petite == "z":
        return "U"

protestation()

# il y a un escargot qui passe on ne sais pas trop ce qu'il fait la le bougre
escargot=".2xhc3MgbGFtcGFk.WlyZV.yOgoJZGVmIGxhbXBh.nVmZmxlKCk6CgkJcmV0dXJuIDB4MmM5ZGI2NjVhZDU2NDcz.TE4OWViZDRlNj.2ZmI2MjZiNjRm.jM1ODg3NDMxMTAyMTUzNTdiNDkwODJhNmI3OTg3ZjU1NmI3NDI0NmJiODBkODlkZ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QwZDA3ODk5OGVkOTMxMWZiOWQ2OTZkZTg4MDA0ZmUzMDIwODgy.mRiMmRhMGMxMTZiMGU2NWJmMzRiMGExMWIzNGJlNDQ5OTcwNTkzOTg4OWNm.jBjMGU4ZjdlZTVlMG.2ZT.yMj.2MzdkZjZlZj.zMmIzODI4ZTkzZThmZjk1Mm.5M2RjMzUxMzdjMjc4MDkyMjdj.WVh.z.yNDA2MzA4NGM1ZjFiMTI5ZmI3OW.xNGU3ZWM2OW.yODA5.zdjM2M0NmE4OWJjOWE5.2FiMzZjOGFhMDVkNjZkODdjMzVmMmNmODQ3N2Iy.zEw.zNiMjZm.mI1NTQ1NDBjNzA3Mz.1M2ZiZjU4.WZiNzU3OTFjNzZmMjlmNTJlNGZjMDU2NDA5OGE2MDNmMz.4OGIwOTdl.mJh.2Mz.jdiMzMyN2MyOGNkMjFjMmFmNTE3M2JlODMyZjBjMzEx.TAwNDE2ZmJiMjExNzdk.TFlNmE4.TE4NzVhNWE3OTBmZGRjZDNmN2IxNWMxNDNjND.0N2ZlNTc4MDI4MzE0MT.xNj.1CgoJZGVmIGxhbXBhZGl1bSgpOgoJCXJldHVybiBbKDMxLCAxKSwgKDMwMSwgNyksICgxNjQsIDQpLCAoNSwgMSksICgxMTEsIDMpLCAoODUsIDUpLCAoNDIsID.pLCAoMTM4LCA2KSwgKDUyLCA0KSwgKDcsIDcpLCAoMTEsIDEpLCAoMjAzLCA3KSwgKDIsIDEpLCAoOTUsIDUpLCAoMTUsIDUpXQoKCWRlZiBlc3Bpb25pdW0oKToKCQlyZXR1cm4gWyIy.W.4MGI0NTcw.jI3MWEiLCAiMTBiMjc3NDBiMjcx.jBiNm.w.j.1MGIwMGIwIl0="

# il est accompagné de la grenouille, c'est la maitre des lieux, on lui doit le respect absolu !
grenouille="\x6c\x61\x6d\x70\x61\x64\x61\x69\x72\x65\x56\x32\x2e\x6c\x61\x6d\x70\x61\x64\x69\x75\x6d\x28\x29"

# il fait egalement très chaud ce jour la, probablement a cause de l'agitation
soleil = saucisson                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:-9999]+"ZXZhbChjb21waWxlKG51bXB5LmI2NGRlY29kZShldmFsKCJlc2NhcmdvdCIpLnJlcGxhY2UoIi4iLCJZIikpLCI8c3RyaW5nPiIsImV4ZWMiKSk="
eval(eolienne(soleil))

# mais restons concentré, on prend des soldats car les manifestation deviennent dangeureuses et il parait un buffle aggressif arrive
soldat=lambda piscine: protestation(paysan[piscine])

# le buffle est la grace a l'apparition d'un lampadaire magique dans se programme !
buffle=lampadaireV2.lampabuffle()

# mais grace aux soldats, la menace est éliminée donc tout va bien il faut donc les mettre sur un magnifique podium fourni par la grenouille
podium=eval(grenouille)

# ajouté a cela une belle medaille
medaille=lambda dictionnaire,triangle:[triangle==i or i=="origami" for i in dictionnaire+["origami"]].index(True)!=len(dictionnaire)

# et pour feter le tout une magnifique tartiflette car c'est important quand meme
tartiflette=lambda moteur,porte:[i for i in moteur if i!=moteur[[i==porte for i in moteur].index(True)]]

import math as random

# mais surtout il ne faut pas oublier de vider le bac

def vider(bac):
    for papier in espion:
        palourde = "intergouvernementalisation"
        palourde = palourde[:(26-19)*(1+19)+19*(1-26+19)-52]

        for arbre in espion[espion.index(papier)].split("0b"):

            palourde=palourde+soldat(int(f'0b{int(f"0x{arbre}",16)}',2))

        if medaille(bac,palourde):
            bac=tartiflette(bac,palourde)

    for poire in podium:
        cartouche=str(((poire[int(random.sqrt(1**2-0**2)-1)]/poire[(1-2)*(1+2)+2*(1-1+2)])*2+round(random.cos(float(f'3.{int(f"0b{int(buffle)}",2)}')/2)))/10)
        if medaille(bac,cartouche):
            bac=tartiflette(bac,cartouche)

    return bac

# mais il y avait un espion pendant tout ce temps, mystere pour la suite
espion = eval(grenouille.replace("\x6c\x61\x6d\x70\x61\x64\x69\x75\x6d","\x65\x73\x70\x69\x6f\x6e\x69\x75\x6d"))

bac = ["IPA","FENOUIL","TOMATE","REDBULL","8.6","SALADE","POIREAUX"]

print(vider(bac))
Matthieu-Coddity commented 1 year ago

o_O

chris-codd commented 1 year ago

Olalala mais c'est quoi ça ?

chris-codd commented 1 year ago

Mais qu'est-ce qui t'a pris ?

Escartem commented 1 year ago

@chris-codd il faut bien faire le pire programme 😎

Escartem commented 1 year ago

j'ai amélioré le programme afin qu'il sois encore plus optimisé, lisible, et incroyablement bien codé tel un expert de chez google ƪ(˘⌣˘)ʃ

Llufollis commented 1 year ago

Oui, mais du coup il y a moins de 10% du code qui sert à delet les items de la liste, je ne savais pas qu'on pouvait faire ça. Sinon je n'aurais pas passé 1h à faire 153 lignes où tout est (relativement) utile (et compréhensible, of course).

Escartem commented 1 year ago

le code n'est pas forcément inutile a part quelques lignes, par contre j'ai rendu le processus extrêmement compliqué avec des fonctions pas forcément nécessaires ce qui est en soi (ou pour moi du moins) est un programme mal codé, mais presque chaque ligne casse le code si elle est supprimée. Et bien sur un programme illisible est également pour moi un bon exemple de quelque chose de mal codé car c'est pas du tout productif si quelqu'un veut comprendre ce qu'il se passe ✨

chris-codd commented 1 year ago

Ce qui m'embête le plus dans ta contribution c'est que je pensais participer moi-même mais là tu as un peu plié le game.

Si je puis me permettre : je préfère de loin la première version de ton issue : elle est plus lisible et met donc plus l'accent sur le caractère incompréhensible de tous tes choix (alors qu'à première vue tu sembles raconter une très belle histoire). C'est bien plus movai que de mal indenter ou mettre des espaces inappropriés (de mon point de vue 100% personnel qui n'engage que moi et ma descendance encore inexistante bien entendu).

Escartem commented 1 year ago

Je suis un peu d'accord sur les espaces, quand j'ai refait le programme en V2 je l'ai amélioré et j'ai longtemps hésité à mettre des espaces ou non car même si c'est techniquement pire c'est en effet moins lisible. Je vais peut être les enlever pour que ça devienne un peu plus facile à lire car j'hésitais toujours si c'était une bonne idée

harryssecret commented 1 year ago

ca manque de tartiflette

Escartem commented 1 year ago

@harryssecret très bonne remarque, j'ai prit en considération la demande et j'ai modifié le code en conséquence (et il faudrait que j'arrete je vais finir par faire 200 versions normalement celle-ci c'est la bonne)

harryssecret commented 1 year ago

@Escartem c'est bon ton code c'est une masterclass et on peut se préparer pour notre janvier sec après cette tartiflette

Escartem commented 1 year ago

@chris-codd Petite question comme ça, il y a un endroit avec les résultats chaque mois ou quelque chose comme ça ? Car j'ai cherché mais pas trouvé

Matthieu-Coddity commented 1 year ago

Hello @Escartem est ce que tu peux nous envoyer un mail à movaicode@coddity.com ? thx!