Taksi , 2577 bayt
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]
Çevrimiçi deneyin!
Taksi bunun için yapılmış süper değil ama yapabilirsiniz! Golf edilmemiş versiyonun altında neler olduğunu açıklamaya çalışacağım.
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]
Başlat: stdin'i alın Stdin
değerini metin olarak alın , sayıya dönüştürün ve beklemek için bir yere yapıştırın.
Bölüm 1 Planlayın: Rastgele bir tamsayı
alın 1-62 Rastgele bir tamsayı alın ve sonra 62
bir sayı olarak alın . Hem rastgele tamsayıyı hem de çoğaltın, 62
çünkü daha sonra onlara ihtiyacımız olacak. Yalnızca biz ile bitirmek böylece tek seferde 3 yolcu taşıyabilen rand
, rand
ve 62
. (Başka 62
Biz dönene kadar beklemek olacaktır.) Git bölünmeyi rand
tarafından62
ve bir tamsayı olsun sonuç kesecek. Diğer kopyasını almak için geri dönün 62
ve bölümdeki kesilmiş tam sayı ile çarpın. Son olarak, ürünü ilk kopyasından çıkarın rand
. Bu bize 0-61 sayısı verir. Şimdi 1
a'yı almak için geri dönüp 1-62 sayısını almak için sonuca eklemeliyiz. Evet, bütün bu metin satırları sadece mod(rand(),62)+1
.
2. Bölümü Planlayın:
Tüm geçerli karakterlerin bulunduğu bir dize seçin ve sonunda istemediğimiz bir karakter dizisi seçilecek bir karakter dizisi oluşturun (bundan sonra daha fazlası). Daha 63
önce aldığımız bu dizge uzunluğuyla eşleşiyor. Bireysel yolculara bölünmesi için Chop Suey'e götürün.
Plan B: Diziyi, karakterleri
tek tek seçebilmemiz için , her karakteri Dar Yol Parkına getirin. Mevcut tek yığın ve artık yolcuların yoluna çıkmamasının tek yolu. Townsburg'daki her şey FIFO'dur, bu yüzden geri dönüp tüm yolcuları genel döngünün her yinelemesinden çıkarmak zorunda kalacağım. Bu sayede onları sadece parkta bırakabilirim ve her seferinde 63 yeni karakterle yoldan çekilecekler. İlk A
muhtemeldir kaçmak asla .
Plan C: Bir karakter seçmeye hazırlanın
Bu gerçekten Plan D'de olması gerekmeyen birkaç duraktır. Taksiyi hazırlığa alın.
Plan D: Hepimizin karakterler al daha dont istiyorum
, biz sonucundan saymak gibi alıp karakterleri birleştirerek tutmak "dizi" ters ilk karakterin ile başlayarak (bu biz istemiyoruz 63 karakterdir) mod
fonksiyonu Plan A'da sıfıra bastığınızda, bir sonraki karakter istediğiniz karakterdir.
Plan E: İstemediklerinizi boğun ve seçilene geri dönün.
“[P] görevlileri Riverview Bridge'e düştü, her zaman yanlara ve nehre düşüyor gibi görünüyor…” Eh, bu birleşmiş kaybedenler dizisinden kurtuldu. Git bir sonraki karakteri al ve stdout'a gönder. Son olarak, şu ana kadar kaç karakter bastığımızı kontrol edelim. Çok uzun zaman önce bıraktığımız stdin değerini almak için Sunny Skies'a dönelim. Birini çıkarın ve sonuç sıfırdan fazla ise, beklemek ve Plan A'da tekrar başlamak için geri gönderin.