Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Update Practice Exercises to latest spec #660

Merged
merged 6 commits into from
Feb 12, 2021
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
95 changes: 95 additions & 0 deletions config.json

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions exercises/practice/accumulate/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Instructions

Implement the `accumulate` operation, which, given a collection and an
operation to perform on each element of the collection, returns a new
collection containing the result of applying that operation to each element of
the input collection.

Given the collection of numbers:

- 1, 2, 3, 4, 5

And the operation:

- square a number (`x => x * x`)

Your code should be able to produce the collection of squares:

- 1, 4, 9, 16, 25

Check out the test suite to see the expected function signature.

## Restrictions

Keep your hands off that collect/map/fmap/whatchamacallit functionality
provided by your standard library!
Solve this one yourself using other basic tools instead.
10 changes: 10 additions & 0 deletions exercises/practice/accumulate/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Conversation with James Edward Gray II",
"source_url": "https://twitter.com/jeg2"
}
43 changes: 0 additions & 43 deletions exercises/practice/accumulate/README.md

This file was deleted.

8 changes: 8 additions & 0 deletions exercises/practice/acronym/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Instructions

Convert a phrase to its acronym.

Techies love their TLA (Three Letter Acronyms)!

Help generate some jargon by writing a program that converts a long name
like Portable Network Graphics to its acronym (PNG).
10 changes: 10 additions & 0 deletions exercises/practice/acronym/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Julien Vanier",
"source_url": "https://github.com/monkbroc"
}
25 changes: 0 additions & 25 deletions exercises/practice/acronym/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# All Your Base
# Instructions

Convert a number, represented as a sequence of digits in one base, to any other base.

Expand Down Expand Up @@ -30,16 +30,3 @@ The number 1120, *in base 3*, means:
I think you got the idea!

*Yes. Those three numbers above are exactly the same. Congratulations!*

The Scala exercises assume an SBT project scheme. The exercise solution source
should be placed within the exercise directory/src/main/scala. The exercise
unit tests can be found within the exercise directory/src/test/scala.

To run the tests simply run the command `sbt test` in the exercise directory.

Please see the [learning](https://exercism.io/tracks/scala/learning) and
[installation](https://exercism.io/tracks/scala/installation) pages if you need any help.


## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
8 changes: 8 additions & 0 deletions exercises/practice/all-your-base/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Allergies
# Instructions

Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.

Expand Down Expand Up @@ -28,20 +28,3 @@ 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. For example, if the allergy
score is 257, your program should only report the eggs (1) allergy.

The Scala exercises assume an SBT project scheme. The exercise solution source
should be placed within the exercise directory/src/main/scala. The exercise
unit tests can be found within the exercise directory/src/test/scala.

To run the tests simply run the command `sbt test` in the exercise directory.

Please see the [learning](https://exercism.io/tracks/scala/learning) and
[installation](https://exercism.io/tracks/scala/installation) pages if you need any help.


## Source

Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/allergies/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Jumpstart Lab Warm-up",
"source_url": "http://jumpstartlab.com"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Alphametics
# Instructions

Write a function to solve alphametics puzzles.

Expand Down Expand Up @@ -30,16 +30,3 @@ Each letter must represent a different digit, and the leading digit of
a multi-digit number must not be zero.

Write a function to solve alphametics puzzles.

The Scala exercises assume an SBT project scheme. The exercise solution source
should be placed within the exercise directory/src/main/scala. The exercise
unit tests can be found within the exercise directory/src/test/scala.

To run the tests simply run the command `sbt test` in the exercise directory.

Please see the [learning](https://exercism.io/tracks/scala/learning) and
[installation](https://exercism.io/tracks/scala/installation) pages if you need any help.


## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
8 changes: 8 additions & 0 deletions exercises/practice/alphametics/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
}
}
8 changes: 8 additions & 0 deletions exercises/practice/anagram/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Instructions

An anagram is a rearrangement of letters to form a new word.
Given a word and a list of candidates, select the sublist of anagrams of the given word.

Given `"listen"` and a list of candidates like `"enlists" "google"
"inlets" "banana"` the program should return a list containing
`"inlets"`.
10 changes: 10 additions & 0 deletions exercises/practice/anagram/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Inspired by the Extreme Startup game",
"source_url": "https://github.com/rchatley/extreme_startup"
}
25 changes: 0 additions & 25 deletions exercises/practice/anagram/README.md

This file was deleted.

12 changes: 12 additions & 0 deletions exercises/practice/armstrong-numbers/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Instructions

An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits.

For example:

- 9 is an Armstrong number, because `9 = 9^1 = 9`
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1`
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`

Write some code to determine whether a number is an Armstrong number.
10 changes: 10 additions & 0 deletions exercises/practice/armstrong-numbers/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Narcissistic_number"
}
29 changes: 0 additions & 29 deletions exercises/practice/armstrong-numbers/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Atbash Cipher
# Instructions

Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.

Expand Down Expand Up @@ -27,20 +27,3 @@ things based on word boundaries.
- Encoding `test` gives `gvhg`
- Decoding `gvhg` gives `test`
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`

The Scala exercises assume an SBT project scheme. The exercise solution source
should be placed within the exercise directory/src/main/scala. The exercise
unit tests can be found within the exercise directory/src/test/scala.

To run the tests simply run the command `sbt test` in the exercise directory.

Please see the [learning](https://exercism.io/tracks/scala/learning) and
[installation](https://exercism.io/tracks/scala/installation) pages if you need any help.


## Source

Wikipedia [http://en.wikipedia.org/wiki/Atbash](http://en.wikipedia.org/wiki/Atbash)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/atbash-cipher/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Wikipedia",
"source_url": "http://en.wikipedia.org/wiki/Atbash"
}
27 changes: 27 additions & 0 deletions exercises/practice/bank-account/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Instructions

Simulate a bank account supporting opening/closing, withdrawals, and deposits
of money. Watch out for concurrent transactions!

A bank account can be accessed in multiple ways. Clients can make
deposits and withdrawals using the internet, mobile phones, etc. Shops
can charge against the account.

Create an account that can be accessed from multiple threads/processes
(terminology depends on your programming language).

It should be possible to close an account; operations against a closed
account must fail.

## Instructions

Run the test file, and fix each of the errors in turn. When you get the
first test to pass, go to the first pending or skipped test, and make
that pass as well. When all of the tests are passing, feel free to
submit.

Remember that passing code is just the first step. The goal is to work
towards a solution that is as readable and expressive as you can make
it.

Have fun!
Loading