CoddityTeam / movaicode

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

Chasse au oeufs en taxi #223

Closed jeremie-j closed 1 year ago

jeremie-j commented 2 years ago

Le code - Taxi

"9" is waiting at Writer's Depot.
0 is waiting at Starchild Numerology.
1 is waiting at Starchild Numerology.

Go to Starchild Numerology: west 1st left, 2nd right, 1nd left, 1st left, 2nd left.
Pickup a passenger going to Sunny Skies Park.

Go to Writer's Depot: east 1st left, 2nd right.
Pickup a passenger going to Sunny Skies Park.

Go to Sunny Skies Park: north 1st right, 1st left.

Go to Starchild Numerology: south 3rd left.
Pickup a passenger going to Bird's Bench.
Go to Bird's Bench: west 1st right, 2nd left, 1st left.

[Pickup a sentence]
Go to Post Office: north 1st right, 1st left, 1st right, 1st right, 1st left.
Pickup a passenger going to the Chop Suey.
Go to Chop Suey: north 1st right, 1st left, 4th right, 1st left.

[iterate_sentence]

Switch to plan "generate_money".
[generate_money_back]
[Get fuel]
Go to Zoom Zoom: west 1st left, 1st right, 1st right.

[Increment index]
Go to Bird's Bench: west 3rd left, 1st right, 1st right, 1st left.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st right, 1st left, 1st left, 1st right.
Pickup a passenger going to Bird's Bench.
Pickup a passenger going to Addition Alley.

Go to Bird's Bench: south 1st left, 1st right, 1st right, 1st left.
Go to Sunny Skies Park: north 1st right, 1st left.
Pickup a passenger going to Addition Alley.
Go to Addition Alley: north 1st right, 1st right, 1st right.
Pickup a passenger going to Sunny Skies Park.
Go to Sunny Skies Park: north 1st left, 1st left, 1st left.

[Check if character is a 9]
Pickup a passenger going to Cyclone.
Go to Cyclone: north 1st left.
Pickup a passenger going to Sunny Skies Park.
Pickup a passenger going to Crime Lab.
Go to Sunny Skies Park: north 1st right.
Go to Chop Suey: north 1st right, 1st right, 3rd right.
Pickup a passenger going to Crime Lab.
Go to Crime Lab: south 1st right, 1st left.

Switch to plan "reset_loop" if no one is waiting.

Go to Sunny Skies Park: south 1st right, 1st left, 1st right.
Pickup a passenger going to the The Babelfishery.
Go to The Babelfishery: south 1st left, 1st right, 1st right.
Pickup a passenger going to the Post Office.
Go to the Post Office: north 1st left, 1st right.
Go to Taxi Garage: north 1 right, 1st left, 1 right.
Switch to plan "end_of_program".

[reset_loop]
Go to Chop Suey: north 5th right, 1st left.
Switch to plan "nine_not_found" if no one is waiting.
Switch to plan "iterate_sentence".

[generate_money]
0 is waiting at Starchild Numerology.
0 is waiting at Starchild Numerology.
0 is waiting at Starchild Numerology.
Go to Starchild Numerology: north 1st left, 3rd left, 3rd left, 2nd right.
Pickup a passenger going to the Narrow Path Park.
Pickup a passenger going to the Narrow Path Park.
Pickup a passenger going to the Narrow Path Park.
Go to the Narrow Path Park: east 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 1st left, 2nd right, 3rd right, 1st left, 1st right.
Switch to plan "generate_money_back".

[nine_not_found]
"This sentence does not contain any 9" is waiting at Writer's Depot.
Go to Writer's Depot: north 1st left, 3rd left.
Pickup a passenger going to the Post Office.
Go to Post Office: north 1 right, 2nd right, 1st left.
Go to Taxi Garage: north 1 right, 1st left, 1 right.

[end_of_program]

Tester le code:

Try it online! (tio.run)

Avec une string dans input, le resultat s'affiche dans output

La doc du langage (pour comprendre un peu le code) https://bigzaphod.github.io/Taxi/

jeremie-j commented 2 years ago

Oupss, faut que j'incremente le compteur apres le check, l'index est décalé de 1, jmodifirais ça quand j'ai le temps

louismarslen commented 2 years ago

Salut salut,

Bon t'as perdu, comme ça c'est dit (désolé pour la non-prise-de-pincettes 😊). En revanche, ça veut dire deux choses cool :

  1. tu n'es pas si movai, ce qui est ma foi agréable
  2. l'édition 11 est dispo, ce qui te donne une nouvelle chance de briller : ça se passe ici

Pour info, c'est MajorTom327 qui gagne. Son issue : #207

La bise, cordialement, La Direction.