Compare commits

...

10 Commits

Author SHA1 Message Date
github-actions[bot]
a6dfd2c11e 🤖 Auto-sync docs, metadata, and filepaths (#332)
Some checks failed
Configlet / configlet (push) Has been cancelled
test / ci (push) Has been cancelled
Tools / sync-labels (push) Has been cancelled
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-15 07:35:12 +02:00
dependabot[bot]
0f350d1fc1 Bump actions/checkout from 4.1.7 to 4.2.2 (#323)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](692973e3d9...11bd71901b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-15 15:11:46 +02:00
dependabot[bot]
b72a73c9eb Bump actions/setup-node from 4.0.3 to 4.1.0 (#324)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.3 to 4.1.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](1e60f620b9...39370e3970)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-15 15:02:29 +02:00
keiravillekode
68993b8b86 ci uses ubuntu-24.04 (#330) 2025-07-15 08:24:08 +02:00
Jagdish Prajapati
8ef2cee599 Create run-configlet-sync.yml (#327)
Co-authored-by: Lars Hvam <larshp@hotmail.com>
2025-07-01 07:46:51 +02:00
András B Nagy
46029efb69 Remove extra parentheses per abaplint (#329) 2025-07-01 07:38:30 +02:00
András B Nagy
8ceeb7ebf6 Sync problem specs (#326)
* Sync metadata

* Sync docs
2025-03-23 11:09:09 +01:00
Isaac Good
e8c3980305 exercises/practice/anagram: add an append with instructions about the order of the return values (#325) 2025-01-16 06:30:53 +01:00
dependabot[bot]
3d88351ec7 Bump actions/setup-node from 4.0.2 to 4.0.3 (#317)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 08:09:17 +02:00
Exercism Bot
1027c302aa 🤖 Sync org-wide files to upstream repo (#320)
More info: fc1613760f
2024-09-06 07:55:00 +02:00
29 changed files with 149 additions and 91 deletions

View File

@@ -0,0 +1,16 @@
name: Ping cross-track maintainers team
on:
pull_request_target:
types:
- opened
permissions:
pull-requests: write
jobs:
ping:
if: github.repository_owner == 'exercism' # Stops this job from running on forks
uses: exercism/github-actions/.github/workflows/ping-cross-track-maintainers-team.yml@main
secrets:
github_membership_token: ${{ secrets.COMMUNITY_CONTRIBUTIONS_WORKFLOW_TOKEN }}

View File

@@ -0,0 +1,10 @@
name: Run Configlet Sync
on:
workflow_dispatch:
schedule:
- cron: '0 0 15 * *'
jobs:
call-gha-workflow:
uses: exercism/github-actions/.github/workflows/configlet-sync.yml@main

View File

@@ -23,13 +23,13 @@ on:
jobs:
ci:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Use Node.js LTS (16.x)
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '16'
- run: npm install @abaplint/cli -g

View File

@@ -4,7 +4,7 @@ Create an implementation of the affine cipher, an ancient encryption system crea
The affine cipher is a type of monoalphabetic substitution cipher.
Each character is mapped to its numeric equivalent, encrypted with a mathematical function and then converted to the letter relating to its new numeric value.
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the atbash cipher, because it has many more keys.
Although all monoalphabetic ciphers are weak, the affine cipher is much stronger than the Atbash cipher, because it has many more keys.
[//]: # " monoalphabetic as spelled by Merriam-Webster, compare to polyalphabetic "
@@ -18,10 +18,10 @@ E(x) = (ai + b) mod m
Where:
- `i` is the letter's index from `0` to the length of the alphabet - 1
- `i` is the letter's index from `0` to the length of the alphabet - 1.
- `m` is the length of the alphabet.
For the Roman alphabet `m` is `26`.
- `a` and `b` are integers which make the encryption key
For the Latin alphabet `m` is `26`.
- `a` and `b` are integers which make up the encryption key.
Values `a` and `m` must be _coprime_ (or, _relatively prime_) for automatic decryption to succeed, i.e., they have number `1` as their only common factor (more information can be found in the [Wikipedia article about coprime integers][coprime-integers]).
In case `a` is not coprime to `m`, your program should indicate that this is an error.

View File

@@ -0,0 +1,3 @@
# Instructions Append
You must return the anagrams in the same order as they are listed in the candidate words.

View File

@@ -1,13 +1,12 @@
# Instructions
Your task is to, given a target word and a set of candidate words, to find the subset of the candidates that are anagrams of the target.
Given a target word and one or more candidate words, your task is to find the candidates that are anagrams of the target.
An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`.
A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`.
The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`.
The anagram set is the subset of the candidate set that are anagrams of the target (in any order).
Words in the anagram set should have the same letter case as in the candidate set.
The target word and candidate words are made up of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `"StoP"` is not an anagram of `"sTOp"`.
The words you need to find should be taken from the candidate words, using the same letter case.
Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, `"Seton"`, the anagram set is `"tones"`, `"notes"`, `"Seton"`.
Given the target `"stone"` and the candidate words `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, and `"Seton"`, the anagram words you need to find are `"tones"`, `"notes"`, and `"Seton"`.

View File

@@ -1,6 +1,6 @@
# Instructions
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.
The Atbash cipher is a simple substitution cipher that relies on transposing all the letters in the alphabet such that the resulting alphabet is backwards.
The first letter is replaced with the last letter, the second with the second-last, and so on.

View File

@@ -13,7 +13,7 @@
".meta/zcl_atbash_cipher.clas.abap"
]
},
"blurb": "Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.",
"blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.",
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Atbash"
}

View File

@@ -1,29 +1,3 @@
# Instructions
The Collatz Conjecture or 3x+1 problem can be summarized as follows:
Take any positive integer n.
If n is even, divide n by 2 to get n / 2.
If n is odd, multiply n by 3 and add 1 to get 3n + 1.
Repeat the process indefinitely.
The conjecture states that no matter which number you start with, you will always reach 1 eventually.
Given a number n, return the number of steps required to reach 1.
## Examples
Starting with n = 12, the steps would be as follows:
0. 12
1. 6
2. 3
3. 10
4. 5
5. 16
6. 8
7. 4
8. 2
9. 1
Resulting in 9 steps.
So for input n = 12, the return value would be 9.
Given a positive integer, return the number of steps it takes to reach 1 according to the rules of the Collatz Conjecture.

View File

@@ -0,0 +1,28 @@
# Introduction
One evening, you stumbled upon an old notebook filled with cryptic scribbles, as though someone had been obsessively chasing an idea.
On one page, a single question stood out: **Can every number find its way to 1?**
It was tied to something called the **Collatz Conjecture**, a puzzle that has baffled thinkers for decades.
The rules were deceptively simple.
Pick any positive integer.
- If it's even, divide it by 2.
- If it's odd, multiply it by 3 and add 1.
Then, repeat these steps with the result, continuing indefinitely.
Curious, you picked number 12 to test and began the journey:
12 ➜ 6 ➜ 3 ➜ 10 ➜ 5 ➜ 16 ➜ 8 ➜ 4 ➜ 2 ➜ 1
Counting from the second number (6), it took 9 steps to reach 1, and each time the rules repeated, the number kept changing.
At first, the sequence seemed unpredictable — jumping up, down, and all over.
Yet, the conjecture claims that no matter the starting number, we'll always end at 1.
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.
[collatz-prize]: https://mathprize.net/posts/collatz-conjecture/

View File

@@ -14,6 +14,6 @@
]
},
"blurb": "Calculate the number of steps to reach 1 using the Collatz conjecture.",
"source": "An unsolved problem in mathematics named after mathematician Lothar Collatz",
"source_url": "https://en.wikipedia.org/wiki/3x_%2B_1_problem"
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Collatz_conjecture"
}

View File

@@ -27,7 +27,7 @@ CLASS zcl_crypto_square IMPLEMENTATION.
IF str_len = 0.
RETURN.
ENDIF.
WHILE ( column * row ) < str_len.
WHILE column * row < str_len.
IF column > row.
row += 1.
ELSE.
@@ -41,7 +41,7 @@ CLASS zcl_crypto_square IMPLEMENTATION.
FOR j = 0 UNTIL j = row
NEXT txt &&= |{
"check offset beyond string length?
COND string( WHEN ( ( j * column ) + i ) >= str_len
COND string( WHEN j * column + i >= str_len
"add space if , more than one row in square
THEN COND string( WHEN row > 1
THEN ` `

View File

@@ -1,6 +1,6 @@
# Instructions
Write a function that returns the earned points in a single toss of a Darts game.
Calculate the points scored in a single toss of a Darts game.
[Darts][darts] is a game where players throw darts at a [target][darts-target].
@@ -16,7 +16,7 @@ In our particular instance of the game, the target rewards 4 different amounts o
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).
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.
Given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), calculate the correct score earned by a dart landing at that point.
## Credit

View File

@@ -13,6 +13,6 @@
".meta/zcl_darts.clas.abap"
]
},
"blurb": "Write a function that returns the earned points in a single toss of a Darts game.",
"blurb": "Calculate the points scored in a single toss of a Darts game.",
"source": "Inspired by an exercise created by a professor Della Paolera in Argentina"
}

View File

@@ -18,11 +18,11 @@ ENDCLASS.
CLASS zcl_darts IMPLEMENTATION.
METHOD score.
IF ( ( x * x ) + ( y * y ) ) <= 1.
IF x * x + y * y <= 1.
result = 10.
ELSEIF ( ( x * x ) + ( y * y ) ) <= ( 5 * 5 ).
ELSEIF x * x + y * y <= ( 5 * 5 ).
result = 5.
ELSEIF ( ( x * x ) + ( y * y ) ) <= ( 10 * 10 ).
ELSEIF x * x + y * y <= ( 10 * 10 ).
result = 1.
ENDIF.
ENDMETHOD.

View File

@@ -1,15 +1,11 @@
# Instructions
Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.
Calculate the number of grains of wheat on a chessboard.
There once was a wise servant who saved the life of a prince.
The king promised to pay whatever the servant could dream up.
Knowing that the king loved chess, the servant told the king he would like to have grains of wheat.
One grain on the first square of a chess board, with the number of grains doubling on each successive square.
A chessboard has 64 squares.
Square 1 has one grain, square 2 has two grains, square 3 has four grains, and so on, doubling each time.
There are 64 squares on a chessboard (where square 1 has one grain, square 2 has two grains, and so on).
Write code that calculates:
Write code that shows:
- how many grains were on a given square, and
- the number of grains on a given square
- the total number of grains on the chessboard

View File

@@ -0,0 +1,6 @@
# Introduction
There once was a wise servant who saved the life of a prince.
The king promised to pay whatever the servant could dream up.
Knowing that the king loved chess, the servant told the king he would like to have grains of wheat.
One grain on the first square of a chessboard, with the number of grains doubling on each successive square.

View File

@@ -15,5 +15,5 @@
},
"blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.",
"source": "The CodeRanch Cattle Drive, Assignment 6",
"source_url": "https://coderanch.com/wiki/718824/Grains"
"source_url": "https://web.archive.org/web/20240908084142/https://coderanch.com/wiki/718824/Grains"
}

View File

@@ -1,26 +1,15 @@
# Instructions
Calculate the Hamming Distance between two DNA strands.
Calculate the Hamming distance between two DNA strands.
Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them we can see how many mistakes occurred.
This is known as the "Hamming Distance".
We read DNA using the letters C,A,G and T.
We read DNA using the letters C, A, G and T.
Two strands might look like this:
GAGCCTACTAACGGGAT
CATCGTAATGACGGCCT
^ ^ ^ ^ ^ ^^
They have 7 differences, and therefore the Hamming Distance is 7.
The Hamming Distance is useful for lots of things in science, not just biology, so it's a nice phrase to be familiar with :)
They have 7 differences, and therefore the Hamming distance is 7.
## Implementation notes

View File

@@ -0,0 +1,12 @@
# Introduction
Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!
When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred.
This is known as the "Hamming distance".
The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :)

View File

@@ -13,7 +13,7 @@
".meta/zcl_hamming.clas.abap"
]
},
"blurb": "Calculate the Hamming difference between two DNA strands.",
"blurb": "Calculate the Hamming distance between two DNA strands.",
"source": "The Calculating Point Mutations problem at Rosalind",
"source_url": "https://rosalind.info/problems/hamm/"
}

View File

@@ -15,5 +15,5 @@
},
"blurb": "Determine whether a given year is a leap year.",
"source": "CodeRanch Cattle Drive, Assignment 3",
"source_url": "https://coderanch.com/t/718816/Leap"
"source_url": "https://web.archive.org/web/20240907033714/https://coderanch.com/t/718816/Leap"
}

View File

@@ -1,6 +1,6 @@
# Instructions
Clean up user-entered phone numbers so that they can be sent SMS messages.
Clean up phone numbers so that they can be sent SMS messages.
The **North American Numbering Plan (NANP)** is a telephone numbering system used by many countries in North America like the United States, Canada or Bermuda.
All NANP-countries share the same international country code: `1`.

View File

@@ -0,0 +1,12 @@
# Introduction
You've joined LinkLine, a leading communications company working to ensure reliable connections for everyone.
The team faces a big challenge: users submit phone numbers in all sorts of formats — dashes, spaces, dots, parentheses, and even prefixes.
Some numbers are valid, while others are impossible to use.
Your mission is to turn this chaos into order.
You'll clean up valid numbers, formatting them appropriately for use in the system.
At the same time, you'll identify and filter out any invalid entries.
The success of LinkLine's operations depends on your ability to separate the useful from the unusable.
Are you ready to take on the challenge and keep the connections running smoothly?

View File

@@ -13,7 +13,7 @@
".meta/zcl_raindrops.clas.abap"
]
},
"blurb": "Convert a number to a string, the content of which depends on the number's factors.",
"blurb": "Convert a number into its corresponding raindrop sounds - Pling, Plang and Plong.",
"source_url": "https://en.wikipedia.org/wiki/Fizz_buzz",
"source": "A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division."
}

View File

@@ -1,12 +1,12 @@
# Instructions
Your task is determine the RNA complement of a given DNA sequence.
Your task is to determine the RNA complement of a given DNA sequence.
Both DNA and RNA strands are a sequence of nucleotides.
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**) and thymine (**T**).
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**), and thymine (**T**).
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**) and uracil (**U**).
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**), and uracil (**U**).
Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:

View File

@@ -1,12 +1,19 @@
{
"blurb": "Given a DNA strand, return its RNA Complement Transcription.",
"authors": ["ajborla"],
"contributors": [
"blurb": "Given a DNA strand, return its RNA complement.",
"authors": [
"ajborla"
],
"contributors": [],
"files": {
"solution": ["zcl_rna_transcription.clas.abap"],
"test": ["zcl_rna_transcription.clas.testclasses.abap"],
"example": [".meta/zcl_rna_transcription.clas.abap"]
"solution": [
"zcl_rna_transcription.clas.abap"
],
"test": [
"zcl_rna_transcription.clas.testclasses.abap"
],
"example": [
".meta/zcl_rna_transcription.clas.abap"
]
},
"source": "Hyperphysics",
"source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html"

View File

@@ -3,7 +3,7 @@
In this exercise, you're going to implement a program that determines the state of a [tic-tac-toe][] game.
(_You may also know the game as "noughts and crosses" or "Xs and Os"._)
The games is played on a 3×3 grid.
The game is played on a 3×3 grid.
Players take turns to place `X`s and `O`s on the grid.
The game ends when one player has won by placing three of marks in a row, column, or along a diagonal of the grid, or when the entire grid is filled up.

View File

@@ -13,6 +13,12 @@ A _scalene_ triangle has all sides of different lengths.
For a shape to be a triangle at all, all sides have to be of length > 0, and the sum of the lengths of any two sides must be greater than or equal to the length of the third side.
~~~~exercism/note
_Degenerate triangles_ are triangles where the sum of the length of two sides is **equal** to the length of the third side, e.g. `1, 1, 2`.
We opted to not include tests for degenerate triangles in this exercise.
You may handle those situations if you wish to do so, or safely ignore them.
~~~~
In equations:
Let `a`, `b`, and `c` be sides of the triangle.