mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-01 17:03:30 -05:00
chore(curriculum): change to US spelling (#60852)
This commit is contained in:
@@ -8,7 +8,7 @@ import { join } from 'path';
|
||||
|
||||
const CURRICULUM_PATH = '../../../shared/config/curriculum.json';
|
||||
|
||||
// Curriculum is read using fs, because it is too large for VSCode's LSP to handle type inference which causes anoying behaviour.
|
||||
// Curriculum is read using fs, because it is too large for VSCode's LSP to handle type inference which causes annoying behavior.
|
||||
const curriculum = JSON.parse(
|
||||
readFileSync(join(__dirname, CURRICULUM_PATH), 'utf-8')
|
||||
) as Curriculum;
|
||||
|
||||
@@ -890,7 +890,7 @@
|
||||
"learn-special-methods-by-building-a-vector-space": {
|
||||
"title": "Learn Special Methods by Building a Vector Space",
|
||||
"intro": [
|
||||
"Python special methods are called in response to specific operations and enable you to customize the behaviour of your objects in a detailed and effective way.",
|
||||
"Python special methods are called in response to specific operations and enable you to customize the behavior of your objects in a detailed and effective way.",
|
||||
"In this project, you are going to explore some of the most common special methods while learning about vectors by building a vector space."
|
||||
]
|
||||
},
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f4231000cf542c50ff34",
|
||||
"title": "Problem 181: Investigating in how many ways objects of two different colours can be grouped"
|
||||
"title": "Problem 181: Investigating in how many ways objects of two different colors can be grouped"
|
||||
},
|
||||
{
|
||||
"id": "5900f4231000cf542c50ff35",
|
||||
@@ -362,7 +362,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f4291000cf542c50ff3c",
|
||||
"title": "Problem 189: Tri-colouring a triangular grid"
|
||||
"title": "Problem 189: Tri-coloring a triangular grid"
|
||||
},
|
||||
{
|
||||
"id": "5900f42b1000cf542c50ff3d",
|
||||
@@ -382,7 +382,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f42f1000cf542c50ff40",
|
||||
"title": "Problem 194: Coloured Configurations"
|
||||
"title": "Problem 194: Colored Configurations"
|
||||
},
|
||||
{
|
||||
"id": "5900f4311000cf542c50ff43",
|
||||
@@ -394,7 +394,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f4311000cf542c50ff44",
|
||||
"title": "Problem 197: Investigating the behaviour of a recursively defined sequence"
|
||||
"title": "Problem 197: Investigating the behavior of a recursively defined sequence"
|
||||
},
|
||||
{
|
||||
"id": "5900f4331000cf542c50ff45",
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f4751000cf542c50ff87",
|
||||
"title": "Problem 264: Triangle Centres"
|
||||
"title": "Problem 264: Triangle Centers"
|
||||
},
|
||||
{
|
||||
"id": "5900f4761000cf542c50ff88",
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
},
|
||||
{
|
||||
"id": "5900f4e01000cf542c50fff2",
|
||||
"title": "Problem 371: Licence plates"
|
||||
"title": "Problem 371: License plates"
|
||||
},
|
||||
{
|
||||
"id": "5900f4e11000cf542c50fff3",
|
||||
|
||||
@@ -26,7 +26,7 @@ The code editor shows an implementation of this functionality with functions for
|
||||
|
||||
# --instructions--
|
||||
|
||||
Examine the code in the editor. It's using a method that has side effects in the program, causing incorrect behaviour. The final list of open tabs, stored in `finalTabs.tabs`, should be `['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium', 'new tab', 'Netflix', 'YouTube', 'Vine', 'GMail', 'Work mail', 'Docs', 'freeCodeCamp', 'new tab']` but the list produced by the code is slightly different.
|
||||
Examine the code in the editor. It's using a method that has side effects in the program, causing incorrect behavior. The final list of open tabs, stored in `finalTabs.tabs`, should be `['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium', 'new tab', 'Netflix', 'YouTube', 'Vine', 'GMail', 'Work mail', 'Docs', 'freeCodeCamp', 'new tab']` but the list produced by the code is slightly different.
|
||||
|
||||
Change `Window.prototype.tabClose` so that it removes the correct tab.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ dashedName: step-23
|
||||
|
||||
# --description--
|
||||
|
||||
As you can see, the `+` sign is missing from the output. The number sign is displayed by default only if negative. To change this behaviour, you can write a colon after the expression to be evaluated within the curly braces of your f-string, and specify the option `+`. This will allow you to display the sign both for positive and negative numbers.
|
||||
As you can see, the `+` sign is missing from the output. The number sign is displayed by default only if negative. To change this behavior, you can write a colon after the expression to be evaluated within the curly braces of your f-string, and specify the option `+`. This will allow you to display the sign both for positive and negative numbers.
|
||||
|
||||
Modify the string in your two conditional clauses by adding `:+` inside the curly braces after `coefficient`.
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ function contrast(rgb1, rgb2) {
|
||||
return (brightest + 0.05)
|
||||
/ (darkest + 0.05);
|
||||
}
|
||||
const backgroundColour = [27, 27, 50];
|
||||
const backgroundColor = [27, 27, 50];
|
||||
|
||||
for (let elem of document.querySelectorAll('li > a')) {
|
||||
const a = getComputedStyle(elem)?.color;
|
||||
const rgbA = a?.match(/(\d+),\s(\d+),\s(\d+)/);
|
||||
const aColour = [rgbA[1], rgbA[2], rgbA[3]];
|
||||
assert.isAtLeast(contrast(backgroundColour, aColour), 7);
|
||||
const aColor = [rgbA[1], rgbA[2], rgbA[3]];
|
||||
assert.isAtLeast(contrast(backgroundColor, aColor), 7);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -36,17 +36,17 @@ function contrast(rgb1, rgb2) {
|
||||
return (brightest + 0.05)
|
||||
/ (darkest + 0.05);
|
||||
}
|
||||
const backgroundColour = [42, 42, 64];
|
||||
const backgroundColor = [42, 42, 64];
|
||||
|
||||
const foot = getComputedStyle(document.querySelector('footer'))?.color;
|
||||
const a = getComputedStyle(document.querySelector('footer a'))?.color;
|
||||
|
||||
const rgbFoot = foot?.match(/(\d+),\s(\d+),\s(\d+)/);
|
||||
const rgbA = a?.match(/(\d+),\s(\d+),\s(\d+)/);
|
||||
const footColour = [rgbFoot[1], rgbFoot[2], rgbFoot[3]];
|
||||
const aColour = [rgbA[1], rgbA[2], rgbA[3]];
|
||||
assert.isAtLeast(contrast(backgroundColour, footColour), 7);
|
||||
assert.isAtLeast(contrast(backgroundColour, aColour), 7);
|
||||
const footColor = [rgbFoot[1], rgbFoot[2], rgbFoot[3]];
|
||||
const aColor = [rgbA[1], rgbA[2], rgbA[3]];
|
||||
assert.isAtLeast(contrast(backgroundColor, footColor), 7);
|
||||
assert.isAtLeast(contrast(backgroundColor, aColor), 7);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -7,7 +7,7 @@ dashedName: step-27
|
||||
|
||||
# --description--
|
||||
|
||||
The behaviour of the `addItem` method needs to change if the product is already in the cart or not. Create a ternary that checks if the current product is already in the cart. Use `undefined` for both the truthy and falsy expressions to avoid a syntax error.
|
||||
The behavior of the `addItem` method needs to change if the product is already in the cart or not. Create a ternary that checks if the current product is already in the cart. Use `undefined` for both the truthy and falsy expressions to avoid a syntax error.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-116-red-green-or-blue-tiles
|
||||
|
||||
# --description--
|
||||
|
||||
A row of five black square tiles is to have a number of its tiles replaced with coloured oblong tiles chosen from red (length two), green (length three), or blue (length four).
|
||||
A row of five black square tiles is to have a number of its tiles replaced with colored oblong tiles chosen from red (length two), green (length three), or blue (length four).
|
||||
|
||||
If red tiles are chosen there are exactly seven ways this can be done.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-121-disc-game-prize-fund
|
||||
|
||||
# --description--
|
||||
|
||||
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.
|
||||
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its color is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.
|
||||
|
||||
The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem
|
||||
|
||||
# --description--
|
||||
|
||||
A printing shop runs 16 batches (jobs) every week and each batch requires a sheet of special colour-proofing paper of size A5.
|
||||
A printing shop runs 16 batches (jobs) every week and each batch requires a sheet of special color-proofing paper of size A5.
|
||||
|
||||
Every Monday morning, the foreman opens a new envelope, containing a large sheet of the special paper with size A1.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 5900f4231000cf542c50ff34
|
||||
title: >-
|
||||
Problem 181: Investigating in how many ways objects of two different colours
|
||||
Problem 181: Investigating in how many ways objects of two different colors
|
||||
can be grouped
|
||||
challengeType: 1
|
||||
forumTopicId: 301817
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: problem-185-number-mind
|
||||
|
||||
The game Number Mind is a variant of the well known game Master Mind.
|
||||
|
||||
Instead of coloured pegs, you have to guess a secret sequence of digits. After each guess you're only told in how many places you've guessed the correct digit. So, if the sequence was 1234 and you guessed 2036, you'd be told that you have one correct digit; however, you would NOT be told that you also have another digit in the wrong place.
|
||||
Instead of colored pegs, you have to guess a secret sequence of digits. After each guess you're only told in how many places you've guessed the correct digit. So, if the sequence was 1234 and you guessed 2036, you'd be told that you have one correct digit; however, you would NOT be told that you also have another digit in the wrong place.
|
||||
|
||||
For instance, given the following guesses for a 5-digit secret sequence,
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4291000cf542c50ff3c
|
||||
title: 'Problem 189: Tri-colouring a triangular grid'
|
||||
title: 'Problem 189: Tri-coloring a triangular grid'
|
||||
challengeType: 1
|
||||
forumTopicId: 301825
|
||||
dashedName: problem-189-tri-colouring-a-triangular-grid
|
||||
@@ -12,15 +12,15 @@ 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 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.
|
||||
We wish to color the interior of each triangle with one of three colors: red, green or blue, so that no two neighboring triangles have the same color. Such a coloring 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:
|
||||
For example, here is a valid coloring of the above grid:
|
||||
|
||||
<img alt="colored grid of 64 triangles" src="https://cdn.freecodecamp.org/curriculum/project-euler/tri-colouring-a-triangular-grid-2.gif" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
A colouring C' which is obtained from a colouring C by rotation or reflection is considered distinct from C unless the two are identical.
|
||||
A coloring C' which is obtained from a coloring C by rotation or reflection is considered distinct from C unless the two are identical.
|
||||
|
||||
How many distinct valid colourings are there for the above configuration?
|
||||
How many distinct valid colorings are there for the above configuration?
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f42f1000cf542c50ff40
|
||||
title: 'Problem 194: Coloured Configurations'
|
||||
title: 'Problem 194: Colored Configurations'
|
||||
challengeType: 1
|
||||
forumTopicId: 301832
|
||||
dashedName: problem-194-coloured-configurations
|
||||
@@ -11,7 +11,7 @@ dashedName: problem-194-coloured-configurations
|
||||
Consider graphs built with the units A: <img alt="graph unit A" src="https://cdn.freecodecamp.org/curriculum/project-euler/coloured-configurations-1.png" style="display: inline-block; background-color: white; padding: 10px;">
|
||||
and B: <img alt="graph unit B" src="https://cdn.freecodecamp.org/curriculum/project-euler/coloured-configurations-2.png" style="display: inline-block; background-color: white; padding: 10px;">, where the units are glued along the vertical edges as in the graph <img alt="graph with four units glued along the vertical edges" src="https://cdn.freecodecamp.org/curriculum/project-euler/coloured-configurations-3.png" style="display: inline-block; background-color: white; padding: 10px;">.
|
||||
|
||||
A configuration of type $(a,b,c)$ is a graph thus built of $a$ units A and $b$ units B, where the graph's vertices are coloured using up to $c$ colours, so that no two adjacent vertices have the same colour. The compound graph above is an example of a configuration of type $(2,2,6)$, in fact of type $(2,2,c)$ for all $c ≥ 4$
|
||||
A configuration of type $(a,b,c)$ is a graph thus built of $a$ units A and $b$ units B, where the graph's vertices are colored using up to $c$ colors, so that no two adjacent vertices have the same color. The compound graph above is an example of a configuration of type $(2,2,6)$, in fact of type $(2,2,c)$ for all $c ≥ 4$
|
||||
|
||||
Let $N(a,b,c)$ be the number of configurations of type $(a,b,c)$. For example, $N(1,0,3) = 24$, $N(0,2,4) = 92928$ and $N(2,2,3) = 20736$.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4311000cf542c50ff44
|
||||
title: 'Problem 197: Investigating the behaviour of a recursively defined sequence'
|
||||
title: 'Problem 197: Investigating the behavior of a recursively defined sequence'
|
||||
challengeType: 1
|
||||
forumTopicId: 301835
|
||||
dashedName: problem-197-investigating-the-behaviour-of-a-recursively-defined-sequence
|
||||
|
||||
@@ -14,7 +14,7 @@ The area under the blancmange curve is equal to $\frac{1}{2}$, shown in pink in
|
||||
|
||||
<img alt="diagram of blancmange curve, with circle C shown on diagram" src="https://cdn.freecodecamp.org/curriculum/project-euler/a-scoop-of-blancmange.gif" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
Let $C$ be the circle with centre ($\frac{1}{4}$,$\frac{1}{2}$) and radius $\frac{1}{4}$, shown in black in the diagram.
|
||||
Let $C$ be the circle with center ($\frac{1}{4}$,$\frac{1}{2}$) and radius $\frac{1}{4}$, shown in black in the diagram.
|
||||
|
||||
What area under the blancmange curve is enclosed by $C$? Give your answer rounded to eight decimal places in the form 0.abcdefgh
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ For any denominator, $d$, there will be $d−1$ proper fractions; for example, w
|
||||
|
||||
$$\frac{1}{12}, \frac{2}{12}, \frac{3}{12}, \frac{4}{12}, \frac{5}{12}, \frac{6}{12}, \frac{7}{12}, \frac{8}{12}, \frac{9}{12}, \frac{10}{12}, \frac{11}{12}$$
|
||||
|
||||
We shall call a fraction that cannot be cancelled down a resilient fraction.
|
||||
We shall call a fraction that cannot be canceled down a resilient fraction.
|
||||
|
||||
Furthermore we shall define the resilience of a denominator, $R(d)$, to be the ratio of its proper fractions that are resilient; for example, $R(12) = \frac{4}{11}$.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-245-coresilience
|
||||
|
||||
# --description--
|
||||
|
||||
We shall call a fraction that cannot be cancelled down a resilient fraction.
|
||||
We shall call a fraction that cannot be canceled down a resilient fraction.
|
||||
|
||||
Furthermore we shall define the resilience of a denominator, $R(d)$, to be the ratio of its proper fractions that are resilient; for example, $R(12) = \frac{4}{11}$.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: problem-246-tangents-to-an-ellipse
|
||||
|
||||
A definition for an ellipse is:
|
||||
|
||||
Given a circle $c$ with centre $M$ and radius $r$ and a point $G$ such that $d(G, M) < r$, the locus of the points that are equidistant from $c$ and $G$ form an ellipse.
|
||||
Given a circle $c$ with center $M$ and radius $r$ and a point $G$ such that $d(G, M) < r$, the locus of the points that are equidistant from $c$ and $G$ form an ellipse.
|
||||
|
||||
The construction of the points of the ellipse is shown below.
|
||||
|
||||
@@ -18,7 +18,7 @@ The construction of the points of the ellipse is shown below.
|
||||
|
||||
Given are the points $M(-2000, 1500)$ and $G(8000, 1500)$.
|
||||
|
||||
Given is also the circle $c$ with centre $M$ and radius $15\\,000$.
|
||||
Given is also the circle $c$ with center $M$ and radius $15\\,000$.
|
||||
|
||||
The locus of the points that are equidistant from $G$ and $c$ form an ellipse $e$.
|
||||
|
||||
@@ -26,7 +26,7 @@ From a point $P$ outside $e$ the two tangents $t_1$ and $t_2$ to the ellipse are
|
||||
|
||||
Let the points where $t_1$ and $t_2$ touch the ellipse be $R$ and $S$.
|
||||
|
||||
<img alt="circle c with the centre M, radius 15000, and point P outsie of ellipse e; from point P two tangents t_1 and t_2 are drawn to the ellipse, with points touching ellipse are R and S" src="https://cdn.freecodecamp.org/curriculum/project-euler/tangents-to-an-ellipse-2.gif" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
<img alt="circle c with the center M, radius 15000, and point P outside of ellipse e; from point P two tangents t_1 and t_2 are drawn to the ellipse, with points touching ellipse are R and S" src="https://cdn.freecodecamp.org/curriculum/project-euler/tangents-to-an-ellipse-2.gif" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
For how many lattice points $P$ is angle $RPS$ greater than 45°?
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4751000cf542c50ff87
|
||||
title: 'Problem 264: Triangle Centres'
|
||||
title: 'Problem 264: Triangle Centers'
|
||||
challengeType: 1
|
||||
forumTopicId: 301913
|
||||
dashedName: problem-264-triangle-centres
|
||||
@@ -11,8 +11,8 @@ dashedName: problem-264-triangle-centres
|
||||
Consider all the triangles having:
|
||||
|
||||
- All their vertices on lattice points.
|
||||
- Circumcentre at the origin O.
|
||||
- Orthocentre at the point H(5, 0).
|
||||
- Circumcenter at the origin O.
|
||||
- Orthocenter at the point H(5, 0).
|
||||
|
||||
There are nine such triangles having a $\text{perimeter} ≤ 50$.
|
||||
|
||||
@@ -45,10 +45,10 @@ Find all such triangles with a $\text{perimeter} ≤ {10}^5$. Enter as your answ
|
||||
|
||||
# --hints--
|
||||
|
||||
`triangleCentres()` should return `2816417.1055`.
|
||||
`triangleCenters()` should return `2816417.1055`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(triangleCentres(), 2816417.1055);
|
||||
assert.strictEqual(triangleCenters(), 2816417.1055);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@@ -56,12 +56,12 @@ assert.strictEqual(triangleCentres(), 2816417.1055);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function triangleCentres() {
|
||||
function triangleCenters() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
triangleCentres();
|
||||
triangleCenters();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
@@ -11,9 +11,9 @@ dashedName: problem-275-balanced-sculptures
|
||||
Let us define a balanced sculpture of order $n$ as follows:
|
||||
|
||||
- A polyomino made up of $n + 1$ tiles known as the blocks ($n$ tiles) and the plinth (remaining tile);
|
||||
- the plinth has its centre at position ($x = 0$, $y = 0$);
|
||||
- the plinth has its center at position ($x = 0$, $y = 0$);
|
||||
- the blocks have $y$-coordinates greater than zero (so the plinth is the unique lowest tile);
|
||||
- the centre of mass of all the blocks, combined, has $x$-coordinate equal to zero.
|
||||
- the center of mass of all the blocks, combined, has $x$-coordinate equal to zero.
|
||||
|
||||
When counting the sculptures, any arrangements which are simply reflections about the $y$-axis, are <u>not</u> counted as distinct. For example, the 18 balanced sculptures of order 6 are shown below; note that each pair of mirror images (about the $y$-axis) is counted as one sculpture:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: problem-295-lenticular-holes
|
||||
|
||||
We call the convex area enclosed by two circles a lenticular hole if:
|
||||
|
||||
- The centres of both circles are on lattice points.
|
||||
- The centers of both circles are on lattice points.
|
||||
- The two circles intersect at two distinct lattice points.
|
||||
- The interior of the convex area enclosed by both circles does not contain any lattice points.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ A spherical triangle is a figure formed on the surface of a sphere by three grea
|
||||
|
||||
<img alt="spherical triangle formed on the surface of a sphere" src="https://cdn.freecodecamp.org/curriculum/project-euler/spherical-triangles.jpg" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
Let $C(r)$ be the sphere with the centre (0,0,0) and radius $r$.
|
||||
Let $C(r)$ be the sphere with the center (0,0,0) and radius $r$.
|
||||
|
||||
Let $Z(r)$ be the set of points on the surface of $C(r)$ with integer coordinates.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-349-langtons-ant
|
||||
|
||||
# --description--
|
||||
|
||||
An ant moves on a regular grid of squares that are coloured either black or white.
|
||||
An ant moves on a regular grid of squares that are colored either black or white.
|
||||
|
||||
The ant is always oriented in one of the cardinal directions (left, right, up or down) and moves from square to adjacent square according to the following rules:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ dashedName: problem-353-risky-moon
|
||||
|
||||
# --description--
|
||||
|
||||
A moon could be described by the sphere $C(r)$ with centre (0, 0, 0) and radius $r$.
|
||||
A moon could be described by the sphere $C(r)$ with center (0, 0, 0) and radius $r$.
|
||||
|
||||
There are stations on the moon at the points on the surface of $C(r)$ with integer coordinates. The station at (0, 0, $r$) is called North Pole station, the station at (0, 0, $-r$) is called South Pole station.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Consider a honey bee's honeycomb where each cell is a perfect regular hexagon wi
|
||||
|
||||
<img alt="honeycomb with hexagon sides of length 1" src="https://cdn.freecodecamp.org/curriculum/project-euler/distances-in-a-bees-honeycomb.png" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
One particular cell is occupied by the queen bee. For a positive real number $L$, let $B(L)$ count the cells with distance $L$ from the queen bee cell (all distances are measured from centre to centre); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider.
|
||||
One particular cell is occupied by the queen bee. For a positive real number $L$, let $B(L)$ count the cells with distance $L$ from the queen bee cell (all distances are measured from center to center); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider.
|
||||
|
||||
For example, $B(\sqrt{3}) = 6$, $B(\sqrt{21}) = 12$ and $B(111\\,111\\,111) = 54$.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f4e01000cf542c50fff2
|
||||
title: 'Problem 371: Licence plates'
|
||||
title: 'Problem 371: License plates'
|
||||
challengeType: 1
|
||||
forumTopicId: 302033
|
||||
dashedName: problem-371-licence-plates
|
||||
@@ -8,17 +8,17 @@ dashedName: problem-371-licence-plates
|
||||
|
||||
# --description--
|
||||
|
||||
Oregon licence plates consist of three letters followed by a three digit number (each digit can be from [0...9]).
|
||||
Oregon license plates consist of three letters followed by a three digit number (each digit can be from [0...9]).
|
||||
|
||||
While driving to work Seth plays the following game:
|
||||
|
||||
Whenever the numbers of two licence plates seen on his trip add to 1000 that's a win.
|
||||
Whenever the numbers of two license plates seen on his trip add to 1000 that's a win.
|
||||
|
||||
E.g. `MIC-012` and `HAN-988` is a win and `RYU-500` and `SET-500` too (as long as he sees them in the same trip).
|
||||
|
||||
Find the expected number of plates he needs to see for a win. Give your answer rounded to 8 decimal places behind the decimal point.
|
||||
|
||||
**Note:** We assume that each licence plate seen is equally likely to have any three digit number on it.
|
||||
**Note:** We assume that each license plate seen is equally likely to have any three digit number on it.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ The pie is circular. He starts with slicing an initial cut in the pie along a ra
|
||||
|
||||
While there is at least a given fraction $F$ of pie left, he performs the following procedure:
|
||||
|
||||
- He makes two slices from the pie centre to any point of what is remaining of the pie border, any point on the remaining pie border equally likely. This will divide the remaining pie into three pieces.
|
||||
- He makes two slices from the pie center to any point of what is remaining of the pie border, any point on the remaining pie border equally likely. This will divide the remaining pie into three pieces.
|
||||
- Going counterclockwise from the initial cut, he takes the first two pie pieces and eats them.
|
||||
|
||||
When less than a fraction $F$ of pie remains, he does not repeat this procedure. Instead, he eats all of the remaining pie.
|
||||
|
||||
@@ -10,7 +10,7 @@ dashedName: problem-431-square-space-silo
|
||||
|
||||
Fred the farmer arranges to have a new storage silo installed on his farm and having an obsession for all things square he is absolutely devastated when he discovers that it is circular. Quentin, the representative from the company that installed the silo, explains that they only manufacture cylindrical silos, but he points out that it is resting on a square base. Fred is not amused and insists that it is removed from his property.
|
||||
|
||||
Quick thinking Quentin explains that when granular materials are delivered from above a conical slope is formed and the natural angle made with the horizontal is called the angle of repose. For example if the angle of repose, $\alpha = 30°$, and grain is delivered at the centre of the silo then a perfect cone will form towards the top of the cylinder. In the case of this silo, which has a diameter of 6m, the amount of space wasted would be approximately 32.648388556 m<sup>3</sup>. However, if grain is delivered at a point on the top which has a horizontal distance of $x$ metres from the centre then a cone with a strangely curved and sloping base is formed. He shows Fred a picture.
|
||||
Quick thinking Quentin explains that when granular materials are delivered from above a conical slope is formed and the natural angle made with the horizontal is called the angle of repose. For example if the angle of repose, $\alpha = 30°$, and grain is delivered at the center of the silo then a perfect cone will form towards the top of the cylinder. In the case of this silo, which has a diameter of 6m, the amount of space wasted would be approximately 32.648388556 m<sup>3</sup>. However, if grain is delivered at a point on the top which has a horizontal distance of $x$ metres from the center then a cone with a strangely curved and sloping base is formed. He shows Fred a picture.
|
||||
|
||||
<img alt="image presenting forming of the perfect cone towards the top of the cylinder" src="https://cdn.freecodecamp.org/curriculum/project-euler/square-space-silo.png" style="background-color: white; padding: 10px; display: block; margin-right: auto; margin-left: auto; margin-bottom: 1.2rem;">
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ dashedName: problem-449-chocolate-covered-candy
|
||||
|
||||
# --description--
|
||||
|
||||
Phil the confectioner is making a new batch of chocolate covered candy. Each candy centre is shaped like an ellipsoid of revolution defined by the equation: $b^2x^2 + b^2y^2 + a^2z^2 = a^2b^2$.
|
||||
Phil the confectioner is making a new batch of chocolate covered candy. Each candy center is shaped like an ellipsoid of revolution defined by the equation: $b^2x^2 + b^2y^2 + a^2z^2 = a^2b^2$.
|
||||
|
||||
Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick.
|
||||
Phil wants to know how much chocolate is needed to cover one candy center with a uniform coat of chocolate one millimeter thick.
|
||||
|
||||
If $a = 1$ mm and $b = 1$ mm, the amount of chocolate required is $\frac{28}{3} \pi$ mm<sup>3</sup>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ How does Brian feel about Maria's comment?
|
||||
|
||||
## --answers--
|
||||
|
||||
He agrees with her and thinks the project should be cancelled
|
||||
He agrees with her and thinks the project should be canceled
|
||||
|
||||
### --feedback--
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ The phrase implies multiple topics, not just one.
|
||||
|
||||
---
|
||||
|
||||
The meeting will be cancelled today.
|
||||
The meeting will be canceled today.
|
||||
|
||||
### --feedback--
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ This two-word phrase refers to the planned time or timeline for releasing a prod
|
||||
|
||||
`Not necessarily` means something might not be true, even if it seems that way. For example:
|
||||
|
||||
- Person 1: `Is it going to be cancelled?`
|
||||
- Person 1: `Is it going to be canceled?`
|
||||
|
||||
- Person 2: `Not necessarily.` - This means it's possible, but not certain.
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ They are not moving as fast as planned.
|
||||
|
||||
---
|
||||
|
||||
They were cancelled.
|
||||
They were canceled.
|
||||
|
||||
### --feedback--
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ body {
|
||||
|
||||
In this example, we've set a white background (`#FFFFFF`) and dark gray text (`#333333`). You can input these color codes into the WebAIM tool to check their contrast ratio.
|
||||
|
||||
Another valuable tool is the TPGi Colour Contrast Analyzer. This desktop application offers more advanced features compared to online tools. It allows you to analyze entire web pages, not just individual color pairs. You can use its color picker to select colors directly from your screen, making it easier to check contrast ratios for existing designs.
|
||||
Another valuable tool is the TPGi Colour Contrast Analyzer. This desktop application offers more advanced features compared to online tools. It allows you to analyze entire web pages, not just individual color pairs. You can use its color picker to select colors directly from your screen, making it easier to check contrast ratios for existing designs.
|
||||
|
||||
The TPGi Colour Contrast Analyzer also provides simulations for different types of color vision deficiencies, helping you ensure your design is accessible to users with various forms of color blindness.
|
||||
|
||||
@@ -79,7 +79,7 @@ Think about why contrast between text and background is important for users.
|
||||
|
||||
## --text--
|
||||
|
||||
Which feature does the TPGi Color Contrast Analyzer offer that most online contrast checkers don't?
|
||||
Which feature does the TPGi Colour Contrast Analyzer offer that most online contrast checkers don't?
|
||||
|
||||
## --answers--
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ The strikethrough element, or `s` element for short, should be used to represent
|
||||
```html
|
||||
<p><s>Tomorrow's hike will be meeting at noon.</s></p>
|
||||
|
||||
<p>Due to unforeseen weather conditions, the hike has been cancelled.</p>
|
||||
<p>Due to unforeseen weather conditions, the hike has been canceled.</p>
|
||||
```
|
||||
|
||||
In this example, the first sentence is crossed out because the hike was cancelled due to weather reasons.
|
||||
In this example, the first sentence is crossed out because the hike was canceled due to weather reasons.
|
||||
|
||||
The `s` element should never be used to just to show changes to a document. More appropriate elements in that case would be the deleted text element and the inserted text element.
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ What are the arguments of the `print()` function in Python?
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about the arguments that control formatting, output location, and buffering behaviour.
|
||||
Think about the arguments that control formatting, output location, and buffering behavior.
|
||||
|
||||
---
|
||||
|
||||
@@ -154,7 +154,7 @@ Think about the arguments that control formatting, output location, and bufferin
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about the arguments that control formatting, output location, and buffering behaviour.
|
||||
Think about the arguments that control formatting, output location, and buffering behavior.
|
||||
|
||||
---
|
||||
|
||||
@@ -162,7 +162,7 @@ Think about the arguments that control formatting, output location, and bufferin
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about the arguments that control formatting, output location, and buffering behaviour.
|
||||
Think about the arguments that control formatting, output location, and buffering behavior.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ if (true){
|
||||
console.log(num); // 5
|
||||
```
|
||||
|
||||
This behaviour can lead to unintended variable leaks and make your code more prone to bugs.
|
||||
This behavior can lead to unintended variable leaks and make your code more prone to bugs.
|
||||
|
||||
Due to this issues, modern JavaScript development has largely moved away from `var` in favor of `let` and `const`. These keywords provide block scoping which aligns more closely with how scoping works in many other programming languages.
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ let age = prompt("How old are you?");
|
||||
if (age !== null) {
|
||||
console.log("You are " + age + " years old.");
|
||||
} else {
|
||||
console.log("User cancelled the prompt.");
|
||||
console.log("User canceled the prompt.");
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Which of the following tools allows you to enter background and foreground color
|
||||
|
||||
#### --distractors--
|
||||
|
||||
TPGi Color Contrast Analyzer
|
||||
TPGi Colour Contrast Analyzer
|
||||
|
||||
---
|
||||
|
||||
@@ -77,7 +77,7 @@ WebAIM's Color Contrast Checker
|
||||
|
||||
#### --answer--
|
||||
|
||||
TPGi Color Contrast Analyzer
|
||||
TPGi Colour Contrast Analyzer
|
||||
|
||||
### --question--
|
||||
|
||||
|
||||
@@ -453,7 +453,7 @@ What is event delegation?
|
||||
|
||||
#### --distractors--
|
||||
|
||||
The process of listening to events when an event is cancelled.
|
||||
The process of listening to events when an event is canceled.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ The `lang` attribute inside the open `i` tag is used to specify the language of
|
||||
<s>Tomorrow's hike will be meeting at noon.</s>
|
||||
</p>
|
||||
<p>
|
||||
Due to unforeseen weather conditions, the hike has been cancelled.
|
||||
Due to unforeseen weather conditions, the hike has been canceled.
|
||||
</p>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user