لینک مسئله: غواصی کن ( Dive )

سلام! اگر غلط املایی یا علمی توی متن وجود داشت حتما بگید تا اصلاحش کنم، پیشاپیش با تشکر از توجهتون :)
Now, you need to figure out how to pilot this thing. It seems like the submarine can take a series of commands likeforward,down, orup:
حالا میخوایم بفهمیم چطور باید این (زیردریایی) رو هدایت کنیم. خب به نظر میرسه که زیردریایی توانایی انجام یک سری از دستورات رو داره مثل جرکت به جلو ( forward )، پایین ( down ) و بالا ( up ).
forward X: increases the horizontal position byXunits.down X: increases the depth byXunits.up X: decreases the depth byXunits.
Note that since you're on a submarine, down and up affect your depth, and so they have the opposite result of what you might expect.
توجه کنید از اونجایی که داخل یک زیردریایی هستید پس "بالا" و " پایین"، عمق شما رو به صورت عکس اون چیزی که انتظاز دارید تغییر میده
The submarine seems to already have a planned course (your puzzle input). You should probably figure out where it's going. For example:
خب ! به نظر میرسه زیر دریایی، یک برنامه مشخص داره (پازلی که شما باید حلش کنید). شما باید بفهمید که (زیردریایی) داره کجا میره. مثلا :
forward 5 down 5 forward 8 up 3 down 8 forward 2
Your horizontal position and depth both start at 0. The steps above would then modify them as follows:forward 5adds5to your horizontal position, a total of5.down 5adds5to your depth, resulting in a value of5.forward 8adds8to your horizontal position, a total of13.up 3decreases your depth by3, resulting in a value of2.down 8adds8to your depth, resulting in a value of10.forward 2adds2to your horizontal position, a total of15.
مکان افقی و عمودی شما از صفر شروع میشه (یعنی در موقعیت 0و0 قرار دارید) خب اعدادی که بالا هستند، موقعیت شما رو به این صورت تغییر میدن:
After following these instructions, you would have a horizontal position of 15 and a depth of 10. (Multiplying these together produces 150.)
بعد از ایننکه این مراحل رو دنبال کردید، مکان 15 و عمق میشه 10 (ضرب این دو عدد در هم میشه 150 تا)
Calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
طول(مکان افقی) و عمق رور بعد از این مراحل حساب کنید. وقتی که به مکان آخر رسیدید، مکان افقی و عمق نهایی رو در هم ضرب کنید. اگر اینکارو بکنی خروجی ات چی میشه؟
خروجی رو توی قسمت جواب بنویسید و بعد از این که تایید شد مسئله دوم واستون باز میشه
Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.
بر اساس محاسبه هایی که انجام دادی، به نظر میرسه این دستورات معنی دیگه میده. دنبال راهنمای زیردریایی گشتی و فهمیدی که نحوه پردازش دستور ها یکم فرق میکنه.
In addition to horizontal position and depth, you'll also need to track a third value, aim, which also starts at 0. The commands also mean something entirely different than you first thought:
علاوه بر عمق و مکان افقی زیردریایی، نیاز به ی مقدار دیگه هم داری ( به نام هدف - aim ) که اونم از 0 شروع میشه.این دستورها حالا کاملا با اون چیزی که فکر میکردی معنیش متفاوت میشه.
down Xincreases your aim byXunits.up Xdecreases your aim byXunits.forward Xdoes two things :
- It increases your horizontal position byXunits.
- It increases your depth by your aim multiplied byX.
Again note that since you're on a submarine, down and up do the opposite of what you might expect: "down" means aiming in the positive direction.
مثل دفعه قبل، از اون جایی که تو توی زیردریایی هستی، دستور "بالا" و "پایین" بر خلاف چیزی هستن که انتظار داری. پایین یعنی این که هدف رو به جهت مثبت هدایت کنی.
Now, the above example does something different:
*forward 5adds5to your horizontal position, a total of5. Because your aim is0, your depth does not change.
*down 5adds5to your aim, resulting in a value of5.
*forward 8adds8to your horizontal position, a total of13. Because your aim is5, your depth increases by8*5=40.
*up 3decreases your aim by3, resulting in a value of2.
*down 8adds8to your aim, resulting in a value of10.
*forward 2adds2to your horizontal position, a total of15. Because your aim is10, your depth increases by2*10=20to a total of60.
با توجه به مثالی که زدیم حالا این دستور ها معنی دیگه ای میده:
After following these new instructions, you would have a horizontal position of 15 and a depth of 60. (Multiplying these produces 900.)
بعد از اینکه این عملیات ها تموم شد، "مکان افقی" ات میشه 15 و "عمق" ات میشه 60 که اگر ضربشون کنی جواب میشه 900.
Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
با ورودی خودت هم اینکارو بکن. جواب نهایی چی میشه؟
منابع استفاده شده:
در انتها تشکر از دوستم آقای محمدحسین براتی که توی ترجمه این قسمت کمکم کرد. ❤