days
以下に示すように、とtrips
、および曜日の2 つの Ruby 配列があります。
days = ["Monday", "Tuesday", "Wednesday","Thursday","Friday","Saturday","Sunday"]
バスの時刻表はこちら:
trips = [
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm",
"2.35pm","4.50pm","7.00pm"
]
達成しようとしている結果は次のとおりです。
Bus-times = [
"Monday","2.35pm","4.50pm","7.00pm",
"Tuesday","2.35pm","4.50pm","7.00pm",
"Wednesday","2.35pm","4.50pm","7.00pm",
"Thusday","2.35pm","4.50pm","7.00pm",
"Friday","2.35pm","4.50pm","7.00pm",
"Saturday","2.35pm","4.50pm","7.00pm",
"Sunday""2.35pm","4.50pm","7.00pm"
]
私はインターリーブを見てきましたがzip
、独自の関数を記述しない場合にのみ最初の結果を返します。他にどのようなオプションがありますか?