En
stringlengths 1
23.4k
| Ar
stringlengths 1
17.3k
| EN_word_count
int64 1
4.01k
| AR_word_count
int64 0
3.19k
|
---|---|---|---|
If it's equal to or below the level of the column in question, | إذا كانت النتيجة أكثر ارتفاعًا من العمود المدروس، | 13 | 8 |
the energy would spill off. | قم بطرح الطول من العمود الأصلي، | 5 | 6 |
Hedge can apply that to an entire basin with a loop | وستكون النتيجة عبارة عن عدد الوحدات التي يمكن للعمود أن يحملها. | 11 | 11 |
that starts on the left-most column and moves right, one column at a time. | إذا كان مساويًا أو أقل من مستوى العمود المدروس، | 14 | 9 |
For each column, he’ll run the same steps— look all the way left for the tallest, | ستنسكب الطاقة خارجًا. | 16 | 3 |
do the same to the right, take the lower height of the two, | يمكن لهيدج تطبيق كامل رزمة أحجار بوساطة دالة التكرار | 13 | 9 |
subtract the original column height, | حيث تبدأ بالعمود أقصى اليسار والتحرك باتجاه اليمين، عمودًا واحدًا على التوالي. | 5 | 12 |
and increase the grand total if that number is positive. | سيقوم بتكرار الخطوات نفسها لكل عمود ... باحثًا أقصى اليسار على الأطول، | 10 | 12 |
His loop will repeat as many times as there are columns. | وسيكرر العمل بالنسبة لليمين، سيأخذ الأقصر من بين الاثنين، | 11 | 9 |
That will work, but it’ll take a long time for a large basin. | سيطرح طول العمود الأصلي، | 13 | 4 |
At every step Hedge repeats the action of looking left and looking right. | وسيزيد المحصلة الكلية إن كان الرقم موجب. | 13 | 7 |
If there are N stacks, he’ll look at all N stacks N times. | ستتكرر الدالة بعدد الأعمدة المتواجدة. | 13 | 5 |
Is there a faster way? | سينجز هذا ولكنه سيحتاج وقتًا طويلًا من أجل أحجار ضخمة. | 5 | 10 |
Here’s one time saver: before doing anything else, | يكرر هيدج في كلِ خطوةٍ البحث يسرةً ويمنةً. | 8 | 8 |
Hedge can start on the left, | إذا كان هنالك عدد 'ن' من الرزم، سيفحص كل الـرزم 'ن' بمقدار 'ن' من وقت. | 6 | 15 |
and keep a running tally of what the highest stack is. | هل هنالك طريقةً أسرع؟ | 11 | 4 |
Here that would be 2, 2 again, since the first was higher, | إليك ما يحفظ الوقت: قبل القيام بأي شيءٍ آخر، | 12 | 9 |
then 4, 4, 4. | يستطيع هيدج البدء من اليسار، | 4 | 5 |
He can then find the highest right-most stacks | ويستمر بالبحث عن الرزمة الأعلى ارتفاعًا. | 8 | 6 |
by doing the same going right-to-left: 1, 3, 4, 4, 4. | قد يكون هنا اثنان واثنان مجددًا، حيث الأول كان أطول، | 11 | 10 |
In the end he’ll have a table like this in his memory. | ثم تأتي أربع وأربع وأربع. | 12 | 5 |
Now, Hedge can take one more pass to calculate how much energy there will be | ثم يمكنه إيجاد أطول الرزم يمنةً | 15 | 6 |
above every stack with the same equation from before: | من خلال القيام بذات الأمر منتقلًا من اليمين إلى اليسار 4،4،4،3،1. | 9 | 11 |
take the smaller of the stored left and right values, | في النهاية سيحصل على جدول يشبه هذا في ذاكرته. | 10 | 9 |
and subtract the height of the current tower. | الآن، يمكن لهيدج أن يقوم بتمريرة واحدة إضافية لحساب مقدار الطاقة المتواجدة | 8 | 12 |
Instead of looking at N stacks N times, he’ll look at N stacks just 3 times— | فوق كل رزمة باستخدام ذات المعادلة السابقة: | 16 | 7 |
which is what’s called linear time. | قم بأخذ الأصغر من المخزن من قيم اليسار واليمين، | 6 | 9 |
There are ways to optimize the solution even further, | واطرح الارتفاع من البرج الحالي. | 9 | 5 |
but this is good enough for our heroes. | بدل التدقيق بعدد 'ن' من الرزم بما يعادلها بالوقت، سيدقق ذات العدد لـ 3 مراتٍ فقط... | 8 | 16 |
Ethic and Hedge work as one. | وهذا ما يدعى بالوقت الخطي. | 6 | 5 |
The first cascade is a breeze, and they rise up the tower. | هنالك طرق لتحسين الحل أكثر من ذلك، | 12 | 7 |
The second is a little tougher. | ولكن هذا كافٍ بالنسبة لأبطالنا. | 6 | 5 |
The third is huge, with dozens of stacks of blocks. | يتعاضد كلٌ من إيثيك وهيدج. | 10 | 5 |
The timer ticks down towards zero, but Ethic’s program is fast. | الشلال الأول كان سهلا للغاية وصعدوا طابقا إضافيا في البرج. | 11 | 10 |
She gets the wheel in position just in time, | كان الشلال الثاني أكثر صعوبة. | 9 | 5 |
and the energy lifts them to the Node of Creation. | كان الثالث ضخمًا، باحتوائه على دزينة من رزم الأحجار. | 10 | 9 |
Like the first, it reveals a vision: memories of years gone by. | أشار المؤقت بالعد التنازلي باتجاه الصفر، ولكن برمجة إيثيك سريعة. | 12 | 10 |
The world machine changed everything, | وضعت العجلة في مكانها بالوقت المناسب، | 5 | 6 |
and Ethic, in her position as chief robotics engineer, | وقامت الطاقة برفعهما لـ "عقدة الإبداع." | 9 | 6 |
grew troubled by what she saw. | كما حدث بالأولى، كشفت عن رؤية: ذكرياتٍ من سنين مضت. | 6 | 10 |
When the Bradbarrier went up to keep the people in, | بدلت الآلة العالمية كلَ شيء، | 10 | 5 |
she knew something was seriously wrong. | وإيثيك، في موضعها كرئيسة المهندسين الآليين، | 6 | 6 |
So she created three artifacts | تشعر بالقلق لما رأت. | 5 | 4 |
with the ability to restore people’s power, creativity, and memory, | عندما صعد حاجز براد لإبقاء الأشخاص في الداخل، | 10 | 8 |
and smuggled them to three communities. | علمت أن هنالك شيءٌ خاطئ بشكلٍ بالغٍ يحدث. | 6 | 8 |
Before she could tell people how to use them, | لذلك قامت بصنع ثلاث قطعٍ فنيةٍ | 9 | 6 |
the government discovered her efforts and sent bots to arrest her | قادرةٍ على إعادة القوة والإبداع والذاكرة للأشخاص. | 11 | 7 |
and the other programmers. | وقامت بتهريبهم لثلاث مجتمعات. | 4 | 4 |
The last thing Ethic used the world machine to create | قبل أن تستطيع إخبار الناس بكيفية استخدامهم، | 10 | 7 |
was a robot that would protect the ancient device | اكتشفت الحكومة جهودها فأرسلت رجال آليين لاعتقالها | 9 | 7 |
from the forces of ignorance by enclosing it in a giant maze. | هي والمبرمجين الآخرين. | 12 | 3 |
She named her creation Hedge. | الشيء الأخير الذي صنعته إيثيك باستخدام الآلة العالمية | 5 | 8 |
Without warning, the energy lift flickers, then fizzles out. | كان عبارة عن رجلٍ آلي سيقوم بحماية الألة القديمة | 9 | 9 |
plot out how they can steal an artifact called the Node of Power. | إيثيك، وهيدج، وأديلة؛ قادة الثورة، | 13 | 5 |
It’s being used to run a heavily fortified train that runs all around the country, | أعدوا خطة تمكنّهم من الاستيلاء على قطعة من التُّحف تُدعى "عقدة القوة". | 15 | 12 |
providing supplies to settlements and facilities. | ويجري استخدامها في تشغيل قطار ضخم ومحصّن يمشي في أرجاء البلاد، | 6 | 11 |
This armored behemoth | يزوّد المستوطنات والمنشآت بالإمدادات. | 3 | 4 |
undergoes a complex and unpredictable unloading procedure— | هذا الوحش الضخم المدرّع يتحمّل عملية معقدة | 7 | 7 |
a procedure which is displayed, in detail, on a screen within the engine car. | وغير محددة من عمليات التفريغ... | 14 | 5 |
Right means the train will go one car length forward, | تلك العملية التي تظهر بالتفصيل على شاشة في عربة المحرّك. | 10 | 10 |
and left means the train will go the same distance backwards. | "يمينًا" تعني أن القطار سيزيد بمسافة سيارة واحدة إلى الأمام، | 11 | 10 |
While unloading, the train frequently moves back and forth, | و"يسارًا" تعني أن القطار سيزيد بنفس المسافة إلى الخلف. | 9 | 9 |
so a typical sequence might look like this. | أثناء عملية التفريغ، يتحرك القطار تكرارًا إلى الخلف وإلى الأمام، | 8 | 10 |
Also within the engine car is a button that can only be pressed once. | وبالتالي فإن التسلسل النموذجي ينبغي أن يجري على هذا النحو. | 14 | 10 |
When pressed, it lets down the force field over the artifact for 10 seconds. | وأيضًا، في عربة المحرّك زرٌّ من شأنه أن يُكبس لمرة واحدة. | 14 | 11 |
The engine car is tiny and designed for a robot. | حين يُكبس، فإن من شأنه تقليل سرعة حقل القوة "عقدة القوة" لعشرة ثوانٍ. | 10 | 13 |
Of your team, only Hedge can fit. | إن عربة المحرّك ضئيلة ومصمّمة خصيصًا لآليٍّ (روبوت). | 7 | 8 |
The members of the resistance have positioned a crane over the train tracks | الآلي هيدج يخضع فقط لسيطرة فريقه. | 13 | 6 |
that can pluck the artifact once it’s exposed. | أفراد المقاومة نصّبوا رافعة على مسارات القطار | 8 | 7 |
They’ll know when to lower the crane by sight. | من شأن هذه الرافعة أن تنتشل القطعة متى انكشفت لها. | 9 | 10 |
But the only way Hedge can determine the train’s position | وسيحددون توقيت خفض الرافعة من خلال المشاهدة. | 10 | 7 |
and know when to lower the force field | ولكن الطريقة الوحيدة التي يستطيع بها هيدج أن يحدد موضع القطار | 8 | 11 |
is by analyzing the unloading procedure, | وتوقيت خفض الرافعة إلى حقل القوة | 6 | 6 |
because he’ll be inside the windowless engine car. | ستكون من خلال تحليل بيانات عملية التفريغ، | 8 | 7 |
Hedge can’t program himself though, so it’s up to Ethic to tell him what to do. | لأنه سيكون داخل عربة القطار الخالية من أية منافذ. | 16 | 9 |
The artifact is in the car 10 positions behind | ولأن هيدج لا يستطيع برمجة نفسه، فسيكون على إيثيك توجيهه للقيام بالعلمية. | 9 | 12 |
the one that’s directly under the crane at the start. | تتموضع القطعة في العربة رقم 10 | 10 | 6 |
What instructions can Ethic give Hedge | خلف العربة المواجهة مباشرة للرافعة عند البداية. | 6 | 7 |
so that he hits the button at just the right moment? | فما عسى التوجيهات التي تعطيها إيثيك إلى هيدج | 11 | 8 |
Here’s a hint to get you started. | لكي يكبس الزرّ في اللحظة المناسبة؟ | 7 | 6 |
The key to this problem, as with many programming challenges, | "توقف الآن لتقرر هذا بنفسك!" | 10 | 5 |
is to reframe the information in a way that a computer can work with. | هذا هو توجيه بدء العملية. | 14 | 5 |
A computer doesn’t know what a train is, nor does it need to. | إن حل هذه المشكلة، كما الحال بالنسبة لكثير من تحديات البرمجة، | 13 | 11 |
It can, however, work with variables. | هو بإعادة تأطير المعلومات على نحو ما يمكن للحاسوب التعاطي معها. | 6 | 11 |
Try making a variable that tracks the train’s position. | فالحاسوب ليس من شأنه أن يعرف ماهية القطار، ولا ماذا يحتاج. | 9 | 11 |
How will it change as the train moves? | ومع ذلك، فإن من شأنه أن يعمل مع المتغيرات. | 8 | 9 |
Let’s start by breaking this problem into two objectives. | حاول أن تصوغ متغيرًا يتتبع موضع القطار. | 9 | 7 |
The first is to know where the train will be as it carries out its instructions. | كيف سيتغير بينما يتحرّك القطار؟ | 16 | 5 |
The second is to hit the button when the train is in just the right position. | لنبدأ بتقسيم هذه المشكلة في هدفين اثنين. | 16 | 7 |
For the first objective it’ll help to think of the train as a big number line. | الأول، يتمثل في معرفة مكان توقّف القطار حين ينفّذ التعليمات التي يتلقاها. | 16 | 12 |
Let’s make 0 the car with the node, 1 the car in front of it, and so on. | والثاني، ينصرف إلى كبس الزرّ بينما القطار في الموضع الصحيح. | 18 | 10 |
That means car 10 is under the crane at the start. | للتعامل مع الهدف الأول، فإن تحقيقه يتطلب التفكيرَ في القطار كسلسلة رقمية كبيرة. | 11 | 13 |
When the train moves one car right, car 9 is under the crane. | لنجعل العربة رقم صفر هي عربة "العقدة"، والعربة رقم 1 هي التي تليها، وهلم جرا. | 13 | 15 |
So a right arrow can be thought of as “subtract 1.” | هذا يعني أن العربة رقم 10 هي العربة التي تعلوها الرافعة عند البداية. | 11 | 13 |
And when the train moves left from there, | وحين يتحرك القطار مسافة عربة واحدة إلى الأمام، تكون العربة 9 أسفل الرافعة. | 8 | 13 |
10 is back under the crane, | وبالتالي، فإن سهمًا إلى اليمين يمكن فهمه على أنه "انتقاص لمسافة عربة واحدة". | 6 | 13 |
making a left arrow the same as “add 1." | وحين يتحرّك القطار يسارًا من هناك، ستعود العربة رقم 10 أسفل الرافعة. | 9 | 12 |
Let’s set our train position variable to 10, since that’s where we start. | وإشارة السهم إلى اليسار ستُفهم على أنها "زيادة لمسافة عربة واحدة". | 13 | 11 |
We can now use a loop to read the instructions one at a time, | لنضبط متغير موضع القطار حتى العربة رقم 10، حيث المكان الذي بدأنا منه. | 14 | 13 |
adding or subtracting as we go, to track which car is under the crane. | والآن يمكننا استخدام لوحة لقراءة التعليمات تباعًا. | 14 | 7 |
Subsets and Splits