chore(curriculum): change to US spelling (#60839)

Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
Clarence Bakosi
2025-06-12 23:50:43 +01:00
committed by GitHub
parent a1364295ef
commit 86b9cd12a0
11 changed files with 33 additions and 33 deletions

View File

@@ -238,11 +238,11 @@
},
{
"id": "5900f40a1000cf542c50ff1d",
"title": "Problem 158: Exploring strings for which only one character comes lexicographically after its neighbour to the left"
"title": "Problem 158: Exploring strings for which only one character comes lexicographically after its neighbor to the left"
},
{
"id": "5900f40c1000cf542c50ff1e",
"title": "Problem 159: Digital root sums of factorisations"
"title": "Problem 159: Digital root sums of factorizations"
},
{
"id": "5900f40d1000cf542c50ff1f",

View File

@@ -12,14 +12,14 @@ dashedName: build-the-game-of-life
The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway. It is a <em>zero-player game</em>, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, populated and unpopulated. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent.
The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, populated and unpopulated. Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent.
At each step in time, the following transitions occur:
- Any live cell with fewer than two live neighbours dies, as if by underpopulation.
- Any live cell with two or three live neighbours lives on to the next generation.
- Any live cell with more than three live neighbours dies, as if by overpopulation.
- Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
- Any live cell with fewer than two live neighbors dies, as if by underpopulation.
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies, as if by overpopulation.
- Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
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.

View File

@@ -14,7 +14,7 @@ New rings are added in the same fashion, with the next rings being numbered 8 to
<img alt="three first rings of arranged hexagonal tiles with numbers 1 to 37, and with highlighted tiles 8 and 17" src="https://cdn.freecodecamp.org/curriculum/project-euler/hexagonal-tile-differences.png" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
By finding the difference between tile $n$ and each of its six neighbours we shall define $PD(n)$ to be the number of those differences which are prime.
By finding the difference between tile $n$ and each of its six neighbors we shall define $PD(n)$ to be the number of those differences which are prime.
For example, working clockwise around tile 8 the differences are 12, 29, 11, 6, 1, and 13. So $PD(8) = 3$.

View File

@@ -2,7 +2,7 @@
id: 5900f40a1000cf542c50ff1d
title: >-
Problem 158: Exploring strings for which only one character comes
lexicographically after its neighbour to the left
lexicographically after its neighbor to the left
challengeType: 1
forumTopicId: 301789
dashedName: >-
@@ -15,24 +15,24 @@ Taking three different letters from the 26 letters of the alphabet, character st
Examples are 'abc', 'hat' and 'zyx'.
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbor to the left.
For 'hat' there is exactly one character that comes lexicographically after its neighbour to the left. For 'zyx' there are zero characters that come lexicographically after its neighbour to the left.
For 'hat' there is exactly one character that comes lexicographically after its neighbor to the left. For 'zyx' there are zero characters that come lexicographically after its neighbor to the left.
In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbour to the left.
In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbor to the left.
We now consider strings of $n ≤ 26$ different characters from the alphabet.
For every $n$, $p(n)$ is the number of strings of length $n$ for which exactly one character comes lexicographically after its neighbour to the left.
For every $n$, $p(n)$ is the number of strings of length $n$ for which exactly one character comes lexicographically after its neighbor to the left.
What is the maximum value of $p(n)$?
# --hints--
`lexicographicNeighbours()` should return `409511334375`.
`lexicographicNeighbors()` should return `409511334375`.
```js
assert.strictEqual(lexicographicNeighbours(), 409511334375);
assert.strictEqual(lexicographicNeighbors(), 409511334375);
```
# --seed--
@@ -40,12 +40,12 @@ assert.strictEqual(lexicographicNeighbours(), 409511334375);
## --seed-contents--
```js
function lexicographicNeighbours() {
function lexicographicNeighbors() {
return true;
}
lexicographicNeighbours();
lexicographicNeighbors();
```
# --solutions--

View File

@@ -1,6 +1,6 @@
---
id: 5900f40c1000cf542c50ff1e
title: 'Problem 159: Digital root sums of factorisations'
title: 'Problem 159: Digital root sums of factorizations'
challengeType: 1
forumTopicId: 301790
dashedName: problem-159-digital-root-sums-of-factorisations
@@ -26,7 +26,7 @@ Recall that the digital root of a number, in base 10, is found by adding togethe
We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number. The chart below demonstrates all of the DRS values for 24.
| Factorisation | Digital Root Sum |
| Factorization | Digital Root Sum |
|---------------|------------------|
| 2x2x2x3 | 9 |
| 2x3x4 | 9 |

View File

@@ -12,7 +12,7 @@ Consider the following configuration of 64 triangles:
<img alt="64 triangles arranged to create larger triangle with side length of 8 triangles" src="https://cdn.freecodecamp.org/curriculum/project-euler/tri-colouring-a-triangular-grid-1.gif" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighbouring if they share an edge. Note: if they only share a vertex, then they are not neighbours.
We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighboring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighboring if they share an edge. Note: if they only share a vertex, then they are not neighbors.
For example, here is a valid colouring of the above grid:

View File

@@ -25,9 +25,9 @@ $$\begin{array}{rrr}
& \cdots
\end{array}$$
Each positive integer has up to eight neighbours in the triangle.
Each positive integer has up to eight neighbors in the triangle.
A set of three primes is called a prime triplet if one of the three primes has the other two as neighbours in the triangle.
A set of three primes is called a prime triplet if one of the three primes has the other two as neighbors in the triangle.
For example, in the second row, the prime numbers 2 and 3 are elements of some prime triplet.

View File

@@ -12,9 +12,9 @@ dashedName: problem-227-the-chase
The players sit around a table; the game begins with two opposite players having one die each. On each turn, the two players with a die roll it.
If the player rolls a 1, he passes the die to his neighbour on the left.
If the player rolls a 1, he passes the die to his neighbor on the left.
If the player rolls a 6, he passes the die to his neighbour on the right.
If the player rolls a 6, he passes the die to his neighbor on the right.
Otherwise, he keeps the die for the next turn.

View File

@@ -12,7 +12,7 @@ A k-d tree (short for *k*-dimensional tree) is a space-partitioning data structu
# --instructions--
Write a function to perform a nearest neighbour search using k-d tree. The function takes two parameters: an array of k-dimensional points, and a single k-dimensional point whose nearest neighbour should be returned by the function. A k-dimensional point will be given as an array of k elements.
Write a function to perform a nearest neighbor search using k-d tree. The function takes two parameters: an array of k-dimensional points, and a single k-dimensional point whose nearest neighbor should be returned by the function. A k-dimensional point will be given as an array of k elements.
# --hints--

View File

@@ -42,7 +42,7 @@ It produces the thinned output:
## Algorithm
Assume black pixels are one and white pixels zero, and that the input image is a rectangular N by M array of ones and zeroes. The algorithm operates on all black pixels P1 that can have eight neighbours. The neighbours are, in order, arranged as:
Assume black pixels are one and white pixels zero, and that the input image is a rectangular N by M array of ones and zeroes. The algorithm operates on all black pixels P1 that can have eight neighbors. The neighbors are, in order, arranged as:
$$\begin{array}{|c|c|c|}
\\hline
@@ -51,16 +51,16 @@ $$\begin{array}{|c|c|c|}
P7 & P6 & P5\\\\ \\hline
\end{array}$$
Obviously the boundary pixels of the image cannot have the full eight neighbours.
Obviously the boundary pixels of the image cannot have the full eight neighbors.
- Define $A(P1)$ = the number of transitions from white to black, ($0 \to 1$) in the sequence P2, P3, P4, P5, P6, P7, P8, P9, P2. (Note the extra P2 at the end - it is circular).
- Define $B(P1)$ = the number of black pixel neighbours of P1. ($= \\sum(P2 \ldots P9)$)
- Define $B(P1)$ = the number of black pixel neighbors of P1. ($= \\sum(P2 \ldots P9)$)
**Step 1:**
All pixels are tested and pixels satisfying all the following conditions (simultaneously) are just noted at this stage.
1. The pixel is black and has eight neighbours
1. The pixel is black and has eight neighbors
2. $2 \le B(P1) \le 6$
3. $A(P1) = 1$
4. At least one of $P2$, $P4$ and $P6$ is white
@@ -72,7 +72,7 @@ After iterating over the image and collecting all the pixels satisfying all step
All pixels are again tested and pixels satisfying all the following conditions are just noted at this stage.
1. The pixel is black and has eight neighbours
1. The pixel is black and has eight neighbors
2. $2 \le B(P1) \le 6$
3. $A(P1) = 1$
4. At least one of $P2$, $P4$ and $P8$ is white

View File

@@ -17,7 +17,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
- `"Your cat will look very cuddly today."`
- `"The weather will be nice tomorrow."`
- `"Be cautious of your new neighbours."`
- `"Be cautious of your new neighbors."`
- `"You will find a new hobby soon."`
- `"It would be wise to avoid the color red today."`
@@ -32,7 +32,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
- If `randomNumber` is 5, assign the value of `fortune5` to `selectedFortune`.
4. You should log the `selectedFortune` to the console.
# --hints--
You should initialize `fortune1` with a string value.
@@ -120,7 +120,7 @@ assert.match(__helpers.removeJSComments(code), /console\s*\.\s*log\s*\(\s*select
```js
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 fortune3 = "Be cautious of your new neighbors.";
const fortune4 = "You will find a new hobby soon.";
const fortune5 = "It would be wise to avoid the color red today.";