Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/practice/affine-cipher/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Although all monoalphabetic ciphers are weak, the affine cipher is much stronger
The encryption function is:

```text
E(x) = (ai + b) mod m
E(x) = (ax + b) mod m
```

Where:

- `i` is the letter's index from `0` to the length of the alphabet - 1.
- `x` is the letter's index from `0` to the length of the alphabet - 1.
- `m` is the length of the alphabet.
For the Latin alphabet `m` is `26`.
- `a` and `b` are integers which make up the encryption key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Yet, the conjecture claims that no matter the starting number, we'll always end
It was fascinating, but also puzzling.
Why does this always seem to work?
Could there be a number where the process breaks down, looping forever or escaping into infinity?
The notebook suggested solving this could reveal something profound — and with it, fame, [fortune][collatz-prize], and a place in history awaits whoever could unlock its secrets.
The notebook suggested solving this could reveal something profound — and with it, fame, [fortune][collatz-prize], and a place in history await whoever could unlock its secrets.

[collatz-prize]: https://mathprize.net/posts/collatz-conjecture/
4 changes: 2 additions & 2 deletions exercises/practice/dnd-character/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Instructions

For a game of [Dungeons & Dragons][dnd], each player starts by generating a character they can play with.
This character has, among other things, six abilities; strength, dexterity, constitution, intelligence, wisdom and charisma.
This character has, among other things, six abilities: strength, dexterity, constitution, intelligence, wisdom and charisma.
These six abilities have scores that are determined randomly.
You do this by rolling four 6-sided dice and recording the sum of the largest three dice.
You do this six times, once for each ability.

Your character's initial hitpoints are 10 + your character's constitution modifier.
You find your character's constitution modifier by subtracting 10 from your character's constitution, divide by 2 and round down.
To find your character's constitution modifier, subtract 10 from your character's constitution, divide by 2 and round down.

Write a random character generator that follows the above rules.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Your job is to help implement
- the transmitter, which calculates the transmission sequence, and
- the receiver, which decodes it.

A parity bit is simple way of detecting transmission errors.
A parity bit is a simple way of detecting transmission errors.
The transmitters and receivers can only transmit and receive _exactly_ eight bits at a time (including the parity bit).
The parity bit is set so that there is an _even_ number of 1 bits in each transmission, and the parity bit is always the first bit from the right.
So if the receiver receives `11000001`, `01110101` or `01000000` (i.e. a transmission with an odd number of 1 bits), it knows there is an error.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/list-ops/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The precise number and names of the operations to be implemented will be track d
- `filter` (_given a predicate and a list, return the list of all items for which `predicate(item)` is True_);
- `length` (_given a list, return the total number of items within it_);
- `map` (_given a function and a list, return the list of the results of applying `function(item)` on all items_);
- `foldl` (_given a function, a list, and initial accumulator, fold (reduce) each item into the accumulator from the left_);
- `foldl` (_given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the left_);
- `foldr` (_given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right_);
- `reverse` (_given a list, return a list with all the original items, but in reversed order_).

Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/ocr-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Optical Character Recognition or OCR is software that converts images of text in
Given a grid of characters representing some digits, convert the grid to a string of digits.
If the grid has multiple rows of cells, the rows should be separated in the output with a `","`.

- The grid is made of one of more lines of cells.
- The grid is made of one or more lines of cells.
- Each line of the grid is made of one or more cells.
- Each cell is three columns wide and four rows high (3x4) and represents one digit.
- Digits are drawn using pipes (`"|"`), underscores (`"_"`), and spaces (`" "`).
Expand All @@ -22,7 +22,7 @@ The following input (without the comments) is converted to `"1234567890"`.
_ _ _ _ _ _ _ _ #
| _| _||_||_ |_ ||_||_|| | # Decimal numbers.
||_ _| | _||_| ||_| _||_| #
# The fourth line is always blank,
# The fourth line is always blank.
```

The following input is converted to `"123,456,789"`.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/pascals-triangle/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ The leftmost and rightmost values have only one preceding position to consider,
With the topmost value being `1`, it follows from this that all the leftmost and rightmost values are also `1`.

The other values all have two positions to consider.
For example, the fifth row's (`1 4 6 4 1`) middle value is `6`, as the values to its left and right in the preceding row are `3` and `3`:
For example, the fifth row's (`1 4 6 4 1`) middle value is `6`, as the values to its left and right in the preceding row are `3` and `3`.

[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle
2 changes: 1 addition & 1 deletion exercises/practice/pascals-triangle/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Introduction

With the weather being great, you're not looking forward to spending an hour in a classroom.
Annoyed, you enter the class room, where you notice a strangely satisfying triangle shape on the blackboard.
Annoyed, you enter the classroom, where you notice a strangely satisfying triangle shape on the blackboard.
Whilst waiting for your math teacher to arrive, you can't help but notice some patterns in the triangle: the outer values are all ones, each subsequent row has one more value than its previous row and the triangle is symmetrical.
Weird!

Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/pig-latin/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ If a word starts with zero or more consonants followed by `"qu"`, first move tho
For example:

- `"quick"` -> `"ickqu"` -> `"ickquay"` (starts with `"qu"`, no preceding consonants)
- `"square"` -> `"aresqu"` -> `"aresquay"` (starts with one consonant followed by `"qu`")
- `"square"` -> `"aresqu"` -> `"aresquay"` (starts with one consonant followed by `"qu"`)

## Rule 4

If a word starts with one or more consonants followed by `"y"`, first move the consonants preceding the `"y"`to the end of the word, and then add an `"ay"` sound to the end of the word.
If a word starts with one or more consonants followed by `"y"`, first move the consonants preceding the `"y"` to the end of the word, and then add an `"ay"` sound to the end of the word.

Some examples:

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/rational-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ To reduce a rational number `r = a/b`, divide `a` and `b` by the greatest common
So, for example, `gcd(12, 8) = 4`, so `r = 12/8` can be reduced to `(12/4)/(8/4) = 3/2`.
The reduced form of a rational number should be in "standard form" (the denominator should always be a positive integer).
If a denominator with a negative integer is present, multiply both numerator and denominator by `-1` to ensure standard form is reached.
For example, `3/-4` should be reduced to `-3/4`
For example, `3/-4` should be reduced to `-3/4`.

Assume that the programming language you are using does not have an implementation of rational numbers.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For this exercise, you need to know only three things about them:
- Each band acts as a digit of a number.
For example, if they printed a brown band (value 1) followed by a green band (value 5), it would translate to the number 15.
In this exercise, you are going to create a helpful program so that you don't have to remember the values of the bands.
The program will take 3 colors as input, and outputs the correct value, in ohms.
The program will take 3 colors as input, and output the correct value, in ohms.
The color bands are encoded as follows:

- black: 0
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/roman-numerals/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Introduction
# Instructions

Your task is to convert a number from Arabic numerals to Roman numerals.

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/roman-numerals/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Description
# Introduction

Today, most people in the world use Arabic numerals (0–9).
But if you travelled back two thousand years, you'd find that most Europeans were using Roman numerals instead.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/satellite/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An in-order traversal reads the left subtree in-order then the current node and
So in order from left to right.

For example the pre-order traversal of this tree is [a, i, x, f, r].
The in-order traversal of this tree is [i, a, f, x, r]
The in-order traversal of this tree is [i, a, f, x, r].

```text
a
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/sieve/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Your task is to create a program that implements the Sieve of Eratosthenes algor

A prime number is a number larger than 1 that is only divisible by 1 and itself.
For example, 2, 3, 5, 7, 11, and 13 are prime numbers.
By contrast, 6 is _not_ a prime number as it not only divisible by 1 and itself, but also by 2 and 3.
By contrast, 6 is _not_ a prime number as it is not only divisible by 1 and itself, but also by 2 and 3.

To use the Sieve of Eratosthenes, first, write out all the numbers from 2 up to and including your given number.
Then, follow these steps:
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/simple-cipher/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The unencrypted string is called the _plaintext_ and the encrypted string is cal
Converting plaintext to ciphertext is called _encoding_ while the reverse is called _decoding_.

In a _substitution cipher_, each plaintext letter is replaced with a ciphertext letter which is computed with the help of a _key_.
(Note, it is possible for replacement letter to be the same as the original letter.)
(Note, it is possible for the replacement letter to be the same as the original letter.)

## Encoding details

Expand Down
Loading