chore(i18n,learn): processed translations (#53340)

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
This commit is contained in:
camperbot
2024-01-25 00:22:36 +05:30
committed by GitHub
parent cf1e5b8115
commit df4e5f7aca
26971 changed files with 288871 additions and 206689 deletions

View File

@@ -4,13 +4,18 @@ certification: javascript-algorithms-and-data-structures-v8
challengeType: 7
isPrivate: true
tests:
- id: 657bdc55a322aae1eac3838f
-
id: 657bdc55a322aae1eac3838f
title: Build a Palindrome Checker
- id: 657bdc8ba322aae1eac38390
-
id: 657bdc8ba322aae1eac38390
title: Build a Roman Numeral Converter
- id: 657bdcb9a322aae1eac38391
-
id: 657bdcb9a322aae1eac38391
title: Build a Telephone Number Validator
- id: 657bdcc3a322aae1eac38392
-
id: 657bdcc3a322aae1eac38392
title: Build a Cash Register
- id: 6555c1d3e11a1574434cf8b5
-
id: 6555c1d3e11a1574434cf8b5
title: Build a Pokémon Search App

View File

@@ -17,7 +17,7 @@ background: linear-gradient(gradient_direction, color 1, color 2, color 3, ...);
The first argument specifies the direction from which color transition starts - it can be stated as a degree, where `90deg` makes a horizontal gradient (from left to right) and `45deg` makes a diagonal gradient (from bottom left to top right). The following arguments specify the order of colors used in the gradient.
Example:
مثال:
```css
background: linear-gradient(90deg, red, yellow, rgb(204, 204, 255));

View File

@@ -19,7 +19,7 @@ This reduces the total number of possible colors to around 4,000. But browsers w
Go ahead, try using the abbreviated hex codes to color the correct elements.
<table><tbody><tr><th>Color</th><th>Short Hex Code</th></tr><tr><td>Cyan</td><td><code>#0FF</code></td></tr><tr><td>Green</td><td><code>#0F0</code></td></tr><tr><td>Red</td><td><code>#F00</code></td></tr><tr><td>Fuchsia</td><td><code>#F0F</code></td></tr></tbody></table>
<table><tbody><tr><th>اللون</th><th>Short Hex Code</th></tr><tr><td>Cyan</td><td><code>#0FF</code></td></tr><tr><td>Green</td><td><code>#0F0</code></td></tr><tr><td>Red</td><td><code>#F00</code></td></tr><tr><td>Fuchsia</td><td><code>#F0F</code></td></tr></tbody></table>
# --hints--

View File

@@ -19,7 +19,7 @@ In the `penguin` class, change the `black` value to `gray`, the `gray` value to
# --hints--
`penguin` class should declare the `--penguin-skin` variable and assign it to `gray`.
الـ class الذي اسمه `penguin` يجب أن يحدث له declare إلى مُتغير الـ `--penguin-skin` وتعيين قيمته إلى `gray`.
```js
assert(

View File

@@ -23,7 +23,7 @@ The digit `F` is the highest number in hex code, and represents the maximum poss
Replace the color words in our `style` element with their correct hex codes.
<table><tbody><tr><th>Color</th><th>Hex Code</th></tr><tr><td>Dodger Blue</td><td><code>#1E90FF</code></td></tr><tr><td>Green</td><td><code>#00FF00</code></td></tr><tr><td>Orange</td><td><code>#FFA500</code></td></tr><tr><td>Red</td><td><code>#FF0000</code></td></tr></tbody></table>
<table><tbody><tr><th>اللون</th><th>Hex Code</th></tr><tr><td>Dodger Blue</td><td><code>#1E90FF</code></td></tr><tr><td>Green</td><td><code>#00FF00</code></td></tr><tr><td>Orange</td><td><code>#FFA500</code></td></tr><tr><td>Red</td><td><code>#FF0000</code></td></tr></tbody></table>
# --hints--

View File

@@ -17,7 +17,7 @@ Add the CSS property `flex-direction` to the header's `.profile-name` element an
# --hints--
Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
كود `.follow-btn` الخاص بك يجب أن يتم عرضه على الصفحة. تأكد من إيقاف تشغيل أي اضافات مثل مانعي الإعلانات ad blockers.
```js
assert($('.follow-btn').length > 0 && $('.follow-btn').css('display') !== 'none');

View File

@@ -17,7 +17,7 @@ Add the CSS property `flex-direction` to both the `header` and `footer` and set
# --hints--
Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
كود `.follow-btn` الخاص بك يجب أن يتم عرضه على الصفحة. تأكد من إيقاف تشغيل أي اضافات مثل مانعي الإعلانات ad blockers.
```js
assert($('.follow-btn').length > 0 && $('.follow-btn').css('display') !== 'none');

View File

@@ -17,7 +17,7 @@ Add the CSS property `align-items` to the header's `.follow-btn` element. Set th
# --hints--
Your `.follow-btn` should be rendered on the page. Be sure to turn off any extensions such as ad blockers.
كود `.follow-btn` الخاص بك يجب أن يتم عرضه على الصفحة. تأكد من إيقاف تشغيل أي اضافات مثل مانعي الإعلانات ad blockers.
```js
assert($('.follow-btn').length > 0 && $('.follow-btn').css('display') !== 'none');

View File

@@ -9,7 +9,7 @@ dashedName: limit-item-size-using-the-minmax-function
# --description--
There's another built-in function to use with `grid-template-columns` and `grid-template-rows` called `minmax`. It's used to limit the size of items when the grid container changes size. To do this you need to specify the acceptable size range for your item. Here is an example:
There's another built-in function to use with `grid-template-columns` and `grid-template-rows` called `minmax`. It's used to limit the size of items when the grid container changes size. To do this you need to specify the acceptable size range for your item. إليك مثال:
```css
grid-template-columns: 100px minmax(50px, 200px);

View File

@@ -19,7 +19,7 @@ This is what the lines look like for a 3x3 grid:
To control the number of columns an item will consume, you can use the `grid-column` property in conjunction with the line numbers you want the item to start and stop at.
Here's an example:
إليك مثال:
```css
grid-column: 1 / 3;

View File

@@ -41,7 +41,7 @@ ourPets[1].names[0];
# --instructions--
استخدم dot و علامات الأقواس, لتعيّن المتغير `secondTree` إلى العنصر الثاني في قائمة `trees` من object باسم `myPlants`.
Using dot and bracket notation, set the variable `secondTree` to the second element in the `list` array from the second object in the `myPlants` array.
# --hints--

View File

@@ -76,9 +76,9 @@ assert(code.match(/testObj\.\w+/g).length > 1);
```js
// Setup
const testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
hat: "ballcap",
shirt: "jersey",
shoes: "cleats"
};
// Only change code below this line
@@ -90,9 +90,9 @@ const shirtValue = testObj; // Change this line
```js
const testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
hat: "ballcap",
shirt: "jersey",
shoes: "cleats"
};
const hatValue = testObj.hat;

View File

@@ -8,7 +8,7 @@ dashedName: record-collection
# --description--
You are creating a function that aids in the maintenance of a musical album collection. The collection is organized as an object that contains multiple albums which are also objects. Each album is represented in the collection with a unique `id` as the property name. Within each album object, there are various properties describing information about the album. Not all albums have complete information.
You are creating a function that aids in the maintenance of a musical album collection. The collection is organized as an object that contains multiple albums which are also objects. Each album is represented in the collection with a unique `id` as the property name. Within each album object, there are various properties describing information about the album. ليست كل السجلات لديها معلومات كاملة.
The `updateRecords` function takes 4 arguments represented by the following function parameters:

View File

@@ -17,7 +17,7 @@ Consider this sentence:
It was really ____, and we ____ ourselves ____.
```
This sentence has three missing pieces- an adjective, a verb and an adverb, and we can add words of our choice to complete it. We can then assign the completed sentence to a variable as follows:
تحتوي هذه الجملة على ثلاث قطع مفقودة - صفة وفعل وظرف ، ويمكننا إضافة كلمات من اختيارنا لإكمالها. يمكننا بعد ذلك إسناد الجملة المكتملة إلى متغير على النحو التالي:
```js
const sentence = "It was really " + "hot" + ", and we " + "laughed" + " ourselves " + "silly" + ".";
@@ -25,21 +25,21 @@ const sentence = "It was really " + "hot" + ", and we " + "laughed" + " ourselve
# --instructions--
In this challenge, we provide you with a noun, a verb, an adjective and an adverb. You need to form a complete sentence using words of your choice, along with the words we provide.
في هذا التحدي، نقدم لكم اسماً وفعلاً ووصفاً وظرفاً. تحتاج إلى تكوين جملة كاملة باستخدام الكلمات التي تختارها، إلى جانب الكلمات التي نقدمها.
You will need to use the string concatenation operator `+` to build a new string, using the provided variables: `myNoun`, `myAdjective`, `myVerb`, and `myAdverb`. You will then assign the formed string to the `wordBlanks` variable. You should not change the words assigned to the variables.
سوف تحتاج إلى استخدام مشغل الـ string concatenation الآتي `+` لبناء string جديد، باستخدام المتغيرات المتاحة: `myNoun` و `myAdjective` و `myVerb` و `myAdverb`. ستقوم بعد ذلك بتعيين الـ string الذي تم تشكيله إلى متغير `wordBlanks`. لا يجب عليك تغيير الكلمات المسندة إلى المتغيرات.
You will also need to account for spaces in your string, so that the final sentence has spaces between all the words. The result should be a complete sentence.
سوف تحتاج أيضا إلى حساب المسافات الموجودة في سلسلتك، بحيث تحتوي الجملة الأخيرة على مسافات بين جميع الكلمات. وينبغي أن تكون النتيجة جملة كاملة.
# --hints--
`wordBlanks` should be a string.
`wordBlanks` يجب أن تكون string.
```js
assert(typeof wordBlanks === 'string');
```
You should not change the values assigned to `myNoun`, `myVerb`, `myAdjective` or `myAdverb`.
لا يجب عليك تغيير القيم المعينة إلى `myNoun` او `myVerb` او `myAdjective` أو `myAdverb`.
```js
assert(
@@ -50,7 +50,7 @@ assert(
);
```
You should not directly use the values `dog`, `ran`, `big`, or `quickly` to create `wordBlanks`.
يجب ألا تستخدم القيم `dog` او `ran` او `big` او `quickly` لإنشاء `wordBlanks`.
```js
const newCode = removeAssignments(code);

View File

@@ -8,7 +8,13 @@ dashedName: handle-a-fulfilled-promise-with-then
# --description--
الـ Promises مفيدة للغاية عندما تكون لديك عملية تستغرق قدرا غير معروف من الوقت في الكود الخاص بك (شيء غير متزامن)، غالبا ما يكون server request. عندما تقوم بـ server request يستغرق ذلك بعض الوقت، وبعد اكتمالها تريد عادة أن تفعل شيئا بالـ response المعادة من الـ server. يمكن تحقيق ذلك باستخدام method الـ `then`. يتم تنفيذ method الـ `then` مباشرة بعد الوفاء بالـ promise باستخدام `resolve`. إليك مثال:
الـ Promises مفيدة للغاية عندما تكون لديك عملية تستغرق قدرا غير معروف من الوقت في الكود الخاص بك (شيء غير متزامن)، غالبا ما يكون server request. عندما تقوم بـ server request يستغرق ذلك بعض الوقت، وبعد اكتمالها تريد عادة أن تفعل شيئا بالـ response المعادة من الـ server. يمكن تحقيق ذلك باستخدام method الـ `then`.
```js
Promise.prototype.then(onFulfilled, onRejected)
```
The `then` method schedules callback functions for the eventual completion of a Promise - either fulfillment or rejection. One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. When the promise is fulfilled with `resolve` the `onFulfilled` handler is called.
```js
myPromise.then(result => {

View File

@@ -19,7 +19,7 @@ setLastName(last)
setFullName(first, last)
```
قم بتشغيل الاختبارات لرؤية المخرجات المتوقعة لكل method. These methods must be the only available means of interacting with the object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
قم بتشغيل الاختبارات لرؤية المخرجات المتوقعة لكل method. يجب أن تكون هذه الـ methods هي الوسيلة الوحيدة المتاحة للتفاعل مع الـ object. Each test will declare a new `Person` instance as `new Person('Bob', 'Ross')`.
# --hints--

View File

@@ -12,7 +12,7 @@ dashedName: build-a-25--5-clock
**Objective:** Build an app that is functionally similar to this: <a href="https://25--5-clock.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://25--5-clock.freecodecamp.rocks</a>.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. أعطيها أسلوبك الشخصي الخاص.
You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!

View File

@@ -11,7 +11,7 @@ dashedName: build-a-drum-machine
**Objective:** Build an app that is functionally similar to this: <a href="https://drum-machine.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://drum-machine.freecodecamp.rocks/</a>.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. أعطيها أسلوبك الشخصي الخاص.
You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!

View File

@@ -11,7 +11,7 @@ dashedName: build-a-javascript-calculator
**Objective:** Build an app that is functionally similar to this: <a href="https://javascript-calculator.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://javascript-calculator.freecodecamp.rocks/</a>.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. أعطيها أسلوبك الشخصي الخاص.
You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!

View File

@@ -11,7 +11,7 @@ dashedName: build-a-markdown-previewer
**Objective:** Build an app that is functionally similar to this: <a href="https://markdown-previewer.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://markdown-previewer.freecodecamp.rocks/</a>.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. أعطيها أسلوبك الشخصي الخاص.
You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!
@@ -29,9 +29,9 @@ You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and
**Optional Bonus (you do not need to make this test pass):** My markdown previewer interprets carriage returns and renders them as `br` (line break) elements.
You can build your project by <a href='https://codepen.io/pen?template=MJjpwO' target="_blank" rel="noopener noreferrer nofollow">using this CodePen template</a> and clicking `Save` to create your own pen. Or you can use this CDN link to run the tests in any environment you like: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`
You can build your project by <a href='https://codepen.io/pen?template=MJjpwO' target="_blank" rel="noopener noreferrer nofollow">using this CodePen template</a> and clicking `Save` to create your own pen. أو يمكنك استخدام رابط CDN هذا لتشغيل الاختبارات في أي بيئة تفضلها: `https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js`
Once you're done, submit the URL to your working project with all its tests passing.
بمجرد أن تنتهي، ارسل عنوان URL لمشروع العمل الخاص بك مع اجتياز جميع الاختبارات.
# --solutions--

View File

@@ -11,7 +11,7 @@ dashedName: build-a-random-quote-machine
**Objective:** Build an app that is functionally similar to this: <a href="https://random-quote-machine.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://random-quote-machine.freecodecamp.rocks/</a>.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. أعطيها أسلوبك الشخصي الخاص.
You can use any mix of HTML, JavaScript, CSS, Bootstrap, SASS, React, Redux, and jQuery to complete this project. You should use a frontend framework (like React for example) because this section is about learning frontend frameworks. Additional technologies not listed above are not recommended and using them is at your own risk. We are looking at supporting other frontend frameworks like Angular and Vue, but they are not currently supported. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!

View File

@@ -16,7 +16,7 @@ dashedName: create-a-controlled-input
أولا، إنشاء طريقة تسمى `handleChange()` تحتوي على وسيط يسمى `event`. عندما يتم تسمية الطريقة، فإنها تتلقى كائن `event` يحتوي على سلسلة من النص من عنصر `input`. يمكنك الوصول إلى هذه السلسلة باستخدام `event.target.value` داخل الطريقة. حديث خاصية (property) تسمى `input` في `state` للمكون (component) مع هذا المقطع النصي (string) الجديدة.
في طريقة `render`، أنشئ عنصر `input` فوق علامة `h4`. أضف سمة (attribute) تسمى `value` تساوي خاصية (property) تسمى `input` في `state` للمكون (component). ثم أضف معالج الحدث `onChange()` إلى طريقة `handleChange()`.
في طريقة `render`، أنشئ عنصر `input` فوق علامة `h4`. أضف سمة (attribute) تسمى `value` تساوي خاصية (property) تسمى `input` في `state` للمكون (component). Then add an `onChange` property set to the `handleChange()` event handler method.
عندما تكتب في صندوق الإدخال (input)، يتم معالجة هذا النص بواسطة طريقة (method) تسمى `handleChange()`، تُعيين كخاصية (property) تسمى `input` في `state` المحلية، وتم أنتاجها كقيمة في صندوق `input` على الصفحة. تكون `state` المكون (component) المصدر الوحيد للحقيقة (single source of truth) فيما يتعلق ببيانات الإدخال (input).

View File

@@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-bar-chart
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at <https://github.com/d3/d3/blob/master/API.md#axes-d3-axis>. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at <https://d3js.org/d3-axis>. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects.
**User Story #1:** My chart should have a title with a corresponding `id="title"`.

View File

@@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-choropleth-map
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required DOM elements are queried on the moment of each test. في حال كُنت تستخدم مكتبة (frontend framework) مثل Vue، فإن نتائج الاختبار ربما تكون غير دقيقة بسبب أنَّ المحتوى ديناميكي. نتمنى أن نتوافق معهم في القريب العاجل، لكن هذه المكتبات غير مدعومة لمشاريع D3 حالياََ.
**User Story #1:** My choropleth should have a title with a corresponding `id="title"`.

View File

@@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-heat-map
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects.
يُمكنك استخدام HTML و JavaScript و CSS إلى جانب مكتبة D3. يجري الاستعلام عن كُل عٌنصر (DOM elements) في أثناء كُل اختبار. في حال كُنت تستخدم مكتبة (frontend framework) مثل Vue، فإن نتائج الاختبار ربما تكون غير دقيقة بسبب أنَّ المحتوى ديناميكي. نتمنى أن نتوافق معهم في القريب العاجل، لكن هذه المكتبات غير مدعومة لمشاريع D3 حالياََ.
**User Story #1:** My heat map should have a title with a corresponding `id="title"`.

View File

@@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-scatterplot-graph
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
يمكنك استخدام HTML و JavaScript و CSS و مكتبة التصوير المستندة D3. تطلب الاختبارات إنشاء المحاور (axes) باستخدام خاصية axis في D3، الذي يؤدي تِلْقائيًا إلى وضع علامات (ticks) على طول المحور. وهذه العلامات لازمة لاجتياز اختبارات D3, لأن مواقعها تُستخدم لتحديد محاذاة العناصر المرسومة بيانيٍ. ستجد معلومات حول إنشاء المحاور في <https://github.com/d3/d3/blob/master/API.md#axes-d3-axis>. Required DOM elements are queried on the moment of each test. إذا كنت تستخدم framework (مثل Vue على سبيل المثال)، قد تكون نتائج الاختبار غير دقيقة للمحتوى الديناميكي. ونأمل أن نستوعبها في المستقبل، ولكن هذه frameworks غير مدعومة حاليا لمشاريع D3.
يمكنك استخدام HTML و JavaScript و CSS و مكتبة التصوير المستندة D3. تطلب الاختبارات إنشاء المحاور (axes) باستخدام خاصية axis في D3، الذي يؤدي تِلْقائيًا إلى وضع علامات (ticks) على طول المحور. وهذه العلامات لازمة لاجتياز اختبارات D3, لأن مواقعها تُستخدم لتحديد محاذاة العناصر المرسومة بيانيٍ. You will find information about generating axes at <https://d3js.org/d3-axis>. Required DOM elements are queried on the moment of each test. إذا كنت تستخدم framework (مثل Vue على سبيل المثال)، قد تكون نتائج الاختبار غير دقيقة للمحتوى الديناميكي. ونأمل أن نستوعبها في المستقبل، ولكن هذه frameworks غير مدعومة حاليا لمشاريع D3.
**قصة المستخدم 1:** يمكنني أن أرى عنصر title مع موافقه `id="title"`.

View File

@@ -12,7 +12,7 @@ dashedName: visualize-data-with-a-treemap-diagram
Fulfill the below user stories and get all of the tests to pass. Use whichever libraries or APIs you need. Give it your own personal style.
You can use HTML, JavaScript, CSS, and the D3 svg-based visualization library. The tests require axes to be generated using the D3 axis property, which automatically generates ticks along the axis. These ticks are required for passing the D3 tests because their positions are used to determine alignment of graphed elements. You will find information about generating axes at <https://github.com/d3/d3/blob/master/API.md#axes-d3-axis>. Required DOM elements are queried on the moment of each test. If you use a frontend framework (like Vue for example), the test results may be inaccurate for dynamic content. We hope to accommodate them eventually, but these frameworks are not currently supported for D3 projects.
يُمكنك استخدام HTML و JavaScript و CSS إلى جانب مكتبة D3. الاختبارات تتطلب إنتاج المَحاور باستخدام خاصية axis في D3 والتي بدورها سَتُوَلد الخٌطوط البيانية موازيتاََ للمحور. وهذه الـخٌطوط البيانية لازمة لاجتياز اختبارات D3, لأن مواقعها تُستخدم لتحديد محاذاة العناصر المرسومة بيانياََ. You will find information about generating axes at <https://d3js.org/d3-axis>. يجري الاستعلام عن كُل عٌنصر (DOM elements) في أثناء كُل اختبار. في حال كُنت تستخدم مكتبة (frontend framework) مثل Vue، فإن نتائج الاختبار ربما تكون غير دقيقة بسبب أنَّ المحتوى ديناميكي. نتمنى أن نتوافق معهم في القريب العاجل، لكن هذه المكتبات غير مدعومة لمشاريع D3 حالياََ.
**User Story #1:** My tree map should have a title with a corresponding `id="title"`.

View File

@@ -8,7 +8,7 @@ dashedName: get-data-from-post-requests
# --description--
Mount a POST handler at the path `/name`. Its the same path as before. We have prepared a form in the html frontpage. It will submit the same data of exercise 10 (Query string). If the body-parser is configured correctly, you should find the parameters in the object `req.body`. Have a look at the usual library example:
قم بتوصيل المعالج POST على المسار `/name`. Its the same path as before. We have prepared a form in the html frontpage. It will submit the same data of exercise 10 (Query string). إذا تم تكوين body-parser بشكل صحيح، يجب أن تجد المعلمات (Parameters) في الكائن `req.body`. ألق نظرة على مثال المكتبة المعتاد:
<blockquote>route: POST '/library'<br>urlencoded_body: userId=546&#x26;bookId=6754 <br>req.body: {userId: '546', bookId: '6754'}</blockquote>
@@ -46,7 +46,7 @@ Test 1 : Your API endpoint should respond with the correct name
);
```
Test 2 : Your API endpoint should respond with the correct name
الاختبار 2: نقطة نهاية API الخاصة بك يجب أن ترسل استجابة بالاسم الصحيح
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb2367417b2b2512bf6
title: Get Query Parameter Input from the Client
title: الحصول على باراميتر Query المُدخل من المستخدم
challengeType: 2
forumTopicId: 301512
dashedName: get-query-parameter-input-from-the-client
@@ -8,13 +8,13 @@ dashedName: get-query-parameter-input-from-the-client
# --description--
Another common way to get input from the client is by encoding the data after the route path, using a query string. The query string is delimited by a question mark (?), and includes field=value couples. Each couple is separated by an ampersand (&). Express can parse the data from the query string, and populate the object `req.query`. Some characters, like the percent (%), cannot be in URLs and have to be encoded in a different format before you can send them. If you use the API from JavaScript, you can use specific methods to encode/decode these characters.
ومن الطرق الشائعة الأخرى للحصول على مدخلات من العميل باستخدام ترميز البيانات بعد مسار path باستخدام query string. تم تعيين سلسلة الاستعلام بواسطة علامة استفهام (?)، وتشمل حقل = أزواج القيمة. يتم فصل كل زوجين بواسطة علامة (&). يمكن لـ Express تحليل البيانات من Query String، وتعبئة الكائن `req.query`. بعض الأحرف، مثل النسبة المئوية (%)، لا يمكن أن تكون في عناوين URLs ويجب أن تكون مشفرة في تنسيق مختلف قبل أن تتمكن من إرسالها. إذا كنت تستخدم API من JavaScript، يمكنك استخدام أساليب محددة لترميز/فك شفرة هذه الأحرف.
<blockquote>route_path: '/library'<br>actual_request_URL: '/library?userId=546&#x26;bookId=6754' <br>req.query: {userId: '546', bookId: '6754'}</blockquote>
# --instructions--
Build an API endpoint, mounted at `GET /name`. Respond with a JSON document, taking the structure `{ name: 'firstname lastname'}`. The first and last name parameters should be encoded in a query string e.g. `?first=firstname&last=lastname`.
بناء نقطة نهاية API، محمولة على `GET /name`. الرد بمستند JSON، يأخذ البنية `{ name: 'firstname lastname'}`. يجب تشفير معلمات الاسم الأول والأخير في نص query على سبيل المثال `?first=firstname&last=lastname`.
**Note:** In the following exercise you are going to receive data from a POST request, at the same `/name` route path. If you want, you can use the method `app.route(path).get(handler).post(handler)`. This syntax allows you to chain different verb handlers on the same path route. You can save a bit of typing, and have cleaner code.

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb2367417b2b2512bf5
title: Get Route Parameter Input from the Client
title: الحصول على إدخال معلمة المسار من العميل
challengeType: 2
forumTopicId: 301513
dashedName: get-route-parameter-input-from-the-client
@@ -8,17 +8,17 @@ dashedName: get-route-parameter-input-from-the-client
# --description--
When building an API, we have to allow users to communicate to us what they want to get from our service. For example, if the client is requesting information about a user stored in the database, they need a way to let us know which user they're interested in. One possible way to achieve this result is by using route parameters. Route parameters are named segments of the URL, delimited by slashes (/). Each segment captures the value of the part of the URL which matches its position. The captured values can be found in the `req.params` object.
When building an API, we have to allow users to communicate to us what they want to get from our service. على سبيل المثال، إذا كان العميل يطلب معلومات عن مستخدم مخزّن في قاعدة البيانات، هم بحاجة إلى طريقة تمكننا من معرفة المستخدم الذي يهتمون به. ومن الطرق الممكنة لتحقيق هذه النتيجة استخدام route parameter. معلمات(Parameters) المسار تُسمّى أجزاء من عنوان URL، المحدد بالقطع (/). Each segment captures the value of the part of the URL which matches its position. يمكن العثور على القيم التي تم الحصول عليها في كائن `req.params`.
<blockquote>route_path: '/user/:userId/book/:bookId'<br>actual_request_URL: '/user/546/book/6754' <br>req.params: {userId: '546', bookId: '6754'}</blockquote>
# --instructions--
Build an echo server, mounted at the route `GET /:word/echo`. Respond with a JSON object, taking the structure `{echo: word}`. You can find the word to be repeated at `req.params.word`. You can test your route from your browser's address bar, visiting some matching routes, e.g. `your-app-rootpath/freecodecamp/echo`.
قم ببناء خادم استجابة محمول في المسار `GET /:word/echo`. الرد بكائن JSON يأخذ التركيب `{echo: word}`. يمكنك العثور على الكلمة المراد تكرارها في `req.params.word`. يمكنك اختبار مسارك من شريط عنوان المتصفح الخاص بك ، وزيارة بعض المسارات المطابقة ، على سبيل المثال `your-app-rootpath/freecodecamp/echo`.
# --hints--
Test 1 : Your echo server should repeat words correctly
الاختبار 1 : خادم الاستجابة الخاص بك يجب أن يكرر الكلمات بشكل صحيح
```js
(getUserInput) =>
@@ -36,7 +36,7 @@ Test 1 : Your echo server should repeat words correctly
);
```
Test 2 : Your echo server should repeat words correctly
الاختبار 2 : خادم الاستجابة الخاص بك يجب أن يكرر الكلمات بشكل صحيح
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb1367417b2b2512bf3
title: Implement a Root-Level Request Logger Middleware
title: تنفيذ برنامج وسيط(midleware) لمسجل الطلبات على مستوى الجذر
challengeType: 2
forumTopicId: 301514
dashedName: implement-a-root-level-request-logger-middleware
@@ -8,9 +8,9 @@ dashedName: implement-a-root-level-request-logger-middleware
# --description--
Earlier, you were introduced to the `express.static()` middleware function. Now its time to see what middleware is, in more detail. Middleware functions are functions that take 3 arguments: the request object, the response object, and the next function in the applications request-response cycle. These functions execute some code that can have side effects on the app, and usually add information to the request or response objects. They can also end the cycle by sending a response when some condition is met. If they dont send the response when they are done, they start the execution of the next function in the stack. This triggers calling the 3rd argument, `next()`.
في وقت سابق، تم تقديمك إلى دالة `express.static()` midleware. الآن حان الوقت لرؤية ما هو البرنامج الوسيط(midleware) ، بمزيد من التفصيل. وظائف البرامج الوسيطة (midleware) هي وظائف تأخذ 3 تمريرات: عنصر الطلب (request) ، عنصر الاستجابة(response)، والدالة التالية(next) في دورة طلب الاستجابة للتطبيق. هذه الدوال تنفذ بعض التعليمات البرمجية التي يمكن أن يكون لها تأثيرات جانبية على التطبيق، وعادة ما تضيف معلومات إلى كائنات الطلب أو الاستجابة. ويمكنها أيضا أن تنهي الدورة بإرسال رد عند استيفاء بعض الشروط. وإذا لم يرسلوا الرد عند القيام بذلك، فإنهم يشرعون في تنفيذ الوظيفة التالية في المكدس. يؤدي هذا إلى استدعاء الوسيطة الثالثة،`next()`.
Look at the following example:
انظر إلى المثال التالي:
```js
function(req, res, next) {
@@ -19,17 +19,17 @@ function(req, res, next) {
}
```
Lets suppose you mounted this function on a route. When a request matches the route, it displays the string “Im a middleware…”, then it executes the next function in the stack. In this exercise, you are going to build root-level middleware. As you have seen in challenge 4, to mount a middleware function at root level, you can use the `app.use(<mware-function>)` method. In this case, the function will be executed for all the requests, but you can also set more specific conditions. For example, if you want a function to be executed only for POST requests, you could use `app.post(<mware-function>)`. Analogous methods exist for all the HTTP verbs (GET, DELETE, PUT, …).
دعونا نفترض أنك قمت بتركيب هذه الوظيفة على مسار. عندما يتطابق الطلب مع المسار، فإنه يعرض نص "Im a middleware"، ثم يقوم بتنفيذ الدالة التالية في المكدس. في هذا التمارين ، سوف تقوم ببناء منتوج على مستوى الجذر. كما رأيت في التحدي 4، لتحميل دالة البرنامج الوسيط(middleware) على مستوى الجذر ، يمكنك استخدام طريقة `app.use(<mware-function>)`. في هذه الحالة، سيتم تنفيذ الوظيفة لجميع الطلبات، ولكن يمكنك أيضا وضع شروط أكثر تحديداً. على سبيل المثال، إذا كنت تريد تنفيذ دالة فقط لطلبات POST ، يمكنك استخدام `app.post(<mware-function>)`. توجد طرق مشابهة لجميع أفعال HTTP (GET, DELETE, PUT …).
# --instructions--
Build a simple logger. For every request, it should log to the console a string taking the following format: `method path - ip`. An example would look like this: `GET /json - ::ffff:127.0.0.1`. Note that there is a space between `method` and `path` and that the dash separating `path` and `ip` is surrounded by a space on both sides. You can get the request method (http verb), the relative route path, and the callers ip from the request object using `req.method`, `req.path` and `req.ip`. Remember to call `next()` when you are done, or your server will be stuck forever. Be sure to have the Logs opened, and see what happens when some request arrives.
بناء مسجل بسيط. لكل طلب، يجب أن يسجل في وحدة التحكم(console) نص يأخذ التنسيق التالي: `method path - ip`. مثال سيبدوا هكذا: `GET /json - ::ffff:127.0.0.1`. لاحظ أن هناك مسافة بين `method` و `path` وأن الفاصل بين `path` و `ip` محاط بمسافة على كلا الجانبين. يمكنك الحصول على طريقة الطلب (http verb)، ومسار المسار النسبي، و ip للمتصل من عنصر الطلب باستخدام `req.method`, `req.path` and `req.ip`. تذّكر أن تستدعي `next()` عند الانتهاء من ذلك، أو أن الخادم الخاص بك سيكون عالقاً إلى الأبد. تأكد من فتح "السجلات"(Logs) ، ومعرفة ماذا يحدث عند وصول بعض الطلبات.
**Note:** Express evaluates functions in the order they appear in the code. This is true for middleware too. If you want it to work for all the routes, it should be mounted before them.
**ملاحظة:** express تُقيّم الدوال بالترتيب التي تظهر به في الكود. هذا صحيح أيضا للبرمجيات الوسيطة (middleware). إذا أردت أن تعمل على جميع المسارات ، فيجب تثبيتها قبلها.
# --hints--
Root level logger middleware should be active
يجب أن يكون البرنامج الوسطي لتسجيل مستوى الروت نشط
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb0367417b2b2512bed
title: Meet the Node console
title: مقابلة وحدة التحكم الخاصة بالعقدة (Node)
challengeType: 2
forumTopicId: 301515
dashedName: meet-the-node-console

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb7367417b2b2512c0a
title: Create Many Records with model.create()
title: إنشاء العديد من الRecords مع model.create()
challengeType: 2
forumTopicId: 301537
dashedName: create-many-records-with-model-create

View File

@@ -1,6 +1,6 @@
---
id: 587d7fb8367417b2b2512c10
title: Delete One Document Using model.findByIdAndRemove
title: حذف مستند واحد باستخدام model.findByIdAndRemove
challengeType: 2
forumTopicId: 301539
dashedName: delete-one-document-using-model-findbyidandremove
@@ -8,15 +8,15 @@ dashedName: delete-one-document-using-model-findbyidandremove
# --description--
`findByIdAndRemove` and `findOneAndRemove` are like the previous update methods. They pass the removed document to the db. As usual, use the function argument `personId` as the search key.
`findByIdAndRemove` and `findOneAndRemove` are like the previous update methods. They pass the removed document to the db. كالعادة، استخدم argument للدالة `personId` كمفتاح البحث.
# --instructions--
Modify the `removeById` function to delete one person by the person's `_id`. You should use one of the methods `findByIdAndRemove()` or `findOneAndRemove()`.
تعديل دالة `removeById` لحذف شخص واحد بواسطة `_id` الخاص بالشخص. يجب عليك استخدام إحدى الطرق `findByIdAndRemove()` أو `findOneAndRemove()`.
# --hints--
Deleting an item should succeed
يجب أن ينجح حذف العنصر
```js
(getUserInput) =>

View File

@@ -8,19 +8,19 @@ dashedName: install-and-set-up-mongoose
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-mongomongoose/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-mongomongoose" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
In this challenge, you will set up a MongoDB Atlas database and import the required packages to connect to it.

View File

@@ -8,19 +8,19 @@ dashedName: set-up-a-template-engine
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-advancednode/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-advancednode" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
A template engine enables you to use static template files (such as those written in *Pug*) in your app. At runtime, the template engine replaces variables in a template file with actual values which can be supplied by your server. Then it transforms the template into a static HTML file that is sent to the client. This approach makes it easier to design an HTML page and allows for displaying variables on the page without needing to make an API call from the client.

View File

@@ -8,19 +8,19 @@ dashedName: learn-how-javascript-assertions-work
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
# --instructions--

View File

@@ -12,15 +12,15 @@ Build a full stack JavaScript app that is functionally similar to this: <a href=
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
# --instructions--

View File

@@ -8,19 +8,19 @@ dashedName: issue-tracker
# --description--
Build a full stack JavaScript app that is functionally similar to this: <a href="https://issue-tracker.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://issue-tracker.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
Build a full stack JavaScript app that is functionally similar to this: <a href="https://issue-tracker.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://issue-tracker.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-issuetracker/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
# --instructions--

View File

@@ -8,19 +8,19 @@ dashedName: metric-imperial-converter
# --description--
Build a full stack JavaScript app that is functionally similar to this: <a href="https://metric-imperial-converter.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://metric-imperial-converter.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
Build a full stack JavaScript app that is functionally similar to this: <a href="https://metric-imperial-converter.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://metric-imperial-converter.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
**Note:** This project's tests do not work when using `glitch.com`.

View File

@@ -8,19 +8,19 @@ dashedName: personal-library
# --description--
Build a full stack JavaScript app that is functionally similar to this: <a href="https://personal-library.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://personal-library.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
Build a full stack JavaScript app that is functionally similar to this: <a href="https://personal-library.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://personal-library.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-library" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-library" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
# --instructions--

View File

@@ -8,19 +8,19 @@ dashedName: sudoku-solver
# --description--
Build a full stack JavaScript app that is functionally similar to this: <a href="https://sudoku-solver.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://sudoku-solver.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
Build a full stack JavaScript app that is functionally similar to this: <a href="https://sudoku-solver.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://sudoku-solver.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
- Clone <a href="https://github.com/freecodecamp/boilerplate-project-sudoku-solver" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
If you use Replit, follow these steps to set up the project:
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
- Start by importing the project on Replit.
- Next, you will see a `.replit` window.
- Select `Use run command` and click the `Done` button.
- ابدأ باستيراد (import) المشروع إلى Replit.
- بعد ذلك، سترى نافذة `.replit`.
- اختار `Use run command` وانقر على زر `Done`.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the Solution Link field. Optionally, also submit a link to your project's source code in the GitHub Link field.
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
# --instructions--

View File

@@ -1,6 +1,6 @@
---
id: 65576ff7888f9e96f52a4be1
title: Step 2
title: الخطوة 2
challengeType: 20
dashedName: step-2
---

View File

@@ -1,6 +1,6 @@
---
id: 6557709b0aee699a6a00528c
title: Step 12
title: الخطوة 12
challengeType: 20
dashedName: step-12
---

View File

@@ -1,6 +1,6 @@
---
id: 6557712d77ce2d9bd7e63afd
title: Step 13
title: الخطوة 13
challengeType: 20
dashedName: step-13
---

View File

@@ -1,6 +1,6 @@
---
id: 6557716aadbd2d9c42c0e69a
title: Step 14
title: الخطوة 14
challengeType: 20
dashedName: step-14
---

View File

@@ -1,27 +1,26 @@
---
id: 655771d889132f9ccd341060
title: Step 15
title: الخطوة 15
challengeType: 20
dashedName: step-15
---
# --description--
A graph is called a *weighted* graph when its edges are associated with weights, representing a distance, time or other.
A graph is called a *weighted* graph when its edges are associated with weights, representing a distance, time or other quantitative value.
In your case, these weights will be the distances between each node, or point in space.
To represent a weighted graph you can modify your dictionary, using a list of tuples for each value.
In your case, these weights will be the distances between each node, or point in space. To represent a weighted graph you can modify your dictionary, using a list of tuples for each value.
The first element in the tuple will be the connected node, and the second element will be an integer number indicating the distance.
Modify `my_graph["A"]` into a list of tuples, considering the following distances:
| Edge | Weight |
|------|--------|
| A-B | 3 |
| B-C | 4 |
| C-D | 7 |
| D-A | 1 |
| ---- | ------ |
| A-B | 3 |
| B-C | 4 |
| C-D | 7 |
| D-A | 1 |
# --hints--

View File

@@ -1,6 +1,6 @@
---
id: 65577236b056379d5dbc7000
title: Step 18
title: الخطوة 18
challengeType: 20
dashedName: step-18
---
@@ -9,7 +9,7 @@ dashedName: step-18
Now you are going to start developing the algorithm to calculate the shortest path between each node in your new graph.
Declare an empty function called `shortest_path` and don't forget the `pass` keyword.
Declare an empty function called `shortest_path` and don't forget the `pass` keyword.
# --hints--

View File

@@ -1,6 +1,6 @@
---
id: 655773b0591c5f9f4045883e
title: Step 19
title: الخطوة 19
challengeType: 20
dashedName: step-19
---

View File

@@ -1,6 +1,6 @@
---
id: 655773f8b8b5db9fc6d0ae76
title: Step 20
title: الخطوة 20
challengeType: 20
dashedName: step-20
---

View File

@@ -1,6 +1,6 @@
---
id: 6557743527cb92a06417ea97
title: Step 21
title: الخطوة 21
challengeType: 20
dashedName: step-21
---

View File

@@ -1,6 +1,6 @@
---
id: 6557746aad2844a0cd864e12
title: Step 22
title: الخطوة 22
challengeType: 20
dashedName: step-22
---

View File

@@ -1,6 +1,6 @@
---
id: 655774955b097ea14897db12
title: Step 23
title: الخطوة 23
challengeType: 20
dashedName: step-23
---

View File

@@ -1,6 +1,6 @@
---
id: 655774d01daeeaa1978b99d5
title: Step 24
title: الخطوة 24
challengeType: 20
dashedName: step-24
---

View File

@@ -1,6 +1,6 @@
---
id: 655775221059f5a20493d5d7
title: Step 25
title: الخطوة 25
challengeType: 20
dashedName: step-25
---

View File

@@ -1,6 +1,6 @@
---
id: 655776db1eeae0a620e42a0d
title: Step 26
title: الخطوة 26
challengeType: 20
dashedName: step-26
---

View File

@@ -1,6 +1,6 @@
---
id: 655777060d8ddea6741be1b1
title: Step 27
title: الخطوة 27
challengeType: 20
dashedName: step-27
---
@@ -47,7 +47,7 @@ def shortest_path(graph, start):
else:
distances[node] = float('inf')
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65577739f57ecca6c39bb4e9
title: Step 28
title: الخطوة 28
challengeType: 20
dashedName: step-28
---
@@ -51,9 +51,9 @@ my_graph = {
def shortest_path(graph, start):
unvisited = []
distances = {}
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65577791ad8c26a7705e2919
title: Step 29
title: الخطوة 29
challengeType: 20
dashedName: step-29
---
@@ -57,9 +57,9 @@ my_graph = {
def shortest_path(graph, start):
unvisited = list(graph)
distances = {}
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65577a17564ce8a8e06c1460
title: Step 30
title: الخطوة 30
challengeType: 20
dashedName: step-30
---
@@ -22,8 +22,8 @@ You should use the dictionary comprehension syntax to give a value to your `dist
```js
({ test: () => {
const shortest = __helpers.python.getDef(code, "shortest_path");
const {function_body} = shortest;
assert(function_body.match(/^\s{4}distances\s*=\s*\{\s*(\w+)\s*:\s*0\s+if\s+\1\s*==\s*start\s+else\s+float\s*\(\s*("|')inf\2\s*\)\s+for\s+\1\s+in\s+graph\s*\}/m));
const {function_body} = shortest;
assert(function_body.match(/^\s{4}distances\s*=\s*\{\s*(\w+)\s*:\s*0\s+if\s+(?:\1\s*==\s*start|start\s*==\s*\1)\s+else\s+float\s*\(\s*("|')inf\2\s*\)\s+for\s+\1\s+in\s+graph\s*\}/m));
}
})
```
@@ -46,7 +46,7 @@ def shortest_path(graph, start):
distances = {}
paths = {node: [] for node in graph}
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65578c17d54dfab65cd54b95
title: Step 31
title: الخطوة 31
challengeType: 20
dashedName: step-31
---
@@ -41,9 +41,9 @@ def shortest_path(graph, start):
unvisited = list(graph)
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65578c74607d40b6d8c4757f
title: Step 32
title: الخطوة 32
challengeType: 20
dashedName: step-32
---
@@ -39,9 +39,9 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
print(f'Unvisited: {unvisited}\nDistances: {distances}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,13 +1,13 @@
---
id: 65578cb031cd93b77a285db2
title: Step 33
title: الخطوة 33
challengeType: 20
dashedName: step-33
---
# --description--
Your function is going to explore all the nodes connected to the starting node. It will calculate the shortest paths for all of them. Then, it will remove the starting node from the unvisited nodes.
Your function is going to explore all the nodes connected to the starting node. It will calculate the shortest paths for all of them. Then, it will remove the starting node from the unvisited nodes.
Next, the closest neighbor node will be visited and the process will be repeated until all the nodes are visited.
@@ -38,9 +38,9 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65578cee7f2cb8b80127cce2
title: Step 34
title: الخطوة 34
challengeType: 20
dashedName: step-34
---
@@ -40,9 +40,9 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65578d0f6c78a0b868a43b9c
title: Step 35
title: الخطوة 35
challengeType: 20
dashedName: step-35
---
@@ -57,7 +57,7 @@ def shortest_path(graph, start):
pass
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 65578d4fc3afc3b8f554c882
title: Step 36
title: الخطوة 36
challengeType: 20
dashedName: step-36
---
@@ -9,7 +9,7 @@ dashedName: step-36
`min()` takes also a keyword-only argument. Passing a function as an additional argument to `min()`, you can modify the way the list items are compared.
The result of the line you've just written in the previous step is the node that comes first in alphabetical order. Instead you want to select the unvisited node having the smallest distance from the starting node.
The result of the line you've just written in the previous step is the node that comes first in alphabetical order. Instead you want to select the unvisited node having the smallest distance from the starting node.
Pass `key=distances.get` as the second argument to your `min()` call. In this way, the comparison will take place depending on the value each `unvisited` list item has inside the `distances` dictionary.
@@ -48,7 +48,7 @@ def shortest_path(graph, start):
current = min(unvisited)
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 65578f895f2a65ba7a916804
title: Step 37
title: الخطوة 37
challengeType: 20
dashedName: step-37
---
@@ -44,7 +44,7 @@ def shortest_path(graph, start):
current = min(unvisited, key=distances.get)
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,13 +1,13 @@
---
id: 65578fcf00322dbad5dee05b
title: Step 38
title: الخطوة 38
challengeType: 20
dashedName: step-38
---
# --description--
Create an `if` statement to check if the distance of the neighbor node (the second item in the processed tuple) plus the distance of `current` is less than the currently known distance of the neighbor node (the first item in the processed tuple).
Create an `if` statement to check if the distance of the neighbor node (the second item in the processed tuple) plus the distance of `current` is less than the currently known distance of the neighbor node (the first item in the processed tuple).
Use the `pass` keyword to temporarily fill the body of the `if`.
@@ -41,7 +41,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
--fcc-editable-region--
@@ -49,7 +49,7 @@ def shortest_path(graph, start):
pass
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 655790d113d14dbb727eaf41
title: Step 40
title: الخطوة 40
challengeType: 20
dashedName: step-40
---
@@ -49,6 +49,6 @@ def shortest_path(graph, start):
distances[node] = distance + distances[current]
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 6557910b0ebaeebc18209e90
title: Step 41
title: الخطوة 41
challengeType: 20
dashedName: step-41
---
@@ -49,7 +49,7 @@ def shortest_path(graph, start):
pass
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 6557913b8fe5c0bc834c9f4f
title: Step 42
title: الخطوة 42
challengeType: 20
dashedName: step-42
---
@@ -50,7 +50,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -61,7 +61,7 @@ def shortest_path(graph, start):
paths[node] = paths[current]
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 655791847db8a9bd0b685f40
title: Step 43
title: الخطوة 43
challengeType: 20
dashedName: step-43
---
@@ -51,7 +51,7 @@ def shortest_path(graph, start):
paths[node].extend(paths[current])
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 655791ae44c182bd92f31caa
title: Step 44
title: الخطوة 44
challengeType: 20
dashedName: step-44
---
@@ -11,7 +11,7 @@ Terminate the `while` loop by removing the current node from the `unvisited` lis
# --hints--
You should use the `remove()` function to remove the current node from `unvisited` after your `for` loop.
You should use the `remove()` function to remove the current node from `unvisited` after your `for` loop.
```js
({ test: () => {
@@ -52,7 +52,7 @@ def shortest_path(graph, start):
paths[node].append(node)
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 655791e6cf5e03be3de73451
title: Step 45
title: الخطوة 45
challengeType: 20
dashedName: step-45
---
@@ -41,7 +41,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -55,9 +55,9 @@ def shortest_path(graph, start):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,13 +1,13 @@
---
id: 65579228c669fcbebffd01d5
title: Step 47
title: الخطوة 47
challengeType: 20
dashedName: step-47
---
# --description--
The other bug is subtle. When a shorter distance is found for a neighbor node, `paths[current]` gets assigned to the neighbor node path, `paths[node]`.
The other bug is subtle. When a shorter distance is found for a neighbor node, `paths[current]` gets assigned to the neighbor node path, `paths[node]`.
This means both variables point to the same list. Since lists are mutable, when you append the neighbor node to its path, both `paths[node]` and `paths[current]` are modified because they are the same list. This results in wrong paths, although the distances are correct.
@@ -38,7 +38,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -52,9 +52,9 @@ def shortest_path(graph, start):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 6557924d47c325bf27afbe51
title: Step 48
title: الخطوة 48
challengeType: 20
dashedName: step-48
---
@@ -49,7 +49,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -61,9 +61,9 @@ def shortest_path(graph, start):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 6557927ad11e58bf8c794b25
title: Step 50
title: الخطوة 50
challengeType: 20
dashedName: step-50
---
@@ -51,7 +51,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:

View File

@@ -1,6 +1,6 @@
---
id: 6559d70c5161b16ff1d6530d
title: Step 49
title: الخطوة 49
challengeType: 20
dashedName: step-49
---
@@ -65,7 +65,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -79,7 +79,7 @@ def shortest_path(graph, start, target = ''):
unvisited.remove(current)
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 6559d86fe1b8947954b9178d
title: Step 51
title: الخطوة 51
challengeType: 20
dashedName: step-51
---
@@ -53,7 +53,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -69,7 +69,7 @@ def shortest_path(graph, start, target = ''):
targets_to_print = [target] if target else graph
for node in targets_to_print:
print(f'\n{start}-{node} distance: {distances[node]}\nPath: {" -> ".join(paths[node])}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 6559da1b7d75f088f5e6b89f
title: Step 52
title: الخطوة 52
challengeType: 20
dashedName: step-52
---
@@ -39,7 +39,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -57,8 +57,8 @@ def shortest_path(graph, start, target = ''):
if node == start:
continue
print(f'\n{start}-{node} distance: {distances[node]}\nPath: {" -> ".join(paths[node])}')
shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 6559da93115de78dbbdc7ba3
title: Step 54
title: الخطوة 54
challengeType: 20
dashedName: step-54
---
@@ -39,7 +39,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -51,15 +51,15 @@ def shortest_path(graph, start, target = ''):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
targets_to_print = [target] if target else graph
for node in targets_to_print:
if node == start:
continue
print(f'\n{start}-{node} distance: {distances[node]}\nPath: {" -> ".join(paths[node])}')
return distances, paths
shortest_path(my_graph, 'A')
--fcc-editable-region--
```
@@ -81,7 +81,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -93,15 +93,15 @@ def shortest_path(graph, start, target = ''):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
targets_to_print = [target] if target else graph
for node in targets_to_print:
if node == start:
continue
print(f'\n{start}-{node} distance: {distances[node]}\nPath: {" -> ".join(paths[node])}')
return distances, paths
shortest_path(my_graph, 'A', 'F')
```

View File

@@ -1,6 +1,6 @@
---
id: 6566195b0a021bb660b2b4b1
title: Step 16
title: الخطوة 16
challengeType: 20
dashedName: step-16
---

View File

@@ -1,6 +1,6 @@
---
id: 65661b72d6745ebec6a96923
title: Step 17
title: الخطوة 17
challengeType: 20
dashedName: step-17
---

View File

@@ -1,6 +1,6 @@
---
id: 6567722f53ad97d7ea6bb082
title: Step 46
title: الخطوة 46
challengeType: 20
dashedName: step-46
---
@@ -34,7 +34,7 @@ def shortest_path(graph, start):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -48,9 +48,9 @@ def shortest_path(graph, start):
paths[node].extend(paths[current])
paths[node].append(node)
unvisited.remove(current)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65774ae7c3eee66fe79b9459
title: Step 53
title: الخطوة 53
challengeType: 20
dashedName: step-53
---
@@ -36,7 +36,7 @@ You should modify `my_graph` into the provided graph.
'F': [('B', 2), ('D', 3)]
}
graph == g
`))
})
```
@@ -59,7 +59,7 @@ def shortest_path(graph, start, target = ''):
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
while unvisited:
current = min(unvisited, key=distances.get)
for node, distance in graph[current]:
@@ -77,7 +77,7 @@ def shortest_path(graph, start, target = ''):
if node == start:
continue
print(f'\n{start}-{node} distance: {distances[node]}\nPath: {" -> ".join(paths[node])}')
return distances, paths
shortest_path(my_graph, 'A')

View File

@@ -1,6 +1,6 @@
---
id: 657891ab9c1903f4e55433ba
title: Step 39
title: الخطوة 39
challengeType: 20
dashedName: step-39
---
@@ -48,7 +48,7 @@ def shortest_path(graph, start):
pass
--fcc-editable-region--
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
```

View File

@@ -1,6 +1,6 @@
---
id: 65789506b30453080f77470c
title: Step 1
title: الخطوة 1
challengeType: 20
dashedName: step-1
---

View File

@@ -1,13 +1,13 @@
---
id: 6578b13757611e2825beb8a5
title: Step 3
title: الخطوة 3
challengeType: 20
dashedName: step-3
---
# --description--
Keys must be unique whitin a dictionary and they can be only immutable data types. This means you cannot use a list or another dictionary as keys.
Keys must be unique within a dictionary and they can be only immutable data types. This means you cannot use a list or another dictionary as keys.
Add another key `age` to your dictionary and give it the integer number `2` as value.

View File

@@ -1,6 +1,6 @@
---
id: 6578b57361f2f132a02e2a18
title: Step 4
title: الخطوة 4
challengeType: 20
dashedName: step-4
---

View File

@@ -1,6 +1,6 @@
---
id: 65796fac81f983127558f3f4
title: Step 5
title: الخطوة 5
challengeType: 20
dashedName: step-5
---

View File

@@ -1,6 +1,6 @@
---
id: 6579717f0920131304286804
title: Step 6
title: الخطوة 6
challengeType: 20
dashedName: step-6
---

View File

@@ -1,6 +1,6 @@
---
id: 65797670e0c0d016f17e7660
title: Step 7
title: الخطوة 7
challengeType: 20
dashedName: step-7
---
@@ -14,7 +14,7 @@ Now, at the bottom of your code, print `copper`.
You should print `copper` at the bottom of your code.
```js
({ test: () => assert.match(code, /(?<!\}\s*)^print\s*\(\s*copper\s*\)/m) })
assert.match(code, /print\s*\(\s*copper\s*\)/)
```
# --seed--
@@ -28,5 +28,6 @@ copper = {
'age': 2
}
copper['food'] = 'hay'
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 6579ca0923cfa7162089d2f0
title: Step 8
title: الخطوة 8
challengeType: 20
dashedName: step-8
---

View File

@@ -1,6 +1,6 @@
---
id: 6579cbab9825b8170974c69a
title: Step 9
title: الخطوة 9
challengeType: 20
dashedName: step-9
---

View File

@@ -1,6 +1,6 @@
---
id: 6579cd5f6dd62c189e53ddbb
title: Step 10
title: الخطوة 10
challengeType: 20
dashedName: step-10
---

View File

@@ -1,15 +1,14 @@
---
id: 6579dd49fa8a8e1fd06b85a9
title: Step 11
title: الخطوة 11
challengeType: 20
dashedName: step-11
---
# --description--
Graphs are data structures representing relations between pairs of elements.
These elements, called *nodes*, can be real-life objects, entities, points in space or others. The connections between the nodes are called the *edges*.
Graphs are data structures representing relations between pairs of elements. These elements, called *nodes*, can be real-life objects, entities, points in space or others. The connections between the nodes are called the *edges*.
For example, a graph can be used to represent two points in the space, `A` and `B`, connected by a path. A graph like this will be made of two nodes connected by an edge.
Rename the `copper` dictionary into `my_graph`. This will represent the graph to test your algorithm.

View File

@@ -1,6 +1,6 @@
---
id: 656873ffdc638f7e290f60de
title: Step 1
title: الخطوة 1
challengeType: 20
dashedName: step-1
---

View File

@@ -1,6 +1,6 @@
---
id: 656874efd5102b81815c8ef7
title: Step 2
title: الخطوة 2
challengeType: 20
dashedName: step-2
---
@@ -25,7 +25,7 @@ Your method should be named `__init__`. Don't add any parameters.
```js
assert.match(code, / +def\s+__init__\s*\(\)\:/);
```
```
# --seed--
@@ -34,6 +34,6 @@ assert.match(code, / +def\s+__init__\s*\(\)\:/);
```py
--fcc-editable-region--
class Board:
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65688efcc78c9495e73acfc9
title: Step 3
title: الخطوة 3
challengeType: 20
dashedName: step-3
---
@@ -28,6 +28,6 @@ assert.match(code, /def\s+__init__\s*\(\s*self\s*,\s*board\s*\):/);
--fcc-editable-region--
class Board:
def __init__():
--fcc-editable-region--
```

View File

@@ -1,6 +1,6 @@
---
id: 65688f22703200963a85dfb7
title: Step 4
title: الخطوة 4
challengeType: 20
dashedName: step-4
---
@@ -27,6 +27,6 @@ assert.match(code, /self\.board\s*=\s*board/);
--fcc-editable-region--
class Board:
def __init__(self, board):
--fcc-editable-region--
```

Some files were not shown because too many files have changed in this diff Show More