Taksi , 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]
Cobalah online!
Taksi super tidak dibuat untuk ini tetapi Anda bisa melakukannya! Saya akan mencoba menjelaskan apa yang terjadi di bawah versi un-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]
Mulai: Dapatkan stdin
Ambil nilai stdin sebagai teks, konversikan ke angka, dan tempelkan di suatu tempat untuk menunggu.
Rencanakan A Bagian 1: Dapatkan bilangan bulat acak 1-62
Dapatkan bilangan bulat acak dan dapatkan 62
sebagai angka. Gandakan bilangan bulat acak dan 62
karena kita akan membutuhkannya nanti. Anda hanya dapat membawa 3 penumpang sekaligus jadi kita berakhir dengan rand
, rand
, dan 62
. (Yang lain 62
akan menunggu sampai kita kembali.) Go membagi rand
oleh 62
dan memotong hasilnya untuk mendapatkan integer. Kembali untuk mendapatkan salinan lain 62
dan kalikan dengan integer terpotong dari divisi. Akhirnya, kurangi produk dari salinan pertama rand
. Ini memberi kita angka 0-61. Sekarang kita harus kembali ke pickup a 1
dan menambahkannya ke hasil untuk mendapatkan nomor 1-62. Ya, semua banyak baris teks itu adil mod(rand(),62)+1
.
Plan A Bagian 2: Buat array karakter untuk memilih
mengambil string dengan semua karakter yang valid dan juga satu di akhir yang tidak kita inginkan (lebih lanjut tentang itu nanti). The 63
kami mengambil pertandingan sebelumnya panjang string ini. Bawa ke Chop Suey untuk membobolnya menjadi penumpang individu.
Plan B: Pindahkan array sehingga kita dapat memilih karakter
Satu per satu, pindahkan setiap karakter ke Narrow Path Park. Ini satu-satunya tumpukan yang tersedia dan satu-satunya cara agar penumpang yang tersisa tidak menghalangi. Segala sesuatu yang lain di Townsburg adalah FIFO jadi saya harus kembali dan membersihkan semua penumpang setiap iterasi dari keseluruhan loop. Dengan cara ini, saya bisa meninggalkan mereka di taman dan mereka akan diusir oleh 63 karakter baru setiap saat. Yang paling pertama A
adalah kemungkinan untuk tidak pernah melarikan diri .
Paket C: Bersiaplah untuk memilih karakter
Ini benar-benar hanya beberapa pemberhentian yang tidak perlu ada dalam Rencana D. Atur ulang posisi taksi dalam persiapan.
Paket D: Dapatkan semua karakter yang tidak kita inginkan.
Mulai dengan karakter pertama dalam "array" terbalik (ini adalah karakter ke-63 yang tidak kita inginkan), terus mengambil dan menggabungkan karakter saat kita menghitung mundur dari hasil mod
fungsi di Plan A. Setelah Anda mencapai nol, karakter berikutnya adalah yang Anda inginkan.
Paket E: Tenggelam yang tidak Anda inginkan dan kembalikan yang terpilih.
"Para pengendara yang jatuh di Riverview Bridge tampaknya selalu jatuh ke samping dan ke dalam sungai ..." Ya, itu menghilangkan rentetan pecundang. Pergi ambil karakter berikutnya dan kirim ke stdout. Akhirnya, mari kita periksa berapa banyak karakter yang telah kita cetak sejauh ini. Kembali ke Sunny Skies untuk mengambil nilai stdin yang kami tinggalkan sejak lama. Kurangi satu dan, jika hasilnya lebih dari nol, kirim kembali untuk menunggu dan mulai lagi dari Rencana A.