Skip to content

Commit

Permalink
Sync exercise docs and metadata (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Aug 29, 2023
1 parent a310b82 commit b8eb7b7
Show file tree
Hide file tree
Showing 62 changed files with 208 additions and 173 deletions.
20 changes: 10 additions & 10 deletions exercises/practice/allergies/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ An allergy test produces a single numeric score which contains the information a

The list of items (and their value) that were tested are:

* eggs (1)
* peanuts (2)
* shellfish (4)
* strawberries (8)
* tomatoes (16)
* chocolate (32)
* pollen (64)
* cats (128)
- eggs (1)
- peanuts (2)
- shellfish (4)
- strawberries (8)
- tomatoes (16)
- chocolate (32)
- pollen (64)
- cats (128)

So if Tom is allergic to peanuts and chocolate, he gets a score of 34.

Now, given just that score of 34, your program should be able to say:

* Whether Tom is allergic to any one of those allergens listed above.
* All the allergens Tom is allergic to.
- Whether Tom is allergic to any one of those allergens listed above.
- All the allergens Tom is allergic to.

Note: a given score may include allergens **not** listed above (i.e. allergens that score 256, 512, 1024, etc.).
Your program should ignore those components of the score.
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/allergies/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
]
},
"blurb": "Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.",
"source": "Jumpstart Lab Warm-up",
"source_url": "http://jumpstartlab.com"
"source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.",
"source_url": "https://turing.edu"
}
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
},
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
"source": "Wikipedia",
"source_url": "http://en.wikipedia.org/wiki/Atbash"
"source_url": "https://en.wikipedia.org/wiki/Atbash"
}
2 changes: 1 addition & 1 deletion exercises/practice/beer-song/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
},
"blurb": "Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.",
"source": "Learn to Program by Chris Pine",
"source_url": "http://pine.fm/LearnToProgram/?Chapter=06"
"source_url": "https://pine.fm/LearnToProgram/?Chapter=06"
}
2 changes: 1 addition & 1 deletion exercises/practice/binary-search/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Binary search only works when a list has been sorted.

The algorithm looks like this:

- Find the middle element of a sorted list and compare it with the item we're looking for.
- Find the middle element of a *sorted* list and compare it with the item we're looking for.
- If the middle element is our item, then we're done!
- If the middle element is greater than our item, we can eliminate that element and all the elements **after** it.
- If the middle element is less than our item, we can eliminate that element and all the elements **before** it.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/binary-search/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
},
"blurb": "Implement a binary search algorithm.",
"source": "Wikipedia",
"source_url": "http://en.wikipedia.org/wiki/Binary_search_algorithm"
"source_url": "https://en.wikipedia.org/wiki/Binary_search_algorithm"
}
2 changes: 1 addition & 1 deletion exercises/practice/binary/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
},
"blurb": "Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.",
"source": "All of Computer Science",
"source_url": "http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-"
"source_url": "https://www.wolframalpha.com/examples/mathematics/numbers/base-conversions"
}
2 changes: 1 addition & 1 deletion exercises/practice/bob/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
},
"blurb": "Bob is a lackadaisical teenager. In conversation, his responses are very limited.",
"source": "Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial.",
"source_url": "http://pine.fm/LearnToProgram/?Chapter=06"
"source_url": "https://pine.fm/LearnToProgram/?Chapter=06"
}
2 changes: 1 addition & 1 deletion exercises/practice/circular-buffer/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
},
"blurb": "A data structure that uses a single, fixed-size buffer as if it were connected end-to-end.",
"source": "Wikipedia",
"source_url": "http://en.wikipedia.org/wiki/Circular_buffer"
"source_url": "https://en.wikipedia.org/wiki/Circular_buffer"
}
31 changes: 12 additions & 19 deletions exercises/practice/crypto-square/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Implement the classic method for composing secret messages called a square code.

Given an English text, output the encoded version of that text.

First, the input is normalized: the spaces and punctuation are removed
from the English text and the message is down-cased.
First, the input is normalized: the spaces and punctuation are removed from the English text and the message is down-cased.

Then, the normalized characters are broken into rows. These rows can be
regarded as forming a rectangle when printed with intervening newlines.
Then, the normalized characters are broken into rows.
These rows can be regarded as forming a rectangle when printed with intervening newlines.

For example, the sentence

Expand All @@ -22,18 +21,16 @@ is normalized to:
"ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots"
```

The plaintext should be organized in to a rectangle. The size of the
rectangle should be decided by the length of the message.
The plaintext should be organized into a rectangle as square as possible.
The size of the rectangle should be decided by the length of the message.

If `c` is the number of columns and `r` is the number of rows, then for
the rectangle `r` x `c` find the smallest possible integer `c` such that:
If `c` is the number of columns and `r` is the number of rows, then for the rectangle `r` x `c` find the smallest possible integer `c` such that:

- `r * c >= length(message)`,
- `r * c >= length of message`,
- and `c >= r`,
- and `c - r <= 1`.

Our normalized text is 54 characters long, dictating a rectangle with
`c = 8` and `r = 7`:
Our normalized text is 54 characters long, dictating a rectangle with `c = 8` and `r = 7`:

```text
"ifmanwas"
Expand All @@ -45,26 +42,22 @@ Our normalized text is 54 characters long, dictating a rectangle with
"sroots "
```

The coded message is obtained by reading down the columns going left to
right.
The coded message is obtained by reading down the columns going left to right.

The message above is coded as:

```text
"imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau"
```

Output the encoded text in chunks that fill perfect rectangles `(r X c)`,
with `c` chunks of `r` length, separated by spaces. For phrases that are
`n` characters short of the perfect rectangle, pad each of the last `n`
chunks with a single trailing space.
Output the encoded text in chunks that fill perfect rectangles `(r X c)`, with `c` chunks of `r` length, separated by spaces.
For phrases that are `n` characters short of the perfect rectangle, pad each of the last `n` chunks with a single trailing space.

```text
"imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
```

Notice that were we to stack these, we could visually decode the
ciphertext back in to the original message:
Notice that were we to stack these, we could visually decode the ciphertext back in to the original message:

```text
"imtgdvs"
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/crypto-square/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
},
"blurb": "Implement the classic method for composing secret messages called a square code.",
"source": "J Dalbey's Programming Practice problems",
"source_url": "http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html"
"source_url": "https://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html"
}
12 changes: 6 additions & 6 deletions exercises/practice/darts/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ Write a function that returns the earned points in a single toss of a Darts game

In our particular instance of the game, the target rewards 4 different amounts of points, depending on where the dart lands:

* If the dart lands outside the target, player earns no points (0 points).
* If the dart lands in the outer circle of the target, player earns 1 point.
* If the dart lands in the middle circle of the target, player earns 5 points.
* If the dart lands in the inner circle of the target, player earns 10 points.
- If the dart lands outside the target, player earns no points (0 points).
- If the dart lands in the outer circle of the target, player earns 1 point.
- If the dart lands in the middle circle of the target, player earns 5 points.
- If the dart lands in the inner circle of the target, player earns 10 points.

The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1.
Of course, they are all centered at the same point (that is, the circles are [concentric][] defined by the coordinates (0, 0).
Of course, they are all centered at the same point that is, the circles are [concentric][] defined by the coordinates (0, 0).

Write a function that given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), returns the correct amount earned by a dart landing at that point.

[darts]: https://en.wikipedia.org/wiki/Darts
[darts-target]: https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg
[concentric]: http://mathworld.wolfram.com/ConcentricCircles.html
[concentric]: https://mathworld.wolfram.com/ConcentricCircles.html
[cartesian-coordinates]: https://www.mathsisfun.com/data/cartesian-coordinates.html
[real-numbers]: https://www.mathsisfun.com/numbers/real-numbers.html
22 changes: 11 additions & 11 deletions exercises/practice/diamond/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Given a letter, it prints a diamond starting with 'A', with the supplied letter

## Requirements

* The first row contains one 'A'.
* The last row contains one 'A'.
* All rows, except the first and last, have exactly two identical letters.
* All rows have as many trailing spaces as leading spaces. (This might be 0).
* The diamond is horizontally symmetric.
* The diamond is vertically symmetric.
* The diamond has a square shape (width equals height).
* The letters form a diamond shape.
* The top half has the letters in ascending order.
* The bottom half has the letters in descending order.
* The four corners (containing the spaces) are triangles.
- The first row contains one 'A'.
- The last row contains one 'A'.
- All rows, except the first and last, have exactly two identical letters.
- All rows have as many trailing spaces as leading spaces. (This might be 0).
- The diamond is horizontally symmetric.
- The diamond is vertically symmetric.
- The diamond has a square shape (width equals height).
- The letters form a diamond shape.
- The top half has the letters in ascending order.
- The bottom half has the letters in descending order.
- The four corners (containing the spaces) are triangles.

## Examples

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/diamond/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
},
"blurb": "Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.",
"source": "Seb Rose",
"source_url": "http://claysnow.co.uk/recycling-tests-in-tdd/"
"source_url": "https://web.archive.org/web/20220807163751/http://claysnow.co.uk/recycling-tests-in-tdd/"
}
2 changes: 1 addition & 1 deletion exercises/practice/difference-of-squares/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
},
"blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.",
"source": "Problem 6 at Project Euler",
"source_url": "http://projecteuler.net/problem=6"
"source_url": "https://projecteuler.net/problem=6"
}
6 changes: 3 additions & 3 deletions exercises/practice/etl/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
".meta/example.h"
]
},
"blurb": "We are going to do the `Transform` step of an Extract-Transform-Load.",
"source": "The Jumpstart Lab team",
"source_url": "http://jumpstartlab.com"
"blurb": "Change the data format for scoring a game to more easily add other languages.",
"source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.",
"source_url": "https://turing.edu"
}
4 changes: 2 additions & 2 deletions exercises/practice/gigasecond/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Then we can use metric system prefixes for writing large numbers of seconds in m
- Perhaps you and your family would travel to somewhere exotic for two megaseconds (that's two million seconds).
- And if you and your spouse were married for _a thousand million_ seconds, you would celebrate your one gigasecond anniversary.

```exercism/note
~~~~exercism/note
If we ever colonize Mars or some other planet, measuring time is going to get even messier.
If someone says "year" do they mean a year on Earth or a year on Mars?
The idea for this exercise came from the science fiction novel ["A Deepness in the Sky"][vinge-novel] by author Vernor Vinge.
In it the author uses the metric system as the basis for time measurements.
[vinge-novel]: https://www.tor.com/2017/08/03/science-fiction-with-something-for-everyone-a-deepness-in-the-sky-by-vernor-vinge/
```
~~~~
2 changes: 1 addition & 1 deletion exercises/practice/gigasecond/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
},
"blurb": "Given a moment, determine the moment that would be after a gigasecond has passed.",
"source": "Chapter 9 in Chris Pine's online Learn to Program tutorial.",
"source_url": "http://pine.fm/LearnToProgram/?Chapter=09"
"source_url": "https://pine.fm/LearnToProgram/?Chapter=09"
}
4 changes: 2 additions & 2 deletions exercises/practice/grains/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
]
},
"blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.",
"source": "JavaRanch Cattle Drive, exercise 6",
"source_url": "http://www.javaranch.com/grains.jsp"
"source": "The CodeRanch Cattle Drive, Assignment 6",
"source_url": "https://coderanch.com/wiki/718824/Grains"
}
2 changes: 1 addition & 1 deletion exercises/practice/hamming/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
},
"blurb": "Calculate the Hamming difference between two DNA strands.",
"source": "The Calculating Point Mutations problem at Rosalind",
"source_url": "http://rosalind.info/problems/hamm/"
"source_url": "https://rosalind.info/problems/hamm/"
}
2 changes: 1 addition & 1 deletion exercises/practice/hello-world/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ The objectives are simple:

If everything goes well, you will be ready to fetch your first real exercise.

[hello-world]: http://en.wikipedia.org/wiki/%22Hello,_world!%22_program
[hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program
2 changes: 1 addition & 1 deletion exercises/practice/hello-world/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
},
"blurb": "The classical introductory exercise. Just say \"Hello, World!\".",
"source": "This is an exercise to introduce users to using Exercism",
"source_url": "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
"source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
},
"blurb": "Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.",
"source": "A variation on Problem 8 at Project Euler",
"source_url": "http://projecteuler.net/problem=8"
"source_url": "https://projecteuler.net/problem=8"
}
2 changes: 1 addition & 1 deletion exercises/practice/leap/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Though our exercise adopts some very simple rules, there is more to learn!

For a delightful, four minute explanation of the whole leap year phenomenon, go watch [this youtube video][video].

[video]: http://www.youtube.com/watch?v=xX96xng7sAE
[video]: https://www.youtube.com/watch?v=xX96xng7sAE
4 changes: 2 additions & 2 deletions exercises/practice/leap/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
]
},
"blurb": "Given a year, report if it is a leap year.",
"source": "JavaRanch Cattle Drive, exercise 3",
"source_url": "http://www.javaranch.com/leap.jsp"
"source": "CodeRanch Cattle Drive, Assignment 3",
"source_url": "https://coderanch.com/t/718816/Leap"
}
4 changes: 2 additions & 2 deletions exercises/practice/linked-list/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sometimes a station gets closed down, and in that case the station needs to be r

The size of a route is measured not by how far the train travels, but by how many stations it stops at.

```exercism/note
~~~~exercism/note
The linked list is a fundamental data structure in computer science, often used in the implementation of other data structures.
As the name suggests, it is a list of nodes that are linked together.
It is a list of "nodes", where each node links to its neighbor or neighbors.
Expand All @@ -23,4 +23,4 @@ In a **doubly linked list** each node links to both the node that comes before,
If you want to dig deeper into linked lists, check out [this article][intro-linked-list] that explains it using nice drawings.
[intro-linked-list]: https://medium.com/basecs/whats-a-linked-list-anyway-part-1-d8b7e6508b9d
```
~~~~
18 changes: 10 additions & 8 deletions exercises/practice/list-ops/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ Implement a series of basic list operations, without using existing functions.

The precise number and names of the operations to be implemented will be track dependent to avoid conflicts with existing names, but the general operations you will implement include:

* `append` (*given two lists, add all items in the second list to the end of the first list*);
* `concatenate` (*given a series of lists, combine all items in all lists into one flattened list*);
* `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 using `function(accumulator, item)`*);
* `foldr` (*given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right using `function(item, accumulator)`*);
* `reverse` (*given a list, return a list with all the original items, but in reversed order*);
- `append` (*given two lists, add all items in the second list to the end of the first list*);
- `concatenate` (*given a series of lists, combine all items in all lists into one flattened list*);
- `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*);
- `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*).

Note, the ordering in which arguments are passed to the fold functions (`foldl`, `foldr`) is significant.
2 changes: 1 addition & 1 deletion exercises/practice/luhn/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
},
"blurb": "Given a number determine whether or not it is valid per the Luhn formula.",
"source": "The Luhn Algorithm on Wikipedia",
"source_url": "http://en.wikipedia.org/wiki/Luhn_algorithm"
"source_url": "https://en.wikipedia.org/wiki/Luhn_algorithm"
}
1 change: 1 addition & 0 deletions exercises/practice/matching-brackets/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Instructions

Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly.
The string may also contain other characters, which for the purposes of this exercise should be ignored.
Loading

0 comments on commit b8eb7b7

Please sign in to comment.