Taxi , 2577 byte
Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Sunny Skies Park.Go to Sunny Skies Park:n 1 l 1 l 1 r.[a]Go to Heisenberg's:n 1 r 1 r 3 r.Pickup a passenger going to Cyclone.Go to Go More:n 1 l 3 l 3 l.Go to Starchild Numerology:e 2 r.62 is waiting at Starchild Numerology.Pickup a passenger going to Cyclone.Go to Cyclone:e 1 l 2 r.Pickup a passenger going to What's The Difference.Pickup a passenger going to Divide and Conquer.Pickup a passenger going to Divide and Conquer.Go to Divide and Conquer:n 2 r 2 r 1 r.Pickup a passenger going to Trunkers.Go to Trunkers:e 1 r 3 r 1 l.Pickup a passenger going to Multiplication Station.Go to Cyclone:w 2 r.Pickup a passenger going to Multiplication Station.Go to Multiplication Station:s 1 l 2 r 4 l.Pickup a passenger going to What's The Difference.Go to What's The Difference:n 2 l 1 r 3 l.Pickup a passenger going to Addition Alley.Go to Starchild Numerology:e 1 r 3 l 2 r.1 is waiting at Starchild Numerology.63 is waiting at Starchild Numerology.Pickup a passenger going to Addition Alley.Pickup a passenger going to The Underground.Go to Addition Alley:e 1 l 2 r 3 r 1 r.Pickup a passenger going to Joyless Park.Go to Writer's Depot:n 1 l 1 l.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789- is waiting at Writer's Depot.Pickup a passenger going to Chop Suey.Go to Joyless Park:n 3 r 2 r 2 l.Go to Chop Suey:w 1 r 1 r 1 l.[b]Pickup a passenger going to Narrow Path Park.Go to Narrow Path Park:n 1 l 1 r 1 l.Go to The Underground:e 1 r.Switch to plan "c" if no one is waiting.Pickup a passenger going to The Underground.Go to Fueler Up:s.Go to Chop Suey:n 3 r 1 l.Switch to plan "b".[c]Go to Joyless Park:n 1 r.Pickup a passenger going to The Underground.Go to Narrow Path Park:w 1 r 3 l.[d]Pickup a passenger going to KonKat's.Go to KonKat's:e 1 r.Pickup a passenger going to KonKat's.Go to The Underground:s.Switch to plan "e" if no one is waiting.Pickup a passenger going to The Underground.Go to Fueler Up:s.Go to Narrow Path Park:n 4 l.Switch to plan "d".[e]Go to KonKat's:n.Pickup a passenger going to Riverview Bridge.Go to Riverview Bridge:n 1 l.Go to Narrow Path Park:e 1 l 1 r.Pickup a passenger going to Post Office.Go to Post Office:e 1 r 4 r 1 l.Go to Sunny Skies Park:s 1 r 1 l 1 r.Pickup a passenger going to The Underground.Go to The Underground:n 1 r 1 r 2 r.Switch to plan "f" if no one is waiting.Pickup a passenger going to Sunny Skies Park.Go to Sunny Skies Park:n 3 l 2 l 1 l.Switch to plan "a".[f]
Provalo online!
Taxi è eccellente , non fatta per questo, ma si può fare! Proverò a spiegare cosa sta succedendo sotto la versione senza golf.
Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery: south 1st left 1st right.
Pickup a passenger going to Sunny Skies Park.
Go to Sunny Skies Park: north 1st left 1st left 1st right.
[a]
Go to Heisenberg's: north 1st right 1st right 3rd right.
Pickup a passenger going to Cyclone.
Go to Go More: north 1st left 3rd left 3rd left.
Go to Starchild Numerology: east 2nd right.
62 is waiting at Starchild Numerology.
Pickup a passenger going to Cyclone.
Go to Cyclone: east 1st left 2nd right.
Pickup a passenger going to What's The Difference.
Pickup a passenger going to Divide and Conquer.
Pickup a passenger going to Divide and Conquer.
Go to Divide and Conquer: north 2nd right 2nd right 1st right.
Pickup a passenger going to Trunkers.
Go to Trunkers: east 1st right 3rd right 1st left.
Pickup a passenger going to Multiplication Station.
Go to Cyclone: west 2nd right.
Pickup a passenger going to Multiplication Station.
Go to Multiplication Station: south 1st left 2nd right 4th left.
Pickup a passenger going to What's The Difference.
Go to What's The Difference: north 2nd left 1st right 3rd left.
Pickup a passenger going to Addition Alley.
Go to Starchild Numerology: east 1st right 3rd left 2nd right.
1 is waiting at Starchild Numerology.
63 is waiting at Starchild Numerology.
Pickup a passenger going to Addition Alley.
Pickup a passenger going to The Underground.
Go to Addition Alley: east 1st left 2nd right 3rd right 1st right.
Pickup a passenger going to Joyless Park.
Go to Writer's Depot: north 1st left 1st left.
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789- is waiting at Writer's Depot.
Pickup a passenger going to Chop Suey.
Go to Joyless Park: north 3rd right 2nd right 2nd left.
Go to Chop Suey: west 1st right 1st right 1st left.
[b]
Pickup a passenger going to Narrow Path Park.
Go to Narrow Path Park: north 1st left 1st right 1st left.
Go to The Underground: east 1st right.
Switch to plan "c" if no one is waiting.
Pickup a passenger going to The Underground.
Go to Fueler Up: south.
Go to Chop Suey: north 3rd right 1st left.
Switch to plan "b".
[c]
Go to Joyless Park: north 1st right.
Pickup a passenger going to The Underground.
Go to Narrow Path Park: west 1st right 3rd left.
[d]
Pickup a passenger going to KonKat's.
Go to KonKat's: east 1st right.
Pickup a passenger going to KonKat's.
Go to The Underground: south.
Switch to plan "e" if no one is waiting.
Pickup a passenger going to The Underground.
Go to Fueler Up: south.
Go to Narrow Path Park: north 4th left.
Switch to plan "d".
[e]
Go to KonKat's: north.
Pickup a passenger going to Riverview Bridge.
Go to Riverview Bridge: north 1st left.
Go to Narrow Path Park: east 1st left 1st right.
Pickup a passenger going to Post Office.
Go to Post Office: east 1st right 4th right 1st left.
Go to Sunny Skies Park: south 1st right 1st left 1st right.
Pickup a passenger going to The Underground.
Go to The Underground: north 1st right 1st right 2nd right.
Switch to plan "f" if no one is waiting.
Pickup a passenger going to Sunny Skies Park.
Go to Sunny Skies Park: north 3rd left 2nd left 1st left.
Switch to plan "a".
[f]
Inizio: Ottieni lo stdin
Raccogli il valore dello stdin come testo, convertilo in un numero e mettilo da qualche parte in attesa.
Pianifica una parte 1: ottieni un numero intero casuale 1-62
Ottieni un numero intero casuale e quindi ottieni 62
un numero. Duplica sia il numero intero casuale che il 62
perché ne avremo bisogno in seguito. Si può portare solo 3 passeggeri al tempo stesso così finiamo con rand
, rand
e 62
. (L'altro 62
attenderà fino al nostro ritorno.) Vai a dividere rand
per 62
e troncare il risultato per ottenere un numero intero. Torna indietro per ottenere l'altra copia 62
e moltiplicarla per il numero intero troncato dalla divisione. Infine, sottrarre il prodotto dalla prima copia di rand
. Questo ci dà un numero 0-61. Ora dobbiamo tornare al pickup a 1
e aggiungerlo al risultato per ottenere un numero 1-62. Sì, tutte quelle tante righe di testo sono giuste mod(rand(),62)+1
.
Pianifica una parte 2: crea un array di caratteri da cui scegliere
Raccogli una stringa con tutti i caratteri validi e anche uno alla fine che non vogliamo (ne parleremo più avanti). Il 63
raccolto precedente corrisponde a questa lunghezza della stringa. Portalo a Chop Suey per farlo rompere in singoli passeggeri.
Piano B: sposta l'array in modo che possiamo selezionare un personaggio
Uno alla volta, sposta tutti i personaggi su Narrow Path Park. È l'unico stack disponibile e l'unico modo per non intralciare i passeggeri rimasti. Tutto il resto a Townsburg è FIFO, quindi dovrei tornare indietro e cancellare tutti i passeggeri ogni iterazione del ciclo generale. In questo modo, posso lasciarli al parco e ogni volta verranno allontanati dai 63 nuovi personaggi. A
È probabile che il primo non scapperà mai .
Piano C: preparare la selezione di un personaggio
Questo è in realtà solo alcune fermate che non avevano bisogno di essere nel Piano D. Riposizionare il taxi in preparazione.
Piano D: Ottieni tutti i personaggi che non vogliamo
Partendo dal primo personaggio nella "matrice" inversa (questo è il 63 ° carattere che non vogliamo), continua a raccogliere e concatenare i personaggi mentre contiamo dal risultato della mod
funzione nel piano A. Una volta colpito zero, il personaggio successivo è quello che desideri.
Piano E: annega quelli che non vuoi e restituisci quello scelto.
"[P] gli assalitori lasciati cadere al Ponte di Riverview sembrano sempre cadere sul lato e nel fiume ..." Bene, questo si sbarazza di quella serie di perdenti concatenati. Vai a prendere il personaggio successivo e inviarlo a stdout. Infine, controlliamo quanti caratteri abbiamo stampato finora. Torna a Sunny Skies per raccogliere il valore di stdin che abbiamo lasciato tanto tempo fa. Sottrai uno e, se il risultato è maggiore di zero, rispediscilo in attesa e ricomincia dal piano A.