Skip to content

Commit

Permalink
chore(i18n,learn): processed translations (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
camperbot authored Jan 20, 2025
1 parent 48166d3 commit 018ed31
Show file tree
Hide file tree
Showing 714 changed files with 8,109 additions and 2,259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ assert.sameMembers(
`bubbleSort` No debería usar el método incorporado `.sort()`.

```js
assert(isBuiltInSortUsed());
assert.isFalse(isBuiltInSortUsed());
```

# --seed--
Expand All @@ -99,9 +99,14 @@ function isSorted(a){

function isBuiltInSortUsed(){
let sortUsed = false;
const temp = Array.prototype.sort;
Array.prototype.sort = () => sortUsed = true;
bubbleSort([0, 1]);
return !sortUsed;
try {
bubbleSort([0, 1]);
} finally {
Array.prototype.sort = temp;
}
return sortUsed;
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ assert.deepEqual(insertionSort([5, 4, 33, 2, 8]), [2, 4, 5, 8, 33])
`insertionSort` no debe utilizar el método "buil-in" `.sort()`.

```js
assert(isBuiltInSortUsed());
assert.isFalse(isBuiltInSortUsed());
```

# --seed--
Expand All @@ -101,9 +101,14 @@ function isSorted(a){

function isBuiltInSortUsed(){
let sortUsed = false;
const temp = Array.prototype.sort;
Array.prototype.sort = () => sortUsed = true;
insertionSort([0, 1]);
return !sortUsed;
try {
insertionSort([0, 1]);
} finally {
Array.prototype.sort = temp;
}
return sortUsed;
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ assert.isFunction(mergeSort);
`mergeSort` Debería retornar un arreglo ordenado (menor a mayor).

```js
function isSorted(a){
for(let i = 0; i < a.length - 1; i++)
if(a[i] > a[i + 1])
return false;
return true;
}

assert.isTrue(
isSorted(
mergeSort([
Expand Down Expand Up @@ -93,17 +86,34 @@ assert.sameMembers(
`mergeSort`no debe de usar el método incorporada (built-in)`.sort()`.

```js
assert.isFalse(isBuiltInSortUsed());
```

# --seed--

## --after-user-code--

```js
function isSorted(a){
for(let i = 0; i < a.length - 1; i++)
if(a[i] > a[i + 1])
return false;
return true;
}

function isBuiltInSortUsed(){
let sortUsed = false;
const temp = Array.prototype.sort;
Array.prototype.sort = () => sortUsed = true;
mergeSort([0, 1]);
try {
mergeSort([0, 1]);
} finally {
Array.prototype.sort = temp;
}
return sortUsed;
}
assert.isFalse(isBuiltInSortUsed());
```

# --seed--

## --seed-contents--

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ assert.sameMembers(
`quickSort` no debe que utilizar el método incorporado `.sort()`.

```js
assert(isBuiltInSortUsed());
assert.isFalse(isBuiltInSortUsed());
```

# --seed--
Expand All @@ -97,9 +97,14 @@ function isSorted(a){

function isBuiltInSortUsed(){
let sortUsed = false;
const temp = Array.prototype.sort;
Array.prototype.sort = () => sortUsed = true;
quickSort([0, 1]);
return !sortUsed;
try {
quickSort([0, 1]);
} finally {
Array.prototype.sort = temp;
}
return sortUsed;
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ assert.sameMembers(
`selectionSort` no debe utilizar el método incorporado `.sort()`.

```js
assert(isBuiltInSortUsed());
assert.isFalse(isBuiltInSortUsed());
```

# --seed--
Expand All @@ -95,9 +95,14 @@ function isSorted(a){

function isBuiltInSortUsed(){
let sortUsed = false;
const temp = Array.prototype.sort;
Array.prototype.sort = () => sortUsed = true;
selectionSort([0, 1]);
return !sortUsed;
try {
selectionSort([0, 1]);
} finally {
Array.prototype.sort = temp;
}
return sortUsed;
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You should chain the `addEventListener()` method to your `audio` variable.
assert.match(code, /audio\.addEventListener\(/)
```

The event listener you used on on your `audio` variable should listen for an `"ended"` event.
The event listener you used on your `audio` variable should listen for an `"ended"` event.

```js
assert.match(code, /audio\.addEventListener\(\s*('|")ended\1/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dashedName: problem-165-intersections

A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities: the segments have zero points, one point, or infinitely many points in common.

Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
Moreover when two segments have exactly one point in common it might be the case that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.

We will call a common point $T$ of two segments $L_1$ and $L_2$ a true intersection point of $L_1$ and $L_2$ if $T$ is the only common point of $L_1$ and $L_2$ and $T$ is an interior point of both segments.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Child 2: snake

# --instructions--

Write a function that takes an input array of words. The function should return an array of words where the first letter of each word is the same as the last letter of the previous word. Only use the words in the input array, and once a word is used it cannot be repeated. The words in the return array should be selected and sequenced so that that its length is maximized.
Write a function that takes an input array of words. The function should return an array of words where the first letter of each word is the same as the last letter of the previous word. Only use the words in the input array, and once a word is used it cannot be repeated. The words in the return array should be selected and sequenced so that its length is maximized.

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Even today, with proportional fonts and complex layouts, there are still cases w

# --instructions--

Write a function that can wrap this text to any number of characters. As an example, the text wrapped to 80 characters should look like the following:
Write a function that can wrap this text to any number of characters. Note that the input text already contains line breaks, which your function should handle appropriately. As an example, the text wrapped to 80 characters should look like the following:

<pre>
Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX
Expand All @@ -23,37 +23,37 @@ than a simple minimum length algorithm.

# --hints--

wrap should be a function.
`wrap` should be a function.

```js
assert.equal(typeof wrap, 'function');
```

wrap should return a string.
`wrap` should return a string.

```js
assert.equal(typeof wrap('abc', 10), 'string');
```

wrap(80) should return 4 lines.
`wrap(text,80)` should return 4 lines.

```js
assert(wrapped80.split('\n').length === 4);
```

Your `wrap` function should return our expected text.
Your `wrap` function should return the expected text.

```js
assert.equal(wrapped80.split('\n')[0], firstRow80);
```

wrap(42) should return 7 lines.
`wrap(text,42)` should return 7 lines.

```js
assert(wrapped42.split('\n').length === 7);
```

Your `wrap` function should return our expected text.
Your `wrap` function should return the expected text.

```js
assert.equal(wrapped42.split('\n')[0], firstRow42);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This word refers to the ongoing or current moment in which events happen.

The phrase `in real time` refers to something happening immediately as events occur, without delay. It is often used in the context of monitoring, communication, or data processing. For example:

`The system updates the dashboard in real time, so you can see changes instantly.` - Meaning the dashboard changes immediately after the updates after the updates are applied.
`The system updates the dashboard in real time, so you can see changes instantly.` - Meaning the dashboard changes immediately after the updates are applied.

In Jake's sentence, he means that while he checked for security vulnerabilities, it wasn't always done immediately as the updates happened.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ This sentence is in the `Present Simple` tense, not the `Present Perfect continu

# --explanation--

The negative form of the `Present Perfect continuous` tense tense is created with `hasn't/haven't + been + present participle`. It describes an ongoing action that started in the past and continues or remains relevant but hasn't occurred as expected.
The negative form of the `Present Perfect continuous` tense is created with `hasn't/haven't + been + present participle`. It describes an ongoing action that started in the past and continues or remains relevant but hasn't occurred as expected.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,13 @@ const selectors = [
'span[class~="one"] :first-of-type',
'span[class~="one"] span:first-child',
'span[class~="one"] span:nth-child(1)',
'span[class~="one"] span:first-of-type'
'span[class~="one"] span:first-of-type',
'span[class~="one"] > :first-child',
'span[class~="one"] > :nth-child(1)',
'span[class~="one"] > :first-of-type',
'span[class~="one"] > span:first-child',
'span[class~="one"] > span:nth-child(1)',
'span[class~="one"] > span:first-of-type'
]
assert.isNotNull(new __helpers.CSSHelp(document).getStyleAny(selectors));
```
Expand All @@ -386,14 +392,21 @@ const selectors = [
'span[class~="one"] :first-of-type',
'span[class~="one"] span:first-child',
'span[class~="one"] span:nth-child(1)',
'span[class~="one"] span:first-of-type'
'span[class~="one"] span:first-of-type',
'span[class~="one"] > :first-child',
'span[class~="one"] > :nth-child(1)',
'span[class~="one"] > :first-of-type',
'span[class~="one"] > span:first-child',
'span[class~="one"] > span:nth-child(1)',
'span[class~="one"] > span:first-of-type'
]
assert.isTrue(new __helpers.CSSHelp(document).getStyleAny(selectors)?.getPropVal('background-image').includes('linear-gradient('));
```
You should have an attribute selector to target the first two descendants of `span` elements that have the word `two` as a part of their `class` value.
```js

const selectors = [
'span[class~="two"] :nth-child(1), span[class~="two"] :nth-child(2)',
'span[class~="two"] :nth-child(2), span[class~="two"] :nth-child(1)',
Expand All @@ -406,7 +419,19 @@ const selectors = [
'span[class~="two"] span:first-child, span[class~="two"] span:nth-child(2)',
'span[class~="two"] span:nth-child(2), span[class~="two"] span:first-child',
'span[class~="two"] span:nth-of-type(-n+2)',
'span[class~="two"] span:nth-child(-n+2)'
'span[class~="two"] span:nth-child(-n+2)',
'span[class~="two"] > :nth-child(1), span[class~="two"] > :nth-child(2)',
'span[class~="two"] > :nth-child(2), span[class~="two"] > :nth-child(1)',
'span[class~="two"] > :first-child, span[class~="two"] > :nth-child(2)',
'span[class~="two"] > :nth-child(2), span[class~="two"] > :first-child',
'span[class~="two"] > :nth-of-type(-n+2)',
'span[class~="two"] > :nth-child(-n+2)',
'span[class~="two"] > span:nth-child(1), span[class~="two"] > span:nth-child(2)',
'span[class~="two"] > span:nth-child(2), span[class~="two"] > span:nth-child(1)',
'span[class~="two"] > span:first-child, span[class~="two"] > span:nth-child(2)',
'span[class~="two"] > span:nth-child(2), span[class~="two"] > span:first-child',
'span[class~="two"] > span:nth-of-type(-n+2)',
'span[class~="two"] > span:nth-child(-n+2)'
]
assert.isNotNull(new __helpers.CSSHelp(document).getStyleAny(selectors));
```
Expand All @@ -426,7 +451,19 @@ const selectors = [
'span[class~="two"] span:first-child, span[class~="two"] span:nth-child(2)',
'span[class~="two"] span:nth-child(2), span[class~="two"] span:first-child',
'span[class~="two"] span:nth-of-type(-n+2)',
'span[class~="two"] span:nth-child(-n+2)'
'span[class~="two"] span:nth-child(-n+2)',
'span[class~="two"] > :nth-child(1), span[class~="two"] > :nth-child(2)',
'span[class~="two"] > :nth-child(2), span[class~="two"] > :nth-child(1)',
'span[class~="two"] > :first-child, span[class~="two"] > :nth-child(2)',
'span[class~="two"] > :nth-child(2), span[class~="two"] > :first-child',
'span[class~="two"] > :nth-of-type(-n+2)',
'span[class~="two"] > :nth-child(-n+2)',
'span[class~="two"] > span:nth-child(1), span[class~="two"] > span:nth-child(2)',
'span[class~="two"] > span:nth-child(2), span[class~="two"] > span:nth-child(1)',
'span[class~="two"] > span:first-child, span[class~="two"] > span:nth-child(2)',
'span[class~="two"] > span:nth-child(2), span[class~="two"] > span:first-child',
'span[class~="two"] > span:nth-of-type(-n+2)',
'span[class~="two"] > span:nth-child(-n+2)'
]

assert.isTrue(new __helpers.CSSHelp(document).getStyleAny(selectors)?.backgroundImage.includes('linear-gradient('))
Expand All @@ -435,13 +472,21 @@ assert.isTrue(new __helpers.CSSHelp(document).getStyleAny(selectors)?.background
You should have an attribute selector to target the `span` elements that are descendants of `span` elements that have the word `three` as a part of their `class` value.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('span[class~="three"] span'));
const selectors = [
'span[class~="three"] span',
'span[class~="three"] > span'
]
assert.exists(new __helpers.CSSHelp(document).getStyleAny(selectors));
```
You should use an attribute selector to target the `span` elements that are descendants of `span` elements that have the word `three` as a part of their `class` value and set their `background-image` property to use a `linear-gradient`.
```js
assert.include(new __helpers.CSSHelp(document).getStyle('span[class~="three"] span')?.getPropVal('background-image'), 'linear-gradient(');
const selectors = [
'span[class~="three"] span',
'span[class~="three"] > span'
]
assert.include(new __helpers.CSSHelp(document).getStyleAny(selectors)?.getPropVal('background-image'), 'linear-gradient(');
```
# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ assert.isNotEmpty(eventTitles);
eventTitles.forEach((eventTitle => assert.isNotEmpty(eventTitle.innerText)));
```
Each `p` element shoud have the event description.
Each `p` element should have the event description.
```js
const eventDescriptions = document.querySelectorAll('p');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
1. You should declare a variable `num` and assign it a number of your choice. The assigned number should be between `1` and `20` inclusive.
1. Create a function named `factorialCalculator` that takes a number as an argument and returns the factorial of that number.
1. Inside the function, declare a `result` variable and assign it the value of `1`. Using a loop, loop through all numbers from `1` to the input number(inclusive) and for each number, multiply the `result` variable by the current number and assign the result to the `result` variable. You can choose to use either a `for` loop, `while` loop or `do...while` loop here.
1. You should call the `factorialCalculator` function with with `num` as the argument and assign the result to the variable `factorial`.
1. You should call the `factorialCalculator` function with `num` as the argument and assign the result to the variable `factorial`.
1. You should store the final output in the format `Factorial of [num] is [factorial]` and assign it to the variable `resultMsg`.
1. You should output the value of `resultMsg` to the console.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
- `"The weather will be nice tomorrow."`
- `"Be cautious of your new neighbours."`
- `"You will find a new hobby soon."`
- `"It would be wise to avoid the colour red today."`
- `"It would be wise to avoid the color red today."`

2. You should select a random number between 1 and 5, inclusive, and assign it to the variable `randomNumber`.

Expand Down Expand Up @@ -122,7 +122,7 @@ const fortune1 = "Your cat will look very cuddly today.";
const fortune2 = "The weather will be nice tomorrow.";
const fortune3 = "Be cautious of your new neighbours.";
const fortune4 = "You will find a new hobby soon.";
const fortune5 = "It would be wise to avoid the colour red today.";
const fortune5 = "It would be wise to avoid the color red today.";

let randomNumber = Math.floor(Math.random() * 5) + 1;

Expand Down
Loading

0 comments on commit 018ed31

Please sign in to comment.