Tracciato dei buggle

Your buggle got lost in a strange maze, and you must help it to find the exit that is represented in orange. You cannot simply explain the path to the exit in something like right();forward();forward();forward() because you have to save two buggles at the same time, that are lost in similar but not identical worlds. You can switch to the other world by using the combobox above the world representation (where it's written 'Deep Forest' right now), and selecting the other entry (that should read 'Deeper Forest').

La buona notizia è che il percorso d'uscita è scritto sul terreno. Come potete vedere il mondo è composto da diversi corridoi con dei baggle sul pavimento. Dopo ogni corridoio se si è incontrato tre o più baggle bisognerà girare a sinistra mentre per due o meno a destra.

You should count exactly 5 cells per corridor, from intersection to intersection. Consider in your count the intersection ending the corridor but not the intersection before the corridor.

Quindi la forma generale del vostro codice deve essere qualcosa come "finché non trovo l'uscita prendo il prossimo corridoio per decidere se dovrò girare a destra o a sinistra al prossimo incrocio". Puoi determinare se ti trovi sulla cella di uscita (in arancione) con il metodo exitReached()

To take one corridor, you simply have to run from one intersection to another while counting the baggles you see on your path. That's easy: there is 5 steps in each corridors so a simple for loop suffices.

Hai bisogno di una variabile inizializzata a 0 e incrementarla ogni volta che vedi un baggle sul pavimento. Una variabile usata in questo modo è spesso chiamanta contatore.

Non dimenticare di azzerare il tuo contatore all'inizio di ogni corridoio!

Ah, e quando avrai raggiunto l'uscita, non dimenticare di fare uno step extra per uscire effettivamente dal labirinto.