├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── run-configlet-sync.yml │ ├── configlet.yml │ ├── sync-labels.yml │ ├── ping-cross-track-maintainers-team.yml │ ├── no-important-files-changed.yml │ └── test.yml ├── concepts ├── .keep └── basics │ ├── links.json │ ├── .meta │ └── config.json │ └── about.md ├── docs ├── SNIPPET.txt ├── clone_01.png ├── clone_02.png ├── clone_03.png ├── clone_04.png ├── clone_10.png ├── clone_11.png ├── clone_12.png ├── clone_13.png ├── clone_14.png ├── logging_01.png ├── logging_02.png ├── testclass_good.png ├── testclass_not_so_good.png ├── LEARNING.md ├── RESOURCES.md ├── ABOUT.md ├── INSTALLATION.md └── config.json ├── .gitignore ├── exercises ├── practice │ ├── leap │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── package.devc.xml │ │ ├── zcl_leap.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_leap.clas.abap │ │ └── zcl_leap.clas.xml │ ├── anagram │ │ ├── .docs │ │ │ ├── instructions.append.md │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── zcl_anagram.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_anagram.clas.abap │ │ └── zcl_anagram.clas.xml │ ├── raindrops │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── zcl_raindrops.clas.abap │ │ ├── zcl_raindrops.clas.xml │ │ └── .meta │ │ │ ├── config.json │ │ │ └── zcl_raindrops.clas.abap │ ├── collatz-conjecture │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── package.devc.xml │ │ ├── zcl_collatz_conjecture.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_collatz_conjecture.clas.abap │ │ └── zcl_collatz_conjecture.clas.xml │ ├── clock │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_clock.clas.abap │ │ ├── zcl_clock.clas.xml │ │ └── zcl_clock.clas.abap │ ├── reverse-string │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── zcl_reverse_string.clas.abap │ │ │ └── config.json │ │ ├── zcl_reverse_string.clas.abap │ │ └── zcl_reverse_string.clas.xml │ ├── scrabble-score │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── zcl_scrabble_score.clas.abap │ │ ├── .meta │ │ │ └── config.json │ │ └── zcl_scrabble_score.clas.xml │ ├── hello-world │ │ ├── .meta │ │ │ ├── zcl_hello_world.clas.abap │ │ │ └── config.json │ │ ├── zcl_hello_world.clas.abap │ │ ├── package.devc.xml │ │ ├── zcl_hello_world.clas.testclasses.abap │ │ ├── zcl_hello_world.clas.xml │ │ └── .docs │ │ │ └── instructions.md │ ├── minesweeper │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_minesweeper.clas.abap │ │ └── zcl_minesweeper.clas.xml │ ├── nth-prime │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_nth_prime.clas.abap │ │ ├── zcl_nth_prime.clas.abap │ │ ├── zcl_nth_prime.clas.xml │ │ └── zcl_nth_prime.clas.testclasses.abap │ ├── darts │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_darts.clas.abap │ │ ├── zcl_darts.clas.abap │ │ └── zcl_darts.clas.xml │ ├── grains │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── zcl_grains.clas.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_grains.clas.abap │ │ └── zcl_grains.clas.abap │ ├── matrix │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_matrix.clas.abap │ │ ├── zcl_matrix.clas.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ └── zcl_matrix.clas.abap │ ├── acronym │ │ ├── package.devc.xml │ │ ├── zcl_acronym.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_acronym.clas.abap │ │ ├── zcl_acronym.clas.xml │ │ └── .docs │ │ │ └── instructions.md │ ├── etl │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_etl.clas.xml │ │ ├── zcl_etl.clas.abap │ │ └── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ ├── hamming │ │ ├── package.devc.xml │ │ ├── zcl_hamming.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_hamming.clas.abap │ │ ├── .docs │ │ │ ├── instructions.md │ │ │ └── introduction.md │ │ └── zcl_hamming.clas.xml │ ├── isogram │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── zcl_isogram.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_isogram.clas.abap │ │ └── zcl_isogram.clas.xml │ ├── package.devc.xml │ ├── triangle │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_triangle.clas.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ └── zcl_triangle.clas.abap │ ├── two-fer │ │ ├── package.devc.xml │ │ ├── zcl_two_fer.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_two_fer.clas.abap │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── zcl_two_fer.clas.xml │ │ └── zcl_two_fer.clas.testclasses.abap │ ├── beer-song │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_beer_song.clas.abap │ │ └── zcl_beer_song.clas.xml │ ├── book-store │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_book_store.clas.xml │ │ └── zcl_book_store.clas.abap │ ├── high-scores │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_high_scores.clas.abap │ │ ├── zcl_high_scores.clas.xml │ │ └── zcl_high_scores.clas.abap │ ├── word-count │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_word_count.clas.xml │ │ └── zcl_word_count.clas.abap │ ├── affine-cipher │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_affine_cipher.clas.xml │ │ └── zcl_affine_cipher.clas.abap │ ├── atbash-cipher │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_atbash_cipher.clas.abap │ │ ├── zcl_atbash_cipher.clas.xml │ │ ├── zcl_atbash_cipher.clas.abap │ │ └── .docs │ │ │ └── instructions.md │ ├── crypto-square │ │ ├── package.devc.xml │ │ ├── zcl_crypto_square.clas.abap │ │ ├── .meta │ │ │ └── config.json │ │ └── zcl_crypto_square.clas.xml │ ├── custom-signs │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ └── zcl_custom_signs.clas.xml │ ├── flower-field │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── tests.toml │ │ ├── zcl_flower_field.clas.abap │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ └── zcl_flower_field.clas.xml │ ├── phone-number │ │ ├── package.devc.xml │ │ ├── zcl_phone_number.clas.abap │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_phone_number.clas.xml │ │ └── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ ├── prime-factors │ │ ├── package.devc.xml │ │ ├── zcl_prime_factors.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_prime_factors.clas.abap │ │ ├── zcl_prime_factors.clas.xml │ │ └── .docs │ │ │ └── instructions.md │ ├── itab-basics │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_itab_basics.clas.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ └── zcl_itab_basics.clas.abap │ ├── resistor-color │ │ ├── package.devc.xml │ │ ├── zcl_resistor_color.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_resistor_color.clas.abap │ │ ├── zcl_resistor_color.clas.xml │ │ ├── zcl_resistor_color.clas.testclasses.abap │ │ └── .docs │ │ │ └── instructions.md │ ├── secret-handshake │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ │ ├── zcl_secret_handshake.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_secret_handshake.clas.abap │ │ └── zcl_secret_handshake.clas.xml │ ├── armstrong-numbers │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_armstrong_numbers.clas.abap │ │ ├── zcl_armstrong_numbers.clas.abap │ │ ├── zcl_armstrong_numbers.clas.xml │ │ └── .docs │ │ │ └── instructions.md │ ├── itab-nesting │ │ ├── package.devc.xml │ │ ├── zcl_itab_nesting.clas.xml │ │ └── .meta │ │ │ └── config.json │ ├── rna-transcription │ │ ├── package.devc.xml │ │ ├── zcl_rna_transcription.clas.abap │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_rna_transcription.clas.abap │ │ ├── zcl_rna_transcription.clas.xml │ │ └── .docs │ │ │ ├── introduction.md │ │ │ └── instructions.md │ ├── difference-of-squares │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_difference_of_squares.clas.abap │ │ ├── zcl_difference_of_squares.clas.xml │ │ ├── .docs │ │ │ └── instructions.md │ │ └── zcl_difference_of_squares.clas.abap │ ├── elyses-enchantments │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ └── zcl_elyses_enchantments.clas.xml │ ├── itab-aggregation │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_itab_aggregation.clas.xml │ │ └── zcl_itab_aggregation.clas.abap │ ├── itab-combination │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_itab_combination.clas.xml │ │ └── zcl_itab_combination.clas.abap │ ├── kindergarten-garden │ │ ├── package.devc.xml │ │ ├── .docs │ │ │ └── introduction.md │ │ ├── .meta │ │ │ └── config.json │ │ ├── zcl_kindergarten_garden.clas.abap │ │ └── zcl_kindergarten_garden.clas.xml │ ├── run-length-encoding │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ └── zcl_rle.clas.abap │ │ ├── zcl_rle.clas.xml │ │ ├── zcl_rle.clas.abap │ │ └── .docs │ │ │ └── instructions.md │ └── state-of-tic-tac-toe │ │ ├── package.devc.xml │ │ ├── .meta │ │ └── config.json │ │ ├── zcl_state_of_tic_tac_toe.clas.xml │ │ └── zcl_state_of_tic_tac_toe.clas.abap ├── package.devc.xml ├── concept │ ├── lasagna │ │ ├── package.devc.xml │ │ ├── .meta │ │ │ ├── config.json │ │ │ ├── design.md │ │ │ └── zcl_lasagne.clas.abap │ │ ├── zcl_lasagne.clas.xml │ │ ├── zcl_lasagne.clas.abap │ │ └── .docs │ │ │ └── hints.md │ └── package.devc.xml └── shared │ └── .docs │ ├── help.md │ └── tests.md ├── .abapgit.xml ├── .editorconfig ├── .appends └── .github │ └── labels.yml └── LICENSE /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /concepts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/SNIPPET.txt: -------------------------------------------------------------------------------- 1 | REPORT zhello. 2 | 3 | WRITE 'Hello World!'. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .DS_Store 3 | bin/configlet 4 | bin/configlet.exe 5 | -------------------------------------------------------------------------------- /docs/clone_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_01.png -------------------------------------------------------------------------------- /docs/clone_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_02.png -------------------------------------------------------------------------------- /docs/clone_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_03.png -------------------------------------------------------------------------------- /docs/clone_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_04.png -------------------------------------------------------------------------------- /docs/clone_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_10.png -------------------------------------------------------------------------------- /docs/clone_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_11.png -------------------------------------------------------------------------------- /docs/clone_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_12.png -------------------------------------------------------------------------------- /docs/clone_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_13.png -------------------------------------------------------------------------------- /docs/clone_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/clone_14.png -------------------------------------------------------------------------------- /docs/logging_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/logging_01.png -------------------------------------------------------------------------------- /docs/logging_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/logging_02.png -------------------------------------------------------------------------------- /docs/testclass_good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/testclass_good.png -------------------------------------------------------------------------------- /docs/testclass_not_so_good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exercism/abap/HEAD/docs/testclass_not_so_good.png -------------------------------------------------------------------------------- /concepts/basics/links.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://abapgit.org", 4 | "description": "abapGit" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /exercises/practice/leap/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine whether a given year is a leap year. 4 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.docs/instructions.append.md: -------------------------------------------------------------------------------- 1 | # Instructions Append 2 | 3 | You must return the anagrams in the same order as they are listed in the candidate words. 4 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Raindrops is a slightly more complex version of the FizzBuzz challenge, a classic interview question. 4 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a positive integer, return the number of steps it takes to reach 1 according to the rules of the Collatz Conjecture. 4 | -------------------------------------------------------------------------------- /concepts/basics/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Basics contains the minimal knowledge required to get started in ABAP: function declarations, variable assignment, and exposing entities.", 3 | "authors": ["marianfoo"], 4 | "contributors": ["mbtools"] 5 | } -------------------------------------------------------------------------------- /exercises/practice/clock/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Implement a clock that handles times without dates. 4 | 5 | You should be able to add and subtract minutes to it. 6 | 7 | Two clocks that represent the same time should be equal to each other. 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | # Keep dependencies for GitHub Actions up-to-date 5 | - package-ecosystem: 'github-actions' 6 | directory: '/' 7 | schedule: 8 | interval: 'monthly' 9 | labels: 10 | - 'x:size/small' 11 | -------------------------------------------------------------------------------- /.github/workflows/run-configlet-sync.yml: -------------------------------------------------------------------------------- 1 | name: Run Configlet Sync 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 0 15 * *' 7 | 8 | jobs: 9 | call-gha-workflow: 10 | uses: exercism/github-actions/.github/workflows/configlet-sync.yml@main 11 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to reverse a given string. 4 | 5 | Some examples: 6 | 7 | - Turn `"stressed"` into `"desserts"`. 8 | - Turn `"strops"` into `"sports"`. 9 | - Turn `"racecar"` into `"racecar"`. 10 | -------------------------------------------------------------------------------- /.github/workflows/configlet.yml: -------------------------------------------------------------------------------- 1 | name: Configlet 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | workflow_dispatch: 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | configlet: 15 | uses: exercism/github-actions/.github/workflows/configlet.yml@main 16 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Scrabble][wikipedia] is a word game where players place letter tiles on a board to form words. 4 | Each letter has a value. 5 | A word's score is the sum of its letters' values. 6 | 7 | [wikipedia]: https://en.wikipedia.org/wiki/Scrabble 8 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/zcl_hello_world.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_hello_world DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS hello RETURNING VALUE(result) TYPE string. 4 | ENDCLASS. 5 | 6 | CLASS zcl_hello_world IMPLEMENTATION. 7 | 8 | METHOD hello. 9 | result = 'Hello, World!'. 10 | ENDMETHOD. 11 | 12 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/hello-world/zcl_hello_world.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_hello_world DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS hello RETURNING VALUE(result) TYPE string. 4 | ENDCLASS. 5 | 6 | CLASS zcl_hello_world IMPLEMENTATION. 7 | 8 | METHOD hello. 9 | result = 'Goodbye, Mars!'. 10 | ENDMETHOD. 11 | 12 | ENDCLASS. 13 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Minesweeper][wikipedia] is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square. 4 | 5 | [wikipedia]: https://en.wikipedia.org/wiki/Minesweeper_(video_game) 6 | -------------------------------------------------------------------------------- /exercises/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism ABAP Track 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a number n, determine what the nth prime is. 4 | 5 | By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. 6 | 7 | If your language provides methods in the standard library to deal with prime numbers, pretend they don't exist and implement them yourself. 8 | -------------------------------------------------------------------------------- /exercises/practice/clock/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Clock 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/darts/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Darts 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/grains/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Grains 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/leap/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Leap 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/leap/zcl_leap.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_leap DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS leap 4 | IMPORTING 5 | year TYPE i 6 | RETURNING 7 | VALUE(result) TYPE abap_bool. 8 | ENDCLASS. 9 | 10 | CLASS zcl_leap IMPLEMENTATION. 11 | 12 | METHOD leap. 13 | * add solution here 14 | ENDMETHOD. 15 | 16 | ENDCLASS. 17 | -------------------------------------------------------------------------------- /exercises/practice/matrix/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Matrix 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $EXERCISM_LASAGNA 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/concept/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Concept Exercises 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/acronym/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EXERCISM_ACRONYM 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/anagram/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Anagram 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/etl/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Crypto Square 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/hamming/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Hamming 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/isogram/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Isogram 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Practice Exercises 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/triangle/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Triangle 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Two Fer 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Beer Song 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/book-store/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Book Store 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Hello World 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: High Scores 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Minesweeper 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Nth Prime 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Raindrops 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/word-count/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Word Count 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/affine-cipher/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Affine-Cipher 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Atbash Cipher 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/crypto-square/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Crypto Square 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/custom-signs/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Custom Signs 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Flower Field 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Phone Number 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Prime Factors 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/itab-basics/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Interal Table Basics 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Resistor Color 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Reverse String 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Scrabble Score 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Secret Handshake 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Armstrong numbers practice 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EXERCISM_collatz_conjecture 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/itab-nesting/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Interal Table Nesting 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: RNA Transcription 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/word-count/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You teach English as a foreign language to high school students. 4 | 5 | You've decided to base your entire curriculum on TV shows. 6 | You need to analyze which words are used, and how often they're repeated. 7 | 8 | This will let you choose the simplest shows to start with, and to gradually increase the difficulty as time passes. 9 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Difference Of Squares 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/elyses-enchantments/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Elyses Enchantments 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/grains/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | There once was a wise servant who saved the life of a prince. 4 | The king promised to pay whatever the servant could dream up. 5 | Knowing that the king loved chess, the servant told the king he would like to have grains of wheat. 6 | One grain on the first square of a chessboard, with the number of grains doubling on each successive square. 7 | -------------------------------------------------------------------------------- /exercises/practice/itab-aggregation/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Interal Table Aggregation 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/itab-combination/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Interal Table Combination 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Kindergarten Garden 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/zcl_raindrops.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_raindrops DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS raindrops 4 | IMPORTING 5 | input TYPE i 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_raindrops IMPLEMENTATION. 11 | 12 | METHOD raindrops. 13 | * add solution here 14 | ENDMETHOD. 15 | 16 | ENDCLASS. 17 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: Run Length Encoding 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/state-of-tic-tac-toe/package.devc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exercism: State of Tic-Tac-Toe 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/zcl_two_fer.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_two_fer DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS two_fer 4 | IMPORTING 5 | input TYPE string OPTIONAL 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_two_fer IMPLEMENTATION. 11 | 12 | METHOD two_fer. 13 | * add solution here 14 | ENDMETHOD. 15 | 16 | ENDCLASS. 17 | -------------------------------------------------------------------------------- /exercises/practice/grains/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Calculate the number of grains of wheat on a chessboard. 4 | 5 | A chessboard has 64 squares. 6 | Square 1 has one grain, square 2 has two grains, square 3 has four grains, and so on, doubling each time. 7 | 8 | Write code that calculates: 9 | 10 | - the number of grains on a given square 11 | - the total number of grains on the chessboard 12 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Manage a game player's High Score list. 4 | 5 | Your task is to build a high-score component of the classic Frogger game, one of the highest selling and most addictive games of all time, and a classic of the arcade era. 6 | Your task is to write methods that return the highest score from the list, the last added score and the three highest scores. 7 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mbtools" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_minesweeper.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_minesweeper.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_minesweeper.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Add the numbers to a minesweeper board." 17 | } 18 | -------------------------------------------------------------------------------- /.abapgit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | E 6 | /exercises/ 7 | MIXED 8 | 9 | */.docs/* 10 | */.meta/* 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Reversing strings (reading them from right to left, rather than from left to right) is a surprisingly common task in programming. 4 | 5 | For example, in bioinformatics, reversing the sequence of DNA or RNA strings is often important for various analyses, such as finding complementary strands or identifying palindromic sequences that have biological significance. 6 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yml: -------------------------------------------------------------------------------- 1 | name: Tools 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - .github/labels.yml 9 | - .github/workflows/sync-labels.yml 10 | workflow_dispatch: 11 | schedule: 12 | - cron: 0 0 1 * * # First day of each month 13 | 14 | permissions: 15 | issues: write 16 | 17 | jobs: 18 | sync-labels: 19 | uses: exercism/github-actions/.github/workflows/labels.yml@main 20 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/zcl_resistor_color.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_resistor_color DEFINITION PUBLIC CREATE PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS resistor_color 4 | IMPORTING 5 | color_code TYPE string 6 | RETURNING 7 | VALUE(value) TYPE i. 8 | ENDCLASS. 9 | 10 | CLASS zcl_resistor_color IMPLEMENTATION. 11 | 12 | METHOD resistor_color. 13 | * add solution here 14 | ENDMETHOD. 15 | 16 | ENDCLASS. 17 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.meta/zcl_reverse_string.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_reverse_string DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS reverse_string 4 | IMPORTING 5 | input TYPE string 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_reverse_string IMPLEMENTATION. 11 | 12 | METHOD reverse_string. 13 | result = reverse( input ). 14 | ENDMETHOD. 15 | 16 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/shared/.docs/help.md: -------------------------------------------------------------------------------- 1 | # Help 2 | 3 | To get help if you're having trouble, you can use one of the following resources: 4 | 5 | - [How to learn ABAP](https://exercism.org/docs/tracks/abap/learning) 6 | - [Useful ABAP resources](https://exercism.org/docs/tracks/abap/resources) 7 | - Find a mentor in the [ABAP Track](https://exercism.org/tracks/abap) 8 | - [Learn more about getting mentored](https://exercism.org/docs/using/feedback/guide-to-being-mentored) 9 | -------------------------------------------------------------------------------- /exercises/practice/clock/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mbtools" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_clock.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_clock.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_clock.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Implement a clock that handles times without dates.", 17 | "source": "Pairing session with Erin Drummond" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/acronym/zcl_acronym.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_acronym DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS parse IMPORTING phrase TYPE string 8 | RETURNING VALUE(acronym) TYPE string. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_acronym IMPLEMENTATION. 16 | METHOD parse. 17 | "Implement solution 18 | ENDMETHOD. 19 | ENDCLASS. 20 | -------------------------------------------------------------------------------- /exercises/practice/custom-signs/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "pokrakam" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_custom_signs.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_custom_signs.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_custom_signs.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Learn about characters by helping a sign company create custom messages for their signs." 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mbtools" 4 | ], 5 | "contributors": [ 6 | "BNAndras" 7 | ], 8 | "files": { 9 | "solution": [ 10 | "zcl_flower_field.clas.abap" 11 | ], 12 | "test": [ 13 | "zcl_flower_field.clas.testclasses.abap" 14 | ], 15 | "example": [ 16 | ".meta/zcl_flower_field.clas.abap" 17 | ] 18 | }, 19 | "blurb": "Mark all the flowers in a garden." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | The kindergarten class is learning about growing plants. 4 | The teacher thought it would be a good idea to give the class seeds to plant and grow in the dirt. 5 | To this end, the children have put little cups along the window sills and planted one type of plant in each cup. 6 | The children got to pick their favorites from four available types of seeds: grass, clover, radishes, and violets. 7 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/zcl_minesweeper.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_minesweeper DEFINITION PUBLIC FINAL CREATE PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | 5 | METHODS annotate 6 | IMPORTING 7 | !input TYPE string_table 8 | RETURNING 9 | VALUE(result) TYPE string_table. 10 | 11 | ENDCLASS. 12 | 13 | CLASS zcl_minesweeper IMPLEMENTATION. 14 | 15 | METHOD annotate. 16 | " add solution here 17 | ENDMETHOD. 18 | 19 | ENDCLASS. 20 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/zcl_flower_field.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_flower_field DEFINITION PUBLIC FINAL CREATE PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | 5 | METHODS annotate 6 | IMPORTING 7 | !input TYPE string_table 8 | RETURNING 9 | VALUE(result) TYPE string_table. 10 | 11 | ENDCLASS. 12 | 13 | CLASS zcl_flower_field IMPLEMENTATION. 14 | 15 | METHOD annotate. 16 | " add solution here 17 | ENDMETHOD. 18 | 19 | ENDCLASS. 20 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_high_scores.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_high_scores.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_high_scores.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Manage a player's High Score list.", 17 | "source": "Tribute to the eighties' arcade game Frogger" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/isogram/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Determine if a word or phrase is an isogram. 4 | 5 | An isogram (also known as a "non-pattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. 6 | 7 | Examples of isograms: 8 | 9 | - lumberjacks 10 | - background 11 | - downstream 12 | - six-year-old 13 | 14 | The word _isograms_, however, is not an isogram, because the s repeats. 15 | -------------------------------------------------------------------------------- /exercises/practice/isogram/zcl_isogram.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_isogram DEFINITION PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | METHODS is_isogram 5 | IMPORTING 6 | VALUE(phrase) TYPE string 7 | RETURNING 8 | VALUE(result) TYPE abap_bool. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_isogram IMPLEMENTATION. 16 | 17 | METHOD is_isogram. 18 | " add solution here 19 | ENDMETHOD. 20 | 21 | ENDCLASS. 22 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_acronym.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_acronym.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_acronym.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Convert a long phrase to its acronym.", 17 | "source_url": "https://github.com/monkbroc", 18 | "source": "Julien Vanier" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/elyses-enchantments/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "pokrakam" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_elyses_enchantments.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_elyses_enchantments.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_elyses_enchantments.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Help Elyse with her Enchantments and learn about internal tables in the process." 17 | } 18 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/zcl_hello_world.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | CLASS ltcl_hello_world DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. 2 | PRIVATE SECTION. 3 | METHODS test FOR TESTING RAISING cx_static_check. 4 | ENDCLASS. 5 | 6 | CLASS ltcl_hello_world IMPLEMENTATION. 7 | 8 | METHOD test. 9 | cl_abap_unit_assert=>assert_equals( 10 | act = NEW zcl_hello_world( )->hello( ) 11 | exp = 'Hello, World!' ). 12 | ENDMETHOD. 13 | 14 | ENDCLASS. 15 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/zcl_scrabble_score.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_scrabble_score DEFINITION PUBLIC . 2 | 3 | PUBLIC SECTION. 4 | METHODS score 5 | IMPORTING 6 | input TYPE string OPTIONAL 7 | RETURNING 8 | VALUE(result) TYPE i. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | 12 | ENDCLASS. 13 | 14 | 15 | CLASS zcl_scrabble_score IMPLEMENTATION. 16 | METHOD score. 17 | " add solution here 18 | ENDMETHOD. 19 | 20 | ENDCLASS. 21 | -------------------------------------------------------------------------------- /exercises/practice/isogram/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "g-back" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_isogram.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_isogram.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_isogram.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Determine if a word or phrase is an isogram.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Isogram" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/crypto-square/zcl_crypto_square.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_crypto_square DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS encode IMPORTING plain_text TYPE string 8 | RETURNING VALUE(crypto_text) TYPE string. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_crypto_square IMPLEMENTATION. 16 | METHOD encode. 17 | "Implement Solution 18 | ENDMETHOD. 19 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/hamming/zcl_hamming.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_hamming DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS hamming_distance 4 | IMPORTING 5 | first_strand TYPE string 6 | second_strand TYPE string 7 | RETURNING 8 | VALUE(result) TYPE i 9 | RAISING 10 | cx_parameter_invalid. 11 | ENDCLASS. 12 | 13 | CLASS zcl_hamming IMPLEMENTATION. 14 | 15 | METHOD hamming_distance. 16 | " add solution here 17 | ENDMETHOD. 18 | 19 | ENDCLASS. 20 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "larshp" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_two_fer.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_two_fer.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_two_fer.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Create a sentence of the form \"One for X, one for me.\".", 17 | "source_url": "https://github.com/exercism/problem-specifications/issues/757" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_lasagne.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_lasagne.clas.testclasses.abap" 11 | ], 12 | "exemplar": [ 13 | ".meta/zcl_lasagne.clas.abap" 14 | ] 15 | }, 16 | "forked_from": [ 17 | "csharp/lasagna" 18 | ], 19 | "blurb": "Learn the basics of ABAP cooking a brilliant lasagna from your favorite cooking book." 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_darts.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_darts.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_darts.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Calculate the points scored in a single toss of a Darts game.", 17 | "source": "Inspired by an exercise created by a professor Della Paolera in Argentina" 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "pokrakam" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_rle.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_rle.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_rle.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Implement run-length encoding and decoding.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Run-length_encoding" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/zcl_reverse_string.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_reverse_string DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS reverse_string 4 | IMPORTING 5 | input TYPE string 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_reverse_string IMPLEMENTATION. 11 | 12 | METHOD reverse_string. 13 | " Please complete the implementation of the reverse_string method 14 | result = input. 15 | ENDMETHOD. 16 | 17 | ENDCLASS. 18 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | In some English accents, when you say "two for" quickly, it sounds like "two fer". 4 | Two-for-one is a way of saying that if you buy one, you also get one for free. 5 | So the phrase "two-fer" often implies a two-for-one offer. 6 | 7 | Imagine a bakery that has a holiday offer where you can buy two cookies for the price of one ("two-fer one!"). 8 | You take the offer and (very generously) decide to give the extra cookie to someone else in the queue. 9 | -------------------------------------------------------------------------------- /exercises/practice/darts/zcl_darts.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_darts DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS score 8 | IMPORTING 9 | x TYPE f 10 | y TYPE f 11 | RETURNING 12 | VALUE(result) TYPE i. 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | 16 | ENDCLASS. 17 | 18 | 19 | CLASS zcl_darts IMPLEMENTATION. 20 | METHOD score. 21 | " add solution here 22 | ENDMETHOD. 23 | 24 | 25 | ENDCLASS. 26 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You are starting a secret coding club with some friends and friends-of-friends. 4 | Not everyone knows each other, so you and your friends have decided to create a secret handshake that you can use to recognize that someone is a member. 5 | You don't want anyone who isn't in the know to be able to crack the code. 6 | 7 | You've designed the code so that one person says a number between 1 and 31, and the other person turns it into a series of actions. 8 | -------------------------------------------------------------------------------- /exercises/practice/triangle/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Determine if a triangle is equilateral, isosceles, or scalene.", 3 | "authors": ["ajborla"], 4 | "contributors": [ 5 | ], 6 | "files": { 7 | "solution": ["zcl_triangle.clas.abap"], 8 | "test": ["zcl_triangle.clas.testclasses.abap"], 9 | "example": [".meta/zcl_triangle.clas.abap"] 10 | }, 11 | "source": "The Ruby Koans triangle project, parts 1 & 2", 12 | "source_url": "https://web.archive.org/web/20220831105330/http://rubykoans.com" 13 | } 14 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.meta/zcl_two_fer.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_two_fer DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS two_fer 4 | IMPORTING 5 | input TYPE string OPTIONAL 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_two_fer IMPLEMENTATION. 11 | 12 | METHOD two_fer. 13 | DATA(name) = input. 14 | IF name IS INITIAL. 15 | name = 'you'. 16 | ENDIF. 17 | result = |One for { name }, one for me.|. 18 | ENDMETHOD. 19 | 20 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/zcl_secret_handshake.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_secret_handshake DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS get_commands 8 | IMPORTING code TYPE i 9 | RETURNING VALUE(commands) TYPE string_table. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_secret_handshake IMPLEMENTATION. 17 | 18 | METHOD get_commands. 19 | " add solution here 20 | ENDMETHOD. 21 | 22 | ENDCLASS. 23 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_nth_prime.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_nth_prime.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_nth_prime.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a number n, determine what the nth prime is.", 17 | "source": "A variation on Problem 7 at Project Euler", 18 | "source_url": "https://projecteuler.net/problem=7" 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/ping-cross-track-maintainers-team.yml: -------------------------------------------------------------------------------- 1 | name: Ping cross-track maintainers team 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | 8 | permissions: 9 | pull-requests: write 10 | 11 | jobs: 12 | ping: 13 | if: github.repository_owner == 'exercism' # Stops this job from running on forks 14 | uses: exercism/github-actions/.github/workflows/ping-cross-track-maintainers-team.yml@main 15 | secrets: 16 | github_membership_token: ${{ secrets.COMMUNITY_CONTRIBUTIONS_WORKFLOW_TOKEN }} 17 | -------------------------------------------------------------------------------- /exercises/practice/anagram/zcl_anagram.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_anagram DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS anagram 8 | IMPORTING 9 | input TYPE string 10 | candidates TYPE string_table 11 | RETURNING 12 | VALUE(result) TYPE string_table. 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | ENDCLASS. 16 | 17 | 18 | 19 | CLASS zcl_anagram IMPLEMENTATION. 20 | METHOD anagram. 21 | * add solution here 22 | ENDMETHOD. 23 | 24 | ENDCLASS. 25 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "g-back" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_hamming.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_hamming.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_hamming.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Calculate the Hamming distance between two DNA strands.", 17 | "source": "The Calculating Point Mutations problem at Rosalind", 18 | "source_url": "https://rosalind.info/problems/hamm/" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/word-count/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_word_count.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_word_count.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_word_count.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a phrase, count the occurrences of each word in that phrase.", 17 | "source": "This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour." 18 | } 19 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_armstrong_numbers.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_armstrong_numbers.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_armstrong_numbers.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Determine if a number is an Armstrong number.", 17 | "source_url": "https://en.wikipedia.org/wiki/Narcissistic_number", 18 | "source": "Wikipedia" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/leap/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "larshp" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_leap.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_leap.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_leap.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Determine whether a given year is a leap year.", 17 | "source": "CodeRanch Cattle Drive, Assignment 3", 18 | "source_url": "https://web.archive.org/web/20240907033714/https://coderanch.com/t/718816/Leap" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_anagram.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_anagram.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_anagram.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a word and a list of possible anagrams, select the correct sublist.", 17 | "source_url": "https://github.com/rchatley/extreme_startup", 18 | "source": "Inspired by the Extreme Startup game" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/zcl_armstrong_numbers.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_armstrong_numbers DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS is_armstrong_number IMPORTING num TYPE i 9 | RETURNING VALUE(result) TYPE abap_bool. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_armstrong_numbers IMPLEMENTATION. 17 | METHOD is_armstrong_number. 18 | "Implement solution 19 | ENDMETHOD. 20 | ENDCLASS. 21 | 22 | -------------------------------------------------------------------------------- /exercises/practice/leap/.meta/zcl_leap.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_leap DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS leap 4 | IMPORTING 5 | year TYPE i 6 | RETURNING 7 | VALUE(result) TYPE abap_bool. 8 | ENDCLASS. 9 | 10 | CLASS zcl_leap IMPLEMENTATION. 11 | 12 | METHOD leap. 13 | IF year MOD 4 = 0 AND year MOD 100 <> 0. 14 | result = abap_true. 15 | ELSEIF year MOD 400 = 0. 16 | result = abap_true. 17 | ELSE. 18 | result = abap_false. 19 | ENDIF. 20 | ENDMETHOD. 21 | 22 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/nth-prime/zcl_nth_prime.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_nth_prime DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS prime 8 | IMPORTING 9 | input TYPE i 10 | RETURNING 11 | VALUE(result) TYPE i 12 | RAISING 13 | cx_parameter_invalid. 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | 17 | ENDCLASS. 18 | 19 | 20 | CLASS zcl_nth_prime IMPLEMENTATION. 21 | METHOD prime. 22 | " add solution here 23 | ENDMETHOD. 24 | 25 | 26 | ENDCLASS. 27 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # 1 space indentation for xml files 7 | [*.xml] 8 | charset = utf-8 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | indent_style = space 13 | indent_size = 1 14 | 15 | # match the format used by abapGit 16 | [*.{abap,js,json,html,css}] 17 | charset = utf-8 18 | end_of_line = lf 19 | insert_final_newline = true 20 | trim_trailing_whitespace = true 21 | indent_size = 2 22 | indent_style = space 23 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | [Flower Field][history] is a compassionate reimagining of the popular game Minesweeper. 4 | The object of the game is to find all the flowers in the garden using numeric hints that indicate how many flowers are directly adjacent (horizontally, vertically, diagonally) to a square. 5 | "Flower Field" shipped in regional versions of Microsoft Windows in Italy, Germany, South Korea, Japan and Taiwan. 6 | 7 | [history]: https://web.archive.org/web/20020409051321fw_/http://rcm.usr.dsi.unimi.it/rcmweb/fnm/ 8 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/zcl_phone_number.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_phone_number DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS clean 9 | IMPORTING 10 | !number TYPE string 11 | RETURNING 12 | VALUE(result) TYPE string 13 | RAISING 14 | cx_parameter_invalid. 15 | PROTECTED SECTION. 16 | PRIVATE SECTION. 17 | ENDCLASS. 18 | 19 | 20 | CLASS zcl_phone_number IMPLEMENTATION. 21 | 22 | METHOD clean. 23 | " add your code here 24 | ENDMETHOD. 25 | ENDCLASS. 26 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_scrabble_score.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_scrabble_score.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_scrabble_score.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a word, compute the Scrabble score for that word.", 17 | "source_url": "https://github.com/rchatley/extreme_startup", 18 | "source": "Inspired by the Extreme Startup game" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "larshp" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_atbash_cipher.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_atbash_cipher.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_atbash_cipher.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Atbash" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/zcl_collatz_conjecture.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_collatz_conjecture DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS ret_steps IMPORTING num TYPE i 8 | RETURNING VALUE(steps) TYPE i 9 | RAISING cx_parameter_invalid. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | 13 | ENDCLASS. 14 | 15 | 16 | 17 | CLASS zcl_collatz_conjecture IMPLEMENTATION. 18 | METHOD ret_steps. 19 | "Implement Solution 20 | ENDMETHOD. 21 | ENDCLASS. 22 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Calculate the Hamming distance between two DNA strands. 4 | 5 | We read DNA using the letters C, A, G and T. 6 | Two strands might look like this: 7 | 8 | GAGCCTACTAACGGGAT 9 | CATCGTAATGACGGCCT 10 | ^ ^ ^ ^ ^ ^^ 11 | 12 | They have 7 differences, and therefore the Hamming distance is 7. 13 | 14 | ## Implementation notes 15 | 16 | The Hamming distance is only defined for sequences of equal length, so an attempt to calculate it between sequences of different lengths should not work. 17 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_collatz_conjecture.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_collatz_conjecture.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_collatz_conjecture.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Calculate the number of steps to reach 1 using the Collatz conjecture.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Collatz_conjecture" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/affine-cipher/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_affine_cipher.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_affine_cipher.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_affine_cipher.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Create an implementation of the Affine cipher, an ancient encryption algorithm from the Middle East.", 17 | "source": "Wikipedia", 18 | "source_url": "https://en.wikipedia.org/wiki/Affine_cipher" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mbtools" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_beer_song.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_beer_song.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_beer_song.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.", 17 | "source": "Learn to Program by Chris Pine", 18 | "source_url": "https://pine.fm/LearnToProgram/?Chapter=06" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/zcl_beer_song.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_beer_song DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS recite 9 | IMPORTING 10 | !initial_bottles_count TYPE i 11 | !take_down_count TYPE i 12 | RETURNING 13 | VALUE(result) TYPE string_table. 14 | 15 | PROTECTED SECTION. 16 | PRIVATE SECTION. 17 | ENDCLASS. 18 | 19 | 20 | 21 | CLASS zcl_beer_song IMPLEMENTATION. 22 | 23 | METHOD recite. 24 | " add solution here 25 | ENDMETHOD. 26 | 27 | ENDCLASS. 28 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "larshp" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_resistor_color.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_resistor_color.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_resistor_color.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Convert a resistor band's color to its numeric representation.", 17 | "source": "Maud de Vries, Erik Schierboom", 18 | "source_url": "https://github.com/exercism/problem-specifications/issues/1458" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/zcl_rna_transcription.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_rna_transcription DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS 8 | transcribe 9 | IMPORTING 10 | strand TYPE string 11 | RETURNING 12 | VALUE(result) TYPE string. 13 | 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | 17 | ENDCLASS. 18 | 19 | 20 | CLASS zcl_rna_transcription IMPLEMENTATION. 21 | 22 | METHOD transcribe. 23 | "Implement solution 24 | ENDMETHOD. 25 | 26 | ENDCLASS. 27 | -------------------------------------------------------------------------------- /exercises/practice/etl/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_etl.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_etl.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_etl.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Change the data format for scoring a game to more easily add other languages.", 17 | "source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 18 | "source_url": "https://turing.edu" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/itab-basics/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jung-thomas" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_itab_basics.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_itab_basics.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_itab_basics.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Basics of Internal Tables: Initialization, Sorting, and Searching", 17 | "source": "ABAP Internal Tables", 18 | "source_url": "https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenitab.htm" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "larshp" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_hello_world.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_hello_world.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_hello_world.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".", 17 | "source": "This is an exercise to introduce users to using Exercism", 18 | "source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/matrix/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_matrix.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_matrix.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_matrix.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a string representing a matrix of numbers, return the rows and columns of that matrix.", 17 | "source_url": "https://turing.edu", 18 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design." 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/zcl_prime_factors.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_prime_factors DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | METHODS factors 9 | IMPORTING 10 | input TYPE int8 11 | RETURNING 12 | VALUE(result) TYPE integertab. 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | 16 | ENDCLASS. 17 | 18 | 19 | CLASS zcl_prime_factors IMPLEMENTATION. 20 | METHOD factors. 21 | " add solution here 22 | ENDMETHOD. 23 | 24 | 25 | ENDCLASS. 26 | -------------------------------------------------------------------------------- /exercises/practice/etl/zcl_etl.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ETL 7 | E 8 | ETL exercise 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_phone_number.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_phone_number.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_phone_number.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Clean up user-entered phone numbers so that they can be sent SMS messages.", 17 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 18 | "source_url": "https://turing.edu" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "mbtools" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_reverse_string.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_reverse_string.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_reverse_string.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Reverse a given string.", 17 | "source": "Introductory challenge to reverse an input string", 18 | "source_url": "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/leap/zcl_leap.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_LEAP 7 | E 8 | Exercism: Leap 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/clock/zcl_clock.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_CLOCK 7 | E 8 | Exercism: Clock 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/darts/zcl_darts.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_DARTS 7 | E 8 | Exercism: Darts 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "bau-mann" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_secret_handshake.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_secret_handshake.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_secret_handshake.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a decimal number, convert it to the appropriate sequence of events for a secret handshake.", 17 | "source": "Bert, in Mary Poppins", 18 | "source_url": "https://www.imdb.com/title/tt0058331/quotes/?item=qt0437047" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/zcl_lasagne.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_LASAGNE 7 | E 8 | Exercism: Lasagne 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/acronym/zcl_acronym.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ACRONYM 7 | E 8 | Acronym Practice 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/anagram/zcl_anagram.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ANAGRAM 7 | E 8 | Exercism: Anagram 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/grains/zcl_grains.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_GRAINS 7 | E 8 | Exercism: Grains 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/hamming/zcl_hamming.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_HAMMING 7 | E 8 | Exercism: Hamming 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-aggregation/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "jung-thomas" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_itab_aggregation.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_itab_aggregation.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_itab_aggregation.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a certain internal table, aggregate the data while also grouping it", 17 | "source": "ABAP Internal Tables", 18 | "source_url": "https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenitab.htm" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/matrix/zcl_matrix.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_MATRIX 7 | E 8 | Exercism: Matrix 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_prime_factors.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_prime_factors.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_prime_factors.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Compute the prime factors of a given natural number.", 17 | "source": "The Prime Factors Kata by Uncle Bob", 18 | "source_url": "https://web.archive.org/web/20221026171801/http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/zcl_two_fer.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_TWO_FER 7 | E 8 | Exercism: Two Fer 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/grains/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_grains.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_grains.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_grains.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Calculate the number of grains of wheat on a chessboard given that the number on each square doubles.", 17 | "source": "The CodeRanch Cattle Drive, Assignment 6", 18 | "source_url": "https://web.archive.org/web/20240908084142/https://coderanch.com/wiki/718824/Grains" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/isogram/zcl_isogram.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ISOGRAM 7 | E 8 | Exercism: ZCL_ISOGRAM 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/triangle/zcl_triangle.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_TRIANGLE 7 | E 8 | Exercism: Triangle 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/beer-song/zcl_beer_song.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_BEER_SONG 7 | E 8 | Exercism: Beer Song 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/crypto-square/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "dwivedirahul44" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_crypto_square.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_crypto_square.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_crypto_square.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Implement the classic method for composing secret messages called a square code.", 17 | "source": "J Dalbey's Programming Practice problems", 18 | "source_url": "https://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/crypto-square/zcl_crypto_square.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_CRYPTO_SQUARE 7 | E 8 | Crypto Square 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/zcl_nth_prime.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_NTH_PRIME 7 | E 8 | Exercism: Nth Prime 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/zcl_raindrops.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_RAINDROPS 7 | E 8 | Exercism: Raindrops 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/book-store/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "bau-mann" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_book_store.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_book_store.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_book_store.clas.abap" 14 | ] 15 | }, 16 | "blurb": "To try and encourage more sales of different books from a popular 5 book series, a bookshop has decided to offer discounts of multiple-book purchases.", 17 | "source": "Inspired by the harry potter kata from Cyber-Dojo.", 18 | "source_url": "https://cyber-dojo.org" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/book-store/zcl_book_store.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_BOOK_STORE 7 | E 8 | Exercism: Book Store 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/word-count/zcl_word_count.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_WORD_COUNT 7 | E 8 | Exercism: Word Count 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/custom-signs/zcl_custom_signs.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_CUSTOM_SIGNS 7 | E 8 | Exercism: Custom Signs 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/zcl_flower_field.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_FLOWER_FIELD 7 | E 8 | Exercism: Flower Field 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/zcl_hello_world.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_HELLO_WORLD 7 | E 8 | Exercism: Hello World 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/zcl_high_scores.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_HIGH_SCORES 7 | E 8 | Exercism: High Scores 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/zcl_minesweeper.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_MINESWEEPER 7 | E 8 | Exercism: Minesweeper 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/zcl_phone_number.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_PHONE_NUMBER 7 | E 8 | Exercism: Phone Number 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Given a DNA strand, return its RNA complement.", 3 | "authors": [ 4 | "ajborla" 5 | ], 6 | "contributors": [], 7 | "files": { 8 | "solution": [ 9 | "zcl_rna_transcription.clas.abap" 10 | ], 11 | "test": [ 12 | "zcl_rna_transcription.clas.testclasses.abap" 13 | ], 14 | "example": [ 15 | ".meta/zcl_rna_transcription.clas.abap" 16 | ] 17 | }, 18 | "source": "Hyperphysics", 19 | "source_url": "https://web.archive.org/web/20220408112140/http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html" 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/zcl_rle.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_RLE 7 | E 8 | Exercism: Run Length Encoding 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/affine-cipher/zcl_affine_cipher.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_AFFINE_CIPHER 7 | E 8 | Exercism: Affine Cipher 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/zcl_atbash_cipher.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ATBASH_CIPHER 7 | E 8 | Exercism: Atbash Cipher 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-basics/zcl_itab_basics.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ITAB_BASICS 7 | E 8 | Exercism: Interal Table Basics 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/zcl_prime_factors.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_PRIME_FACTORS 7 | E 8 | Exercism: Prime Factors 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-combination/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "rich-heilman" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_itab_combination.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_itab_combination.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_itab_combination.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given two different internal tables, combine the values of each table together into one internal table", 17 | "source": "ABAP Internal Tables", 18 | "source_url": "https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenitab.htm" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/itab-nesting/zcl_itab_nesting.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ITAB_NESTING 7 | E 8 | Exercism: Interal Table Nesting 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/zcl_resistor_color.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_RESISTOR_COLOR 7 | E 8 | Exercism: Resistor Color 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/reverse-string/zcl_reverse_string.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_REVERSE_STRING 7 | E 8 | Exercism: Reverse String 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/zcl_scrabble_score.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_SCRABBLE_SCORE 7 | E 8 | Exercism: Scrabble Score 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/zcl_armstrong_numbers.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ARMSTRONG_NUMBERS 7 | E 8 | Armstrong Numbers stub 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-nesting/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "rich-heilman" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_itab_nesting.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_itab_nesting.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_itab_nesting.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given three different internal tables, combine the data from each table into one internal table while using nested tables", 17 | "source": "ABAP Internal Tables", 18 | "source_url": "https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenitab.htm" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_kindergarten_garden.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_kindergarten_garden.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_kindergarten_garden.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Given a diagram, determine which plants each child in the kindergarten class is responsible for.", 17 | "source": "Exercise by the JumpstartLab team for students at The Turing School of Software and Design.", 18 | "source_url": "https://turing.edu" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/zcl_collatz_conjecture.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_COLLATZ_CONJECTURE 7 | E 8 | collatz conjecture stub 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "blurb": "Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.", 3 | "authors": [ 4 | "dwivedirahul44" 5 | ], 6 | "contributors": [], 7 | "files": { 8 | "solution": [ 9 | "zcl_difference_of_squares.clas.abap" 10 | ], 11 | "test": [ 12 | "zcl_difference_of_squares.clas.testclasses.abap" 13 | ], 14 | "example": [ 15 | ".meta/zcl_difference_of_squares.clas.abap" 16 | ] 17 | }, 18 | "source": "Problem 6 at Project Euler", 19 | "source_url": "https://projecteuler.net/problem=6" 20 | } 21 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/zcl_kindergarten_garden.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_kindergarten_garden DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS plants 8 | IMPORTING 9 | diagram TYPE string 10 | student TYPE string 11 | RETURNING 12 | VALUE(results) TYPE string_table. 13 | 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | DATA students TYPE string_table. 17 | 18 | ENDCLASS. 19 | 20 | 21 | CLASS zcl_kindergarten_garden IMPLEMENTATION. 22 | 23 | 24 | METHOD plants. 25 | " add solution here 26 | ENDMETHOD. 27 | 28 | 29 | ENDCLASS. 30 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/zcl_rna_transcription.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_RNA_TRANSCRIPTION 7 | E 8 | Exercism: RNA Transcription 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/zcl_secret_handshake.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_SECRET_HANDSHAKE 7 | E 8 | Exercism: Secret Handshake 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-aggregation/zcl_itab_aggregation.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ITAB_AGGREGATION 7 | E 8 | Exercism: Interal Table Aggregation 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/itab-combination/zcl_itab_combination.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ITAB_COMBINATION 7 | E 8 | Exercism: Interal Table Combination 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/zcl_rle.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_rle DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS encode IMPORTING input TYPE string 9 | RETURNING VALUE(result) TYPE string. 10 | 11 | METHODS decode IMPORTING input TYPE string 12 | RETURNING VALUE(result) TYPE string. 13 | 14 | ENDCLASS. 15 | 16 | 17 | CLASS zcl_rle IMPLEMENTATION. 18 | 19 | METHOD encode. 20 | 21 | "Add solution here 22 | 23 | ENDMETHOD. 24 | 25 | 26 | METHOD decode. 27 | 28 | "Add solution here 29 | 30 | ENDMETHOD. 31 | 32 | ENDCLASS. 33 | -------------------------------------------------------------------------------- /exercises/practice/elyses-enchantments/zcl_elyses_enchantments.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_ELYSES_ENCHANTMENTS 7 | E 8 | Exercism: Elyses Enchantments 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/kindergarten-garden/zcl_kindergarten_garden.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_KINDERGARTEN_GARDEN 7 | E 8 | Exercism: Kindergarten Garden 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/state-of-tic-tac-toe/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "bau-mann" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_state_of_tic_tac_toe.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_state_of_tic_tac_toe.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_state_of_tic_tac_toe.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Determine the game state of a match of Tic-Tac-Toe.", 17 | "source": "Created by Sascha Mann for the Julia track of the Exercism Research Experiment.", 18 | "source_url": "https://github.com/exercism/research_experiment_1/tree/julia-dev/exercises/julia-1-a" 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/state-of-tic-tac-toe/zcl_state_of_tic_tac_toe.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_STATE_OF_TIC_TAC_TOE 7 | E 8 | Exercism: State of Tic-Tac-Toe 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/zcl_difference_of_squares.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_DIFFERENCE_OF_SQUARES 7 | E 8 | Exercism: Difference of squares 9 | 1 10 | X 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /exercises/practice/hello-world/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | The classical introductory exercise. 4 | Just say "Hello, World!". 5 | 6 | ["Hello, World!"][hello-world] is the traditional first program for beginning programming in a new language or environment. 7 | 8 | The objectives are simple: 9 | 10 | - Modify the provided code so that it produces the string "Hello, World!". 11 | - Run the test suite and make sure that it succeeds. 12 | - Submit your solution and check it at the website. 13 | 14 | If everything goes well, you will be ready to fetch your first real exercise. 15 | 16 | [hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program 17 | -------------------------------------------------------------------------------- /exercises/practice/leap/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | A leap year (in the Gregorian calendar) occurs: 4 | 5 | - In every year that is evenly divisible by 4. 6 | - Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400. 7 | 8 | Some examples: 9 | 10 | - 1997 was not a leap year as it's not divisible by 4. 11 | - 1900 was not a leap year as it's not divisible by 400. 12 | - 2000 was a leap year! 13 | 14 | ~~~~exercism/note 15 | For a delightful, four-minute explanation of the whole phenomenon of leap years, check out [this YouTube video](https://www.youtube.com/watch?v=xX96xng7sAE). 16 | ~~~~ 17 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Convert a phrase to its acronym. 4 | 5 | Techies love their TLA (Three Letter Acronyms)! 6 | 7 | Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG). 8 | 9 | Punctuation is handled as follows: hyphens are word separators (like whitespace); all other punctuation can be removed from the input. 10 | 11 | For example: 12 | 13 | | Input | Output | 14 | | ------------------------- | ------ | 15 | | As Soon As Possible | ASAP | 16 | | Liquid-crystal display | LCD | 17 | | Thank George It's Friday! | TGIF | 18 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/zcl_atbash_cipher.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_atbash_cipher DEFINITION PUBLIC FINAL CREATE PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | METHODS decode 5 | IMPORTING 6 | cipher_text TYPE string 7 | RETURNING 8 | VALUE(plain_text) TYPE string . 9 | METHODS encode 10 | IMPORTING 11 | plain_text TYPE string 12 | RETURNING 13 | VALUE(cipher_text) TYPE string . 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS zcl_atbash_cipher IMPLEMENTATION. 21 | 22 | METHOD decode. 23 | * todo 24 | ENDMETHOD. 25 | 26 | METHOD encode. 27 | * todo 28 | ENDMETHOD. 29 | ENDCLASS. 30 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | An [Armstrong number][armstrong-number] is a number that is the sum of its own digits each raised to the power of the number of digits. 4 | 5 | For example: 6 | 7 | - 9 is an Armstrong number, because `9 = 9^1 = 9` 8 | - 10 is _not_ an Armstrong number, because `10 != 1^2 + 0^2 = 1` 9 | - 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153` 10 | - 154 is _not_ an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190` 11 | 12 | Write some code to determine whether a number is an Armstrong number. 13 | 14 | [armstrong-number]: https://en.wikipedia.org/wiki/Narcissistic_number 15 | -------------------------------------------------------------------------------- /exercises/practice/darts/.meta/zcl_darts.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_darts DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS score 8 | IMPORTING 9 | x TYPE f 10 | y TYPE f 11 | RETURNING 12 | VALUE(result) TYPE i. 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | 16 | ENDCLASS. 17 | 18 | 19 | CLASS zcl_darts IMPLEMENTATION. 20 | METHOD score. 21 | IF x * x + y * y <= 1. 22 | result = 10. 23 | ELSEIF x * x + y * y <= ( 5 * 5 ). 24 | result = 5. 25 | ELSEIF x * x + y * y <= ( 10 * 10 ). 26 | result = 1. 27 | ENDIF. 28 | ENDMETHOD. 29 | 30 | 31 | ENDCLASS. 32 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/.meta/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "authors": [ 3 | "marianfoo" 4 | ], 5 | "files": { 6 | "solution": [ 7 | "zcl_raindrops.clas.abap" 8 | ], 9 | "test": [ 10 | "zcl_raindrops.clas.testclasses.abap" 11 | ], 12 | "example": [ 13 | ".meta/zcl_raindrops.clas.abap" 14 | ] 15 | }, 16 | "blurb": "Convert a number into its corresponding raindrop sounds - Pling, Plang and Plong.", 17 | "source_url": "https://en.wikipedia.org/wiki/Fizz_buzz", 18 | "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." 19 | } 20 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine what you will say as you give away the extra cookie. 4 | 5 | If you know the person's name (e.g. if they're named Do-yun), then you will say: 6 | 7 | ```text 8 | One for Do-yun, one for me. 9 | ``` 10 | 11 | If you don't know the person's name, you will say _you_ instead. 12 | 13 | ```text 14 | One for you, one for me. 15 | ``` 16 | 17 | Here are some examples: 18 | 19 | | Name | Dialogue | 20 | | :----- | :-------------------------- | 21 | | Alice | One for Alice, one for me. | 22 | | Bohdan | One for Bohdan, one for me. | 23 | | | One for you, one for me. | 24 | | Zaphod | One for Zaphod, one for me. | 25 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a bioengineering company that specializes in developing therapeutic solutions. 4 | 5 | Your team has just been given a new project to develop a targeted therapy for a rare type of cancer. 6 | 7 | ~~~~exercism/note 8 | It's all very complicated, but the basic idea is that sometimes people's bodies produce too much of a given protein. 9 | That can cause all sorts of havoc. 10 | 11 | But if you can create a very specific molecule (called a micro-RNA), it can prevent the protein from being produced. 12 | 13 | This technique is called [RNA Interference][rnai]. 14 | 15 | [rnai]: https://admin.acceleratingscience.com/ask-a-scientist/what-is-rnai/ 16 | ~~~~ 17 | -------------------------------------------------------------------------------- /exercises/practice/word-count/zcl_word_count.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_word_count DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES: 8 | BEGIN OF return_structure, 9 | word TYPE string, 10 | count TYPE i, 11 | END OF return_structure, 12 | return_table TYPE STANDARD TABLE OF return_structure WITH KEY word. 13 | METHODS count_words 14 | IMPORTING 15 | !phrase TYPE string 16 | RETURNING 17 | VALUE(result) TYPE return_table . 18 | PROTECTED SECTION. 19 | PRIVATE SECTION. 20 | ENDCLASS. 21 | 22 | 23 | CLASS zcl_word_count IMPLEMENTATION. 24 | 25 | METHOD count_words. 26 | "Add solution here 27 | ENDMETHOD. 28 | ENDCLASS. 29 | -------------------------------------------------------------------------------- /.github/workflows/no-important-files-changed.yml: -------------------------------------------------------------------------------- 1 | name: No important files changed 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | branches: [main] 7 | paths: 8 | - "exercises/concept/**" 9 | - "exercises/practice/**" 10 | - "!exercises/*/*/.approaches/**" 11 | - "!exercises/*/*/.articles/**" 12 | - "!exercises/*/*/.docs/**" 13 | - "!exercises/*/*/.meta/**" 14 | 15 | permissions: 16 | pull-requests: write 17 | 18 | jobs: 19 | check: 20 | uses: exercism/github-actions/.github/workflows/check-no-important-files-changed.yml@main 21 | with: 22 | repository: ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }} 23 | ref: ${{ github.head_ref }} 24 | -------------------------------------------------------------------------------- /exercises/practice/raindrops/.meta/zcl_raindrops.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_raindrops DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS raindrops 4 | IMPORTING 5 | input TYPE i 6 | RETURNING 7 | VALUE(result) TYPE string. 8 | ENDCLASS. 9 | 10 | CLASS zcl_raindrops IMPLEMENTATION. 11 | 12 | METHOD raindrops. 13 | IF input MOD 3 = 0. 14 | result = |{ result }Pling|. 15 | ENDIF. 16 | IF input MOD 5 = 0. 17 | result = |{ result }Plang|. 18 | ENDIF. 19 | IF input MOD 7 = 0. 20 | result = |{ result }Plong|. 21 | ENDIF. 22 | 23 | IF input MOD 3 <> 0 AND 24 | input MOD 5 <> 0 AND 25 | input MOD 7 <> 0. 26 | result = input. 27 | ENDIF. 28 | ENDMETHOD. 29 | 30 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/hamming/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Your body is made up of cells that contain DNA. 4 | Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells. 5 | In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime! 6 | 7 | When cells divide, their DNA replicates too. 8 | Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information. 9 | If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred. 10 | This is known as the "Hamming distance". 11 | 12 | The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :) 13 | -------------------------------------------------------------------------------- /concepts/basics/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | [ABAP][abap] is a programming language developed by SAP for the development of business applications with the ABAP development environment of an ABAP Platform. 4 | 5 | ABAP supports the following: 6 | 7 | - An object-oriented programming model that is based on classes and interfaces of ABAP Objects. 8 | - A procedural programming model that is based on function modules and subroutines. 9 | 10 | Both models are interoperable, however, on Exercism the focus is solely on the object-oriented programming model. 11 | 12 | You can find more information in the [ABAP Track][docs] documentation. 13 | 14 | [abap]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_oview.htm 15 | [docs]: https://exercism.org/docs/tracks/abap -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to determine the RNA complement of a given DNA sequence. 4 | 5 | Both DNA and RNA strands are a sequence of nucleotides. 6 | 7 | The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), guanine (**G**), and thymine (**T**). 8 | 9 | The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), guanine (**G**), and uracil (**U**). 10 | 11 | Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement: 12 | 13 | - `G` -> `C` 14 | - `C` -> `G` 15 | - `T` -> `A` 16 | - `A` -> `U` 17 | 18 | ~~~~exercism/note 19 | If you want to look at how the inputs and outputs are structured, take a look at the examples in the test suite. 20 | ~~~~ 21 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Find the difference between the square of the sum and the sum of the squares of the first N natural numbers. 4 | 5 | The square of the sum of the first ten natural numbers is 6 | (1 + 2 + ... + 10)² = 55² = 3025. 7 | 8 | The sum of the squares of the first ten natural numbers is 9 | 1² + 2² + ... + 10² = 385. 10 | 11 | Hence the difference between the square of the sum of the first ten natural numbers and the sum of the squares of the first ten natural numbers is 3025 - 385 = 2640. 12 | 13 | You are not expected to discover an efficient solution to this yourself from first principles; research is allowed, indeed, encouraged. 14 | Finding the best algorithm for the problem is a key skill in software engineering. 15 | -------------------------------------------------------------------------------- /exercises/practice/phone-number/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You've joined LinkLine, a leading communications company working to ensure reliable connections for everyone. 4 | The team faces a big challenge: users submit phone numbers in all sorts of formats — dashes, spaces, dots, parentheses, and even prefixes. 5 | Some numbers are valid, while others are impossible to use. 6 | 7 | Your mission is to turn this chaos into order. 8 | You'll clean up valid numbers, formatting them appropriately for use in the system. 9 | At the same time, you'll identify and filter out any invalid entries. 10 | 11 | The success of LinkLine's operations depends on your ability to separate the useful from the unusable. 12 | Are you ready to take on the challenge and keep the connections running smoothly? 13 | -------------------------------------------------------------------------------- /exercises/practice/grains/zcl_grains.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_grains DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES type_result TYPE p LENGTH 16 DECIMALS 0. 8 | METHODS square 9 | IMPORTING 10 | input TYPE i 11 | RETURNING 12 | VALUE(result) TYPE type_result 13 | RAISING 14 | cx_parameter_invalid. 15 | METHODS total 16 | RETURNING 17 | VALUE(result) TYPE type_result 18 | RAISING 19 | cx_parameter_invalid. 20 | PROTECTED SECTION. 21 | PRIVATE SECTION. 22 | 23 | ENDCLASS. 24 | 25 | 26 | CLASS zcl_grains IMPLEMENTATION. 27 | METHOD square. 28 | " add solution here 29 | ENDMETHOD. 30 | 31 | METHOD total. 32 | " add solution here 33 | ENDMETHOD. 34 | 35 | 36 | ENDCLASS. 37 | -------------------------------------------------------------------------------- /exercises/practice/minesweeper/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to add the mine counts to empty squares in a completed Minesweeper board. 4 | The board itself is a rectangle composed of squares that are either empty (`' '`) or a mine (`'*'`). 5 | 6 | For each empty square, count the number of mines adjacent to it (horizontally, vertically, diagonally). 7 | If the empty square has no adjacent mines, leave it empty. 8 | Otherwise replace it with the adjacent mines count. 9 | 10 | For example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen): 11 | 12 | ```text 13 | ·*·*· 14 | ··*·· 15 | ··*·· 16 | ····· 17 | ``` 18 | 19 | Which your code should transform into this: 20 | 21 | ```text 22 | 1*3*1 23 | 13*31 24 | ·2*2· 25 | ·111· 26 | ``` 27 | -------------------------------------------------------------------------------- /exercises/practice/scrabble-score/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to compute a word's Scrabble score by summing the values of its letters. 4 | 5 | The letters are valued as follows: 6 | 7 | | Letter | Value | 8 | | ---------------------------- | ----- | 9 | | A, E, I, O, U, L, N, R, S, T | 1 | 10 | | D, G | 2 | 11 | | B, C, M, P | 3 | 12 | | F, H, V, W, Y | 4 | 13 | | K | 5 | 14 | | J, X | 8 | 15 | | Q, Z | 10 | 16 | 17 | For example, the word "cabbage" is worth 14 points: 18 | 19 | - 3 points for C 20 | - 1 point for A 21 | - 3 points for B 22 | - 3 points for B 23 | - 1 point for A 24 | - 2 points for G 25 | - 1 point for E 26 | -------------------------------------------------------------------------------- /exercises/practice/hamming/.meta/zcl_hamming.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_hamming DEFINITION PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS hamming_distance 4 | IMPORTING 5 | first_strand TYPE string 6 | second_strand TYPE string 7 | RETURNING 8 | VALUE(result) TYPE i 9 | RAISING 10 | cx_parameter_invalid. 11 | ENDCLASS. 12 | 13 | CLASS zcl_hamming IMPLEMENTATION. 14 | 15 | METHOD hamming_distance. 16 | IF strlen( first_strand ) <> strlen( second_strand ). 17 | RAISE EXCEPTION TYPE cx_parameter_invalid. 18 | ENDIF. 19 | DATA(offset) = 0. 20 | WHILE offset < strlen( first_strand ). 21 | IF first_strand+offset(1) <> second_strand+offset(1). 22 | result = result + 1. 23 | ENDIF. 24 | offset = offset + 1. 25 | ENDWHILE. 26 | ENDMETHOD. 27 | 28 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/matrix/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a string representing a matrix of numbers, return the rows and columns of that matrix. 4 | 5 | So given a string with embedded newlines like: 6 | 7 | ```text 8 | 9 8 7 9 | 5 3 2 10 | 6 6 7 11 | ``` 12 | 13 | representing this matrix: 14 | 15 | ```text 16 | 1 2 3 17 | |--------- 18 | 1 | 9 8 7 19 | 2 | 5 3 2 20 | 3 | 6 6 7 21 | ``` 22 | 23 | your code should be able to spit out: 24 | 25 | - A list of the rows, reading each row left-to-right while moving top-to-bottom across the rows, 26 | - A list of the columns, reading each column top-to-bottom while moving from left-to-right. 27 | 28 | The rows for our example matrix: 29 | 30 | - 9, 8, 7 31 | - 5, 3, 2 32 | - 6, 6, 7 33 | 34 | And its columns: 35 | 36 | - 9, 5, 6 37 | - 8, 3, 6 38 | - 7, 2, 7 39 | -------------------------------------------------------------------------------- /exercises/practice/flower-field/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to add flower counts to empty squares in a completed Flower Field garden. 4 | The garden itself is a rectangle board composed of squares that are either empty (`' '`) or a flower (`'*'`). 5 | 6 | For each empty square, count the number of flowers adjacent to it (horizontally, vertically, diagonally). 7 | If the empty square has no adjacent flowers, leave it empty. 8 | Otherwise replace it with the count of adjacent flowers. 9 | 10 | For example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen): 11 | 12 | ```text 13 | ·*·*· 14 | ··*·· 15 | ··*·· 16 | ····· 17 | ``` 18 | 19 | Which your code should transform into this: 20 | 21 | ```text 22 | 1*3*1 23 | 13*31 24 | ·2*2· 25 | ·111· 26 | ``` 27 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | At a garage sale, you find a lovely vintage typewriter at a bargain price! 4 | Excitedly, you rush home, insert a sheet of paper, and start typing away. 5 | However, your excitement wanes when you examine the output: all words are garbled! 6 | For example, it prints "stop" instead of "post" and "least" instead of "stale." 7 | Carefully, you try again, but now it prints "spot" and "slate." 8 | After some experimentation, you find there is a random delay before each letter is printed, which messes up the order. 9 | You now understand why they sold it for so little money! 10 | 11 | You realize this quirk allows you to generate anagrams, which are words formed by rearranging the letters of another word. 12 | Pleased with your finding, you spend the rest of the day generating hundreds of anagrams. 13 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/.meta/zcl_prime_factors.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_prime_factors DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | METHODS factors 9 | IMPORTING 10 | input TYPE int8 11 | RETURNING 12 | VALUE(result) TYPE integertab. 13 | PROTECTED SECTION. 14 | PRIVATE SECTION. 15 | 16 | ENDCLASS. 17 | 18 | 19 | CLASS zcl_prime_factors IMPLEMENTATION. 20 | METHOD factors. 21 | DATA(temp_input) = input. 22 | DATA(divisor) = 2. 23 | WHILE temp_input > 1. 24 | WHILE temp_input MOD divisor <> 0. 25 | divisor = divisor + 1. 26 | ENDWHILE. 27 | APPEND divisor TO result. 28 | temp_input = temp_input / divisor. 29 | ENDWHILE. 30 | ENDMETHOD. 31 | 32 | 33 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/matrix/zcl_matrix.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_matrix DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | METHODS matrix_row 9 | IMPORTING 10 | string TYPE string 11 | index TYPE i 12 | RETURNING 13 | VALUE(result) TYPE integertab. 14 | METHODS matrix_column 15 | IMPORTING 16 | string TYPE string 17 | index TYPE i 18 | RETURNING 19 | VALUE(result) TYPE integertab. 20 | PROTECTED SECTION. 21 | PRIVATE SECTION. 22 | 23 | ENDCLASS. 24 | 25 | 26 | 27 | CLASS zcl_matrix IMPLEMENTATION. 28 | METHOD matrix_row. 29 | " add solution here 30 | ENDMETHOD. 31 | 32 | METHOD matrix_column. 33 | " add solution here 34 | ENDMETHOD. 35 | ENDCLASS. 36 | -------------------------------------------------------------------------------- /exercises/practice/acronym/.meta/zcl_acronym.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_acronym DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS parse IMPORTING phrase TYPE string 8 | RETURNING VALUE(acronym) TYPE string. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_acronym IMPLEMENTATION. 16 | METHOD parse. 17 | DATA(str) = phrase. 18 | REPLACE ALL OCCURRENCES OF REGEX '-' IN str WITH ` `. 19 | REPLACE ALL OCCURRENCES OF REGEX '['',_,]' IN str WITH ``. 20 | SPLIT str AT space INTO TABLE DATA(ph_tab). 21 | DELETE ph_tab WHERE table_line IS INITIAL. 22 | IF ph_tab IS INITIAL. 23 | RETURN. 24 | ENDIF. 25 | LOOP AT ph_tab INTO DATA(phr). 26 | acronym &&= to_upper( substring( val = phr off = 0 len = 1 ) ). 27 | ENDLOOP. 28 | ENDMETHOD. 29 | ENDCLASS. 30 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.meta/zcl_resistor_color.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_resistor_color DEFINITION PUBLIC CREATE PUBLIC. 2 | PUBLIC SECTION. 3 | METHODS resistor_color 4 | IMPORTING 5 | color_code TYPE string 6 | RETURNING 7 | VALUE(value) TYPE i. 8 | ENDCLASS. 9 | 10 | CLASS zcl_resistor_color IMPLEMENTATION. 11 | 12 | METHOD resistor_color. 13 | 14 | CASE color_code. 15 | WHEN 'brown'. 16 | value = 1. 17 | WHEN 'red'. 18 | value = 2. 19 | WHEN 'orange'. 20 | value = 3. 21 | WHEN 'yellow'. 22 | value = 4. 23 | WHEN 'green'. 24 | value = 5. 25 | WHEN 'blue'. 26 | value = 6. 27 | WHEN 'violet'. 28 | value = 7. 29 | WHEN 'grey'. 30 | value = 8. 31 | WHEN 'white'. 32 | value = 9. 33 | ENDCASE. 34 | 35 | ENDMETHOD. 36 | 37 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/clock/zcl_clock.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_clock DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC. 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !hours TYPE i 10 | !minutes TYPE i DEFAULT 0. 11 | METHODS get 12 | RETURNING 13 | VALUE(result) TYPE string. 14 | METHODS add 15 | IMPORTING 16 | !minutes TYPE i. 17 | METHODS sub 18 | IMPORTING 19 | !minutes TYPE i. 20 | 21 | PRIVATE SECTION. 22 | 23 | * add solution here 24 | 25 | ENDCLASS. 26 | 27 | 28 | 29 | CLASS zcl_clock IMPLEMENTATION. 30 | 31 | METHOD add. 32 | * add solution here 33 | ENDMETHOD. 34 | 35 | 36 | METHOD constructor. 37 | * add solution here 38 | ENDMETHOD. 39 | 40 | 41 | METHOD get. 42 | * add solution here 43 | ENDMETHOD. 44 | 45 | 46 | METHOD sub. 47 | * add solution here 48 | ENDMETHOD. 49 | ENDCLASS. 50 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.meta/zcl_collatz_conjecture.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_collatz_conjecture DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS ret_steps IMPORTING num TYPE i 8 | RETURNING VALUE(steps) TYPE i 9 | RAISING cx_parameter_invalid. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | 13 | ENDCLASS. 14 | 15 | 16 | 17 | CLASS zcl_collatz_conjecture IMPLEMENTATION. 18 | METHOD ret_steps. 19 | DATA current_num TYPE i. 20 | IF num < 1. 21 | RAISE EXCEPTION TYPE cx_parameter_invalid. 22 | ENDIF. 23 | 24 | current_num = num. 25 | WHILE current_num > 1. 26 | current_num = COND i( WHEN current_num MOD 2 = 0 THEN current_num / 2 27 | ELSE current_num * 3 + 1 ). 28 | steps += 1. 29 | ENDWHILE. 30 | ENDMETHOD. 31 | ENDCLASS. 32 | -------------------------------------------------------------------------------- /exercises/practice/etl/zcl_etl.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_etl DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | TYPES: 8 | BEGIN OF ty_legacy_data, 9 | number TYPE i, 10 | string TYPE string, 11 | END OF ty_legacy_data, 12 | BEGIN OF ty_new_data, 13 | letter TYPE c LENGTH 1, 14 | number TYPE i, 15 | END OF ty_new_data, 16 | tty_legacy_data TYPE SORTED TABLE OF ty_legacy_data WITH UNIQUE KEY number, 17 | tty_new_data TYPE SORTED TABLE OF ty_new_data WITH UNIQUE KEY letter. 18 | 19 | METHODS transform IMPORTING legacy_data TYPE tty_legacy_data 20 | RETURNING VALUE(new_data) TYPE tty_new_data. 21 | PROTECTED SECTION. 22 | PRIVATE SECTION. 23 | ENDCLASS. 24 | 25 | 26 | 27 | CLASS zcl_etl IMPLEMENTATION. 28 | METHOD transform. 29 | "Implement Solution. 30 | ENDMETHOD. 31 | ENDCLASS. 32 | -------------------------------------------------------------------------------- /exercises/practice/book-store/zcl_book_store.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_book_store DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | "! ID of book to buy from 1 to 5 9 | TYPES book_id TYPE i. 10 | 11 | TYPES basket_type TYPE SORTED TABLE OF book_id 12 | WITH NON-UNIQUE KEY table_line. 13 | 14 | TYPES total TYPE p LENGTH 3 DECIMALS 2. 15 | 16 | "! @parameter basket | E.g., buying two copies of the first book and one copy of the second book 17 | "! is equivalent to ( ( 1 ) ( 1 ) ( 2 ) ) 18 | METHODS calculate_total 19 | IMPORTING basket TYPE basket_type 20 | RETURNING VALUE(total) TYPE total. 21 | 22 | PROTECTED SECTION. 23 | PRIVATE SECTION. 24 | ENDCLASS. 25 | 26 | 27 | 28 | CLASS zcl_book_store IMPLEMENTATION. 29 | 30 | METHOD calculate_total. 31 | " add solution here 32 | ENDMETHOD. 33 | 34 | ENDCLASS. 35 | -------------------------------------------------------------------------------- /.appends/.github/labels.yml: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------------------- # 2 | # These are the repository-specific labels that augment the Exercise-wide labels defined in # 3 | # https://github.com/exercism/org-wide-files/blob/main/global-files/.github/labels.yml. # 4 | # ----------------------------------------------------------------------------------------- # 5 | 6 | - name: "duplicate" 7 | description: "" 8 | color: "cccccc" 9 | 10 | - name: "enhancement" 11 | description: "" 12 | color: "84b6eb" 13 | 14 | - name: "invalid" 15 | description: "" 16 | color: "e6e6e6" 17 | 18 | - name: "needs maintainer" 19 | description: "" 20 | color: "fc2929" 21 | 22 | - name: "new track" 23 | description: "" 24 | color: "159818" 25 | 26 | - name: "question" 27 | description: "" 28 | color: "cc317c" 29 | 30 | - name: "wontfix" 31 | description: "" 32 | color: "ffffff" 33 | -------------------------------------------------------------------------------- /exercises/shared/.docs/tests.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | You can implement an exercise in your own SAP system. Follow these steps: 4 | 5 | 1. Create a SAP package for all Exercism exercises in your system (recommended name: `$EXERCISM`) 6 | 2. Create a SAP package for each exercise as a subpackage (recommended name: `$EXERCISM_`, example: `$EXERCISM_HELLO-WORLD`) 7 | 3. Create an ABAP class corresponding to the exercise (example: `ZCL_HELLO_WORLD`) 8 | 4. Copy the template code from Exercism to the class 9 | 5. Maintain the test classes and copy the code from Exercism to the test class 10 | 11 | Now you can complete the implementation of the class and run the unit test to see if your solution works properly. 12 | 13 | Note: This package setup will allow you to backup all your work using [abapGit](https://abapgit.org) by creating a repo for package `$EXERCISM`. 14 | 15 | For more details, see [Exercism ABAP Docs](https://exercism.org/docs/tracks/abap). 16 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/.meta/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## Learning objectives 4 | 5 | - Know what a variable is. 6 | - Know what a constant variable is. 7 | - Know how to define a variable. 8 | - Know how to export a variable 9 | - Know how to return a value from a function (explicit return). 10 | 11 | ## Out of scope 12 | 13 | This exercise is really just to introduce the bare minimum a student needs to know to solve a very basic exercise on Exercism. 14 | Details about the primitive data types, different ways to define functions etc. will all be properly introduced in the later concept exercises. 15 | 16 | We don't even explicitly teach the basics of numbers and arithmetic operators in the introduction. Given the general code examples that are provided and some "I will just try that", the student should be fine solving the exercise nevertheless. 17 | 18 | ## Concepts 19 | 20 | - `basics` 21 | 22 | ## Prerequisites 23 | 24 | There are no prerequisites. 25 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Given a target word and one or more candidate words, your task is to find the candidates that are anagrams of the target. 4 | 5 | An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`. 6 | A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`. 7 | 8 | The target word and candidate words are made up of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`). 9 | Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `"StoP"` is not an anagram of `"sTOp"`. 10 | The words you need to find should be taken from the candidate words, using the same letter case. 11 | 12 | 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"`. 13 | -------------------------------------------------------------------------------- /exercises/practice/etl/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | You work for a company that makes an online multiplayer game called Lexiconia. 4 | 5 | To play the game, each player is given 13 letters, which they must rearrange to create words. 6 | Different letters have different point values, since it's easier to create words with some letters than others. 7 | 8 | The game was originally launched in English, but it is very popular, and now the company wants to expand to other languages as well. 9 | 10 | Different languages need to support different point values for letters. 11 | The point values are determined by how often letters are used, compared to other letters in that language. 12 | 13 | For example, the letter 'C' is quite common in English, and is only worth 3 points. 14 | But in Norwegian it's a very rare letter, and is worth 10 points. 15 | 16 | To make it easier to add new languages, your team needs to change the way letters and their point values are stored in the game. 17 | -------------------------------------------------------------------------------- /exercises/practice/rna-transcription/.meta/zcl_rna_transcription.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_rna_transcription DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS 8 | transcribe 9 | IMPORTING 10 | strand TYPE string 11 | RETURNING 12 | VALUE(result) TYPE string. 13 | 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | 17 | ENDCLASS. 18 | 19 | 20 | CLASS zcl_rna_transcription IMPLEMENTATION. 21 | 22 | METHOD transcribe. 23 | DATA(offset) = 0. 24 | result = ''. 25 | DO strlen( strand ) TIMES. 26 | CASE strand+offset(1). 27 | WHEN 'A'. 28 | result = result && 'U'. 29 | WHEN 'C'. 30 | result = result && 'G'. 31 | WHEN 'G'. 32 | result = result && 'C'. 33 | WHEN 'T'. 34 | result = result && 'A'. 35 | ENDCASE. 36 | offset = offset + 1. 37 | ENDDO. 38 | ENDMETHOD. 39 | 40 | ENDCLASS. 41 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Implement run-length encoding and decoding. 4 | 5 | Run-length encoding (RLE) is a simple form of data compression, where runs (consecutive data elements) are replaced by just one data value and count. 6 | 7 | For example we can represent the original 53 characters with only 13. 8 | 9 | ```text 10 | "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB" -> "12WB12W3B24WB" 11 | ``` 12 | 13 | RLE allows the original data to be perfectly reconstructed from the compressed data, which makes it a lossless data compression. 14 | 15 | ```text 16 | "AABCCCDEEEE" -> "2AB3CD4E" -> "AABCCCDEEEE" 17 | ``` 18 | 19 | For simplicity, you can assume that the unencoded string will only contain the letters A through Z (either lower or upper case) and whitespace. 20 | This way data to be encoded will never contain any numbers and numbers inside data to be decoded always represent the count for the following character. 21 | -------------------------------------------------------------------------------- /exercises/practice/affine-cipher/zcl_affine_cipher.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_affine_cipher DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | TYPES: BEGIN OF key, 8 | a TYPE i, 9 | b TYPE i, 10 | END OF key. 11 | 12 | METHODS: 13 | encode IMPORTING phrase TYPE string 14 | key TYPE key 15 | RETURNING VALUE(cipher) TYPE string 16 | RAISING cx_parameter_invalid, 17 | decode IMPORTING cipher TYPE string 18 | key TYPE key 19 | RETURNING VALUE(phrase) TYPE string 20 | RAISING cx_parameter_invalid. 21 | PROTECTED SECTION. 22 | PRIVATE SECTION. 23 | ENDCLASS. 24 | 25 | 26 | 27 | CLASS zcl_affine_cipher IMPLEMENTATION. 28 | METHOD encode. 29 | "Implement solution 30 | ENDMETHOD. 31 | 32 | METHOD decode. 33 | "Implement solution 34 | ENDMETHOD. 35 | 36 | ENDCLASS. 37 | -------------------------------------------------------------------------------- /exercises/practice/armstrong-numbers/.meta/zcl_armstrong_numbers.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_armstrong_numbers DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS is_armstrong_number IMPORTING num TYPE i 9 | RETURNING VALUE(result) TYPE abap_bool. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_armstrong_numbers IMPLEMENTATION. 17 | METHOD is_armstrong_number. 18 | DATA: 19 | numstr TYPE string, 20 | digits TYPE i, 21 | chk_num TYPE i, 22 | counter TYPE i. 23 | 24 | numstr = condense( CONV string( num ) ). 25 | digits = strlen( numstr ). 26 | DO digits TIMES. 27 | chk_num += ipow( base = CONV i( substring( val = numstr off = counter len = 1 ) ) exp = digits ). 28 | counter += 1. 29 | ENDDO. 30 | 31 | IF chk_num = num. 32 | result = abap_true. 33 | ENDIF. 34 | 35 | ENDMETHOD. 36 | ENDCLASS. 37 | -------------------------------------------------------------------------------- /exercises/practice/prime-factors/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Compute the prime factors of a given natural number. 4 | 5 | A prime number is only evenly divisible by itself and 1. 6 | 7 | Note that 1 is not a prime number. 8 | 9 | ## Example 10 | 11 | What are the prime factors of 60? 12 | 13 | - Our first divisor is 2. 14 | 2 goes into 60, leaving 30. 15 | - 2 goes into 30, leaving 15. 16 | - 2 doesn't go cleanly into 15. 17 | So let's move on to our next divisor, 3. 18 | - 3 goes cleanly into 15, leaving 5. 19 | - 3 does not go cleanly into 5. 20 | The next possible factor is 4. 21 | - 4 does not go cleanly into 5. 22 | The next possible factor is 5. 23 | - 5 does go cleanly into 5. 24 | - We're left only with 1, so now, we're done. 25 | 26 | Our successful divisors in that computation represent the list of prime factors of 60: 2, 2, 3, and 5. 27 | 28 | You can check this yourself: 29 | 30 | ```text 31 | 2 * 2 * 3 * 5 32 | = 4 * 15 33 | = 60 34 | ``` 35 | 36 | Success! 37 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/zcl_resistor_color.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | CLASS ltcl_test DEFINITION FOR TESTING 2 | DURATION SHORT 3 | RISK LEVEL HARMLESS FINAL. 4 | 5 | PRIVATE SECTION. 6 | DATA cut TYPE REF TO zcl_resistor_color. 7 | METHODS setup. 8 | METHODS test_black FOR TESTING. 9 | METHODS test_white FOR TESTING. 10 | METHODS test_orange FOR TESTING. 11 | 12 | ENDCLASS. 13 | 14 | 15 | CLASS ltcl_test IMPLEMENTATION. 16 | 17 | METHOD setup. 18 | cut = NEW #( ). 19 | ENDMETHOD. 20 | 21 | METHOD test_black. 22 | cl_abap_unit_assert=>assert_equals( 23 | act = cut->resistor_color( 'black' ) 24 | exp = 0 ). 25 | ENDMETHOD. 26 | 27 | METHOD test_white. 28 | cl_abap_unit_assert=>assert_equals( 29 | act = cut->resistor_color( 'white' ) 30 | exp = 9 ). 31 | ENDMETHOD. 32 | 33 | METHOD test_orange. 34 | cl_abap_unit_assert=>assert_equals( 35 | act = cut->resistor_color( 'orange' ) 36 | exp = 3 ). 37 | ENDMETHOD. 38 | 39 | ENDCLASS. 40 | -------------------------------------------------------------------------------- /exercises/practice/etl/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to change the data format of letters and their point values in the game. 4 | 5 | Currently, letters are stored in groups based on their score, in a one-to-many mapping. 6 | 7 | - 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T", 8 | - 2 points: "D", "G", 9 | - 3 points: "B", "C", "M", "P", 10 | - 4 points: "F", "H", "V", "W", "Y", 11 | - 5 points: "K", 12 | - 8 points: "J", "X", 13 | - 10 points: "Q", "Z", 14 | 15 | This needs to be changed to store each individual letter with its score in a one-to-one mapping. 16 | 17 | - "a" is worth 1 point. 18 | - "b" is worth 3 points. 19 | - "c" is worth 3 points. 20 | - "d" is worth 2 points. 21 | - etc. 22 | 23 | As part of this change, the team has also decided to change the letters to be lower-case rather than upper-case. 24 | 25 | ~~~~exercism/note 26 | If you want to look at how the data was previously structured and how it needs to change, take a look at the examples in the test suite. 27 | ~~~~ 28 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/zcl_difference_of_squares.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_difference_of_squares DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS: 8 | ret_difference_of_squares IMPORTING num TYPE i 9 | RETURNING VALUE(diff) TYPE i, 10 | ret_sum_of_squares IMPORTING num TYPE i 11 | RETURNING VALUE(sum_of_squares) TYPE i, 12 | ret_square_of_sum IMPORTING num TYPE i 13 | RETURNING VALUE(square_of_sum) TYPE i. 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS zcl_difference_of_squares IMPLEMENTATION. 21 | METHOD ret_difference_of_squares. 22 | "Implement solution 23 | ENDMETHOD. 24 | 25 | METHOD ret_sum_of_squares. 26 | "Implement solution 27 | ENDMETHOD. 28 | 29 | METHOD ret_square_of_sum. 30 | "Implement solution 31 | ENDMETHOD. 32 | ENDCLASS. 33 | -------------------------------------------------------------------------------- /exercises/practice/grains/.meta/zcl_grains.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_grains DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES type_result TYPE p LENGTH 16 DECIMALS 0. 8 | METHODS square 9 | IMPORTING 10 | input TYPE i 11 | RETURNING 12 | VALUE(result) TYPE type_result 13 | RAISING 14 | cx_parameter_invalid. 15 | METHODS total 16 | RETURNING 17 | VALUE(result) TYPE type_result 18 | RAISING 19 | cx_parameter_invalid. 20 | PROTECTED SECTION. 21 | PRIVATE SECTION. 22 | 23 | ENDCLASS. 24 | 25 | 26 | CLASS zcl_grains IMPLEMENTATION. 27 | METHOD square. 28 | IF input < 1 OR input > 64. 29 | RAISE EXCEPTION TYPE cx_parameter_invalid. 30 | ENDIF. 31 | result = 1. 32 | DO input - 1 TIMES. 33 | result = result * 2. 34 | ENDDO. 35 | ENDMETHOD. 36 | 37 | METHOD total. 38 | DO 64 TIMES. 39 | result = result + square( sy-index ). 40 | ENDDO. 41 | ENDMETHOD. 42 | 43 | 44 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/raindrops/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to convert a number into its corresponding raindrop sounds. 4 | 5 | If a given number: 6 | 7 | - is divisible by 3, add "Pling" to the result. 8 | - is divisible by 5, add "Plang" to the result. 9 | - is divisible by 7, add "Plong" to the result. 10 | - **is not** divisible by 3, 5, or 7, the result should be the number as a string. 11 | 12 | ## Examples 13 | 14 | - 28 is divisible by 7, but not 3 or 5, so the result would be `"Plong"`. 15 | - 30 is divisible by 3 and 5, but not 7, so the result would be `"PlingPlang"`. 16 | - 34 is not divisible by 3, 5, or 7, so the result would be `"34"`. 17 | 18 | ~~~~exercism/note 19 | A common way to test if one number is evenly divisible by another is to compare the [remainder][remainder] or [modulus][modulo] to zero. 20 | Most languages provide operators or functions for one (or both) of these. 21 | 22 | [remainder]: https://exercism.org/docs/programming/operators/remainder 23 | [modulo]: https://en.wikipedia.org/wiki/Modulo_operation 24 | ~~~~ 25 | -------------------------------------------------------------------------------- /docs/LEARNING.md: -------------------------------------------------------------------------------- 1 | # Recommended Learning Resources 2 | 3 | Exercism provides exercises and feedback but can be difficult to jump into for those learning ABAP for the first time. These free resources can help you get started: 4 | 5 | * SAP Learning Journey [Learning the Basics of ABAP Programming](https://learning.sap.com/learning-journeys/learn-the-basics-of-abap-programming-on-sap-btp) 6 | * [ABAP for Newbies Community](https://community.sap.com/topics/abap/abap-for-newbies) 7 | * [ABAP Language Documentation](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm) 8 | 9 | If you are new to ABAP, we recommend completing the following units of the SAP Learning Journey: 10 | 11 | - Getting Started 12 | - ABAP Language Basics 13 | - Local Classes 14 | 15 | After that, you will be ready to solve ABAP exercises on Exercism. 16 | 17 | If you get to more complex exercises, we suggest going through the following units as well: 18 | 19 | - Structures 20 | - Complex Internal Tables 21 | 22 | These topics might be helpful for solving more difficult exercises on Exercism. 23 | 24 | -------------------------------------------------------------------------------- /exercises/practice/isogram/.meta/zcl_isogram.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_isogram DEFINITION PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | METHODS is_isogram 5 | IMPORTING 6 | VALUE(phrase) TYPE string 7 | RETURNING 8 | VALUE(result) TYPE abap_bool. 9 | PROTECTED SECTION. 10 | PRIVATE SECTION. 11 | ENDCLASS. 12 | 13 | 14 | 15 | CLASS zcl_isogram IMPLEMENTATION. 16 | 17 | METHOD is_isogram. 18 | result = abap_true. 19 | 20 | phrase = to_upper( phrase ). 21 | 22 | DATA(offset) = 0. 23 | DATA letters TYPE STANDARD TABLE OF string. 24 | 25 | WHILE offset < strlen( phrase ). 26 | DATA(letter) = phrase+offset(1). 27 | IF letter NA sy-abcde. 28 | offset = offset + 1. 29 | CONTINUE. 30 | ENDIF. 31 | 32 | READ TABLE letters TRANSPORTING NO FIELDS WITH KEY table_line = letter. 33 | IF sy-subrc = 0. 34 | result = abap_false. 35 | RETURN. 36 | ENDIF. 37 | INSERT phrase+offset(1) INTO TABLE letters. 38 | offset = offset + 1. 39 | ENDWHILE. 40 | 41 | ENDMETHOD. 42 | 43 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/clock/.meta/zcl_clock.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_clock DEFINITION 2 | PUBLIC 3 | CREATE PUBLIC. 4 | 5 | PUBLIC SECTION. 6 | 7 | METHODS constructor 8 | IMPORTING 9 | !hours TYPE i 10 | !minutes TYPE i DEFAULT 0. 11 | METHODS get 12 | RETURNING 13 | VALUE(result) TYPE string. 14 | METHODS add 15 | IMPORTING 16 | !minutes TYPE i. 17 | METHODS sub 18 | IMPORTING 19 | !minutes TYPE i. 20 | 21 | PRIVATE SECTION. 22 | 23 | DATA clock TYPE t. 24 | 25 | ENDCLASS. 26 | 27 | 28 | 29 | CLASS zcl_clock IMPLEMENTATION. 30 | 31 | 32 | METHOD add. 33 | clock = clock + minutes * 60. 34 | ENDMETHOD. 35 | 36 | 37 | METHOD constructor. 38 | " Clock is number of seconds 39 | clock = hours * 60 * 60 + minutes * 60. 40 | ENDMETHOD. 41 | 42 | 43 | METHOD get. 44 | " hh:mm:ss 45 | result = |{ clock TIME = ISO }|. 46 | " return only hh:mm 47 | result = result(5). 48 | ENDMETHOD. 49 | 50 | 51 | METHOD sub. 52 | clock = clock - minutes * 60. 53 | ENDMETHOD. 54 | ENDCLASS. 55 | -------------------------------------------------------------------------------- /exercises/practice/two-fer/zcl_two_fer.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | CLASS ltcl_two_fer DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. 2 | 3 | PRIVATE SECTION. 4 | DATA cut TYPE REF TO zcl_two_fer. 5 | METHODS setup. 6 | METHODS test_empty FOR TESTING RAISING cx_static_check. 7 | METHODS test_alice FOR TESTING RAISING cx_static_check. 8 | METHODS test_bob FOR TESTING RAISING cx_static_check. 9 | 10 | ENDCLASS. 11 | 12 | CLASS ltcl_two_fer IMPLEMENTATION. 13 | 14 | METHOD setup. 15 | cut = NEW zcl_two_fer( ). 16 | ENDMETHOD. 17 | 18 | METHOD test_empty. 19 | cl_abap_unit_assert=>assert_equals( 20 | act = cut->two_fer( ) 21 | exp = 'One for you, one for me.' ). 22 | ENDMETHOD. 23 | 24 | METHOD test_alice. 25 | cl_abap_unit_assert=>assert_equals( 26 | act = cut->two_fer( 'Alice' ) 27 | exp = 'One for Alice, one for me.' ). 28 | ENDMETHOD. 29 | 30 | METHOD test_bob. 31 | cl_abap_unit_assert=>assert_equals( 32 | act = cut->two_fer( 'Bob' ) 33 | exp = 'One for Bob, one for me.' ). 34 | ENDMETHOD. 35 | 36 | ENDCLASS. 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Exercism 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/RESOURCES.md: -------------------------------------------------------------------------------- 1 | # Resources 2 | 3 | ## Reference 4 | 5 | * [ABAP Language Documentation](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm) 6 | * [Clean ABAP Guidelines](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) and [cheat-sheet](https://github.com/SAP/styleguides/blob/main/clean-abap/cheat-sheet/CheatSheet.md) 7 | 8 | ## Learning 9 | 10 | * SAP Learning Journey: [Get Started with ABAP Programming](https://learning.sap.com/learning-journey/get-started-with-abap-programming-on-sap-btp) (free) 11 | 12 | ## Tutorials 13 | 14 | * [ABAP Platform for Developers](https://developers.sap.com/topics/abap-platform.html) (free) 15 | 16 | ## Training 17 | 18 | * Free online classes at [openSAP](https://open.sap.com/courses?q=abap) in particular [Writing Testable Code in ABAP](https://open.sap.com/courses/wtc1) (free) 19 | * [SAP Learning Journey and Certification](https://training.sap.com/trainingpath/Database+&+Technology-Development-ABAP+Core) (paid) 20 | * [ABAP Academy](https://abapacademy.com/) (paid) 21 | 22 | ## Open Source ABAP 23 | 24 | * [abapGit](https://abapgit.org) 25 | * [dotabap.org](https://dotabap.org) 26 | -------------------------------------------------------------------------------- /exercises/practice/difference-of-squares/.meta/zcl_difference_of_squares.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_difference_of_squares DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS: 8 | ret_difference_of_squares IMPORTING num TYPE i 9 | RETURNING VALUE(diff) TYPE i, 10 | ret_sum_of_squares IMPORTING num TYPE i 11 | RETURNING VALUE(sum_of_squares) TYPE i, 12 | ret_square_of_sum IMPORTING num TYPE i 13 | RETURNING VALUE(square_of_sum) TYPE i. 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS zcl_difference_of_squares IMPLEMENTATION. 21 | METHOD ret_difference_of_squares. 22 | diff = abs( ret_sum_of_squares( num ) - ret_square_of_sum( num ) ). 23 | ENDMETHOD. 24 | 25 | METHOD ret_sum_of_squares. 26 | sum_of_squares = num * ( num + 1 ) * ( 2 * num + 1 ) / 6. 27 | ENDMETHOD. 28 | 29 | METHOD ret_square_of_sum. 30 | DATA(sum) = num * ( num + 1 ) / 2. 31 | square_of_sum = ipow( base = sum 32 | exp = 2 ). 33 | ENDMETHOD. 34 | 35 | ENDCLASS. 36 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/zcl_lasagne.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_lasagne DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | CONSTANTS expected_minutes_in_oven TYPE i VALUE 20. 9 | CONSTANTS preparation_minutes_per_layer TYPE i VALUE 1. 10 | 11 | METHODS remaining_minutes_in_oven 12 | IMPORTING 13 | !actual_minutes_in_oven TYPE i 14 | RETURNING 15 | VALUE(result) TYPE i . 16 | METHODS preparation_time_in_minutes 17 | IMPORTING 18 | !number_of_layers TYPE i 19 | RETURNING 20 | VALUE(result) TYPE i . 21 | METHODS total_time_in_minutes 22 | IMPORTING 23 | !number_of_layers TYPE i 24 | !actual_minutes_in_oven TYPE i 25 | RETURNING 26 | VALUE(result) TYPE i . 27 | PROTECTED SECTION. 28 | PRIVATE SECTION. 29 | ENDCLASS. 30 | 31 | 32 | 33 | CLASS zcl_lasagne IMPLEMENTATION. 34 | 35 | METHOD remaining_minutes_in_oven. 36 | "Implement solution here 37 | ENDMETHOD. 38 | 39 | METHOD preparation_time_in_minutes. 40 | "Implement solution here 41 | ENDMETHOD. 42 | 43 | METHOD total_time_in_minutes. 44 | "Implement solution here 45 | ENDMETHOD. 46 | ENDCLASS. 47 | -------------------------------------------------------------------------------- /docs/ABOUT.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | ABAP is a high level programming language created by [SAP SE](https://www.sap.com/). 4 | 5 | The ABAP language goes back to the 1980s and new features are still being added in new releases. 6 | 7 | ABAP technology is the solid longtime foundation for SAP’s solution portfolio. Its proven robustness, scalability and extensibility makes it the platform of choice for running mission-critical business processes. 8 | 9 | ## Why Learn ABAP? 10 | 11 | ABAP runs productively in more than 100,000 SAP customer systems, where it enables enterprise-ready business applications and processes, and reduces total cost of development due to its integrated, self-compiling nature. 12 | 13 | ABAP Platform 14 | 15 | * 5,000 productive SAP Business Suite systems 16 | * 64,000 standalone systems 17 | * 4.5 million registered ABAP developers 18 | 19 | In short, it's a big market and there's demand for more people who can develop in ABAP. 20 | 21 | ## How to Learn ABAP using Exercism? 22 | 23 | You can find details on how to learn ABAP, install it locally, and test your ABAP skills in the [track-specific documentation](https://exercism.org/docs/tracks/abap). 24 | 25 | ## Background Information 26 | 27 | [WikiPedia](https://en.wikipedia.org/wiki/ABAP) 28 | 29 | 30 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/zcl_high_scores.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_high_scores DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | METHODS constructor 9 | IMPORTING 10 | scores TYPE integertab. 11 | 12 | METHODS list_scores 13 | RETURNING 14 | VALUE(result) TYPE integertab. 15 | 16 | METHODS latest 17 | RETURNING 18 | VALUE(result) TYPE i. 19 | 20 | METHODS personalbest 21 | RETURNING 22 | VALUE(result) TYPE i. 23 | 24 | METHODS personaltopthree 25 | RETURNING 26 | VALUE(result) TYPE integertab. 27 | PROTECTED SECTION. 28 | PRIVATE SECTION. 29 | DATA scores_list TYPE integertab. 30 | 31 | ENDCLASS. 32 | 33 | 34 | CLASS zcl_high_scores IMPLEMENTATION. 35 | 36 | METHOD constructor. 37 | me->scores_list = scores. 38 | ENDMETHOD. 39 | 40 | METHOD list_scores. 41 | " add solution here 42 | ENDMETHOD. 43 | 44 | METHOD latest. 45 | " add solution here 46 | ENDMETHOD. 47 | 48 | METHOD personalbest. 49 | " add solution here 50 | ENDMETHOD. 51 | 52 | METHOD personaltopthree. 53 | " add solution here 54 | ENDMETHOD. 55 | 56 | 57 | ENDCLASS. 58 | -------------------------------------------------------------------------------- /exercises/practice/itab-aggregation/zcl_itab_aggregation.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_itab_aggregation DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES group TYPE c LENGTH 1. 8 | TYPES: BEGIN OF initial_numbers_type, 9 | group TYPE group, 10 | number TYPE i, 11 | END OF initial_numbers_type, 12 | initial_numbers TYPE STANDARD TABLE OF initial_numbers_type WITH EMPTY KEY. 13 | 14 | TYPES: BEGIN OF aggregated_data_type, 15 | group TYPE group, 16 | count TYPE i, 17 | sum TYPE i, 18 | min TYPE i, 19 | max TYPE i, 20 | average TYPE f, 21 | END OF aggregated_data_type, 22 | aggregated_data TYPE STANDARD TABLE OF aggregated_data_type WITH EMPTY KEY. 23 | 24 | METHODS perform_aggregation 25 | IMPORTING 26 | initial_numbers TYPE initial_numbers 27 | RETURNING 28 | VALUE(aggregated_data) TYPE aggregated_data. 29 | PROTECTED SECTION. 30 | PRIVATE SECTION. 31 | 32 | ENDCLASS. 33 | 34 | 35 | 36 | CLASS zcl_itab_aggregation IMPLEMENTATION. 37 | METHOD perform_aggregation. 38 | " add solution here 39 | ENDMETHOD. 40 | 41 | ENDCLASS. 42 | -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.meta/zcl_secret_handshake.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_secret_handshake DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS get_commands 8 | IMPORTING code TYPE i 9 | RETURNING VALUE(commands) TYPE string_table. 10 | PROTECTED SECTION. 11 | PRIVATE SECTION. 12 | ENDCLASS. 13 | 14 | 15 | 16 | CLASS zcl_secret_handshake IMPLEMENTATION. 17 | 18 | METHOD get_commands. 19 | 20 | DATA binary_zero TYPE x VALUE 0. 21 | DATA(binary_code) = CONV xstring( code ). 22 | 23 | DATA(codes_transl) = VALUE string_table( ( `wink` ) ( `double blink` ) ( `close your eyes` ) ( `jump` ) ). 24 | 25 | LOOP AT codes_transl REFERENCE INTO DATA(command). 26 | IF CONV xstring( 2 ** ( sy-tabix - 1 ) ) BIT-AND binary_code > binary_zero. 27 | APPEND command->* TO commands. 28 | ENDIF. 29 | ENDLOOP. 30 | 31 | IF binary_code BIT-AND CONV xstring( 16 ) > binary_zero. 32 | DATA(reversed_commands) = VALUE string_table( FOR line IN commands 33 | INDEX INTO i 34 | ( commands[ lines( commands ) - i + 1 ] ) ). 35 | commands = reversed_commands. 36 | ENDIF. 37 | 38 | ENDMETHOD. 39 | 40 | ENDCLASS. 41 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Create an implementation of the Atbash cipher, an ancient encryption system created in the Middle East. 4 | 5 | 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. 6 | The first letter is replaced with the last letter, the second with the second-last, and so on. 7 | 8 | An Atbash cipher for the Latin alphabet would be as follows: 9 | 10 | ```text 11 | Plain: abcdefghijklmnopqrstuvwxyz 12 | Cipher: zyxwvutsrqponmlkjihgfedcba 13 | ``` 14 | 15 | It is a very weak cipher because it only has one possible key, and it is a simple mono-alphabetic substitution cipher. 16 | However, this may not have been an issue in the cipher's time. 17 | 18 | Ciphertext is written out in groups of fixed length, the traditional group size being 5 letters, leaving numbers unchanged, and punctuation is excluded. 19 | This is to make it harder to guess things based on word boundaries. 20 | All text will be encoded as lowercase letters. 21 | 22 | ## Examples 23 | 24 | - Encoding `test` gives `gvhg` 25 | - Encoding `x123 yes` gives `c123b vh` 26 | - Decoding `gvhg` gives `test` 27 | - Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog` 28 | -------------------------------------------------------------------------------- /exercises/practice/state-of-tic-tac-toe/zcl_state_of_tic_tac_toe.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_state_of_tic_tac_toe DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | 8 | TYPES player_type TYPE c LENGTH 1. 9 | "! E.g., ( ( `XOO` ) ( ` X ` ) ( ` X` ) ) 10 | TYPES board_type TYPE TABLE OF string INITIAL SIZE 3. 11 | 12 | CONSTANTS: BEGIN OF player_enum, 13 | one TYPE player_type VALUE 'X', 14 | two TYPE player_type VALUE 'O', 15 | END OF player_enum. 16 | 17 | CONSTANTS: BEGIN OF state_enum, 18 | ongoing_game TYPE string VALUE `Ongoing game`, 19 | draw TYPE string VALUE `Draw`, 20 | win TYPE string VALUE `Win`, 21 | END OF state_enum. 22 | 23 | "! @parameter state | Possible values are enumerated in state_enum 24 | "! @raising cx_parameter_invalid | Board is invalid 25 | METHODS get_state 26 | IMPORTING board TYPE board_type 27 | RETURNING VALUE(state) TYPE string 28 | RAISING cx_parameter_invalid. 29 | 30 | PROTECTED SECTION. 31 | PRIVATE SECTION. 32 | ENDCLASS. 33 | 34 | 35 | 36 | CLASS zcl_state_of_tic_tac_toe IMPLEMENTATION. 37 | 38 | METHOD get_state. 39 | " add solution here 40 | ENDMETHOD. 41 | 42 | ENDCLASS. 43 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/.meta/zcl_lasagne.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_lasagne DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | CONSTANTS expected_minutes_in_oven TYPE i VALUE 40 . 9 | CONSTANTS preparation_minutes_per_layer TYPE i VALUE 2 . 10 | 11 | METHODS remaining_minutes_in_oven 12 | IMPORTING 13 | !actual_minutes_in_oven TYPE i 14 | RETURNING 15 | VALUE(result) TYPE i . 16 | METHODS preparation_time_in_minutes 17 | IMPORTING 18 | !number_of_layers TYPE i 19 | RETURNING 20 | VALUE(result) TYPE i . 21 | METHODS total_time_in_minutes 22 | IMPORTING 23 | !number_of_layers TYPE i 24 | !actual_minutes_in_oven TYPE i 25 | RETURNING 26 | VALUE(result) TYPE i . 27 | PROTECTED SECTION. 28 | PRIVATE SECTION. 29 | ENDCLASS. 30 | 31 | 32 | 33 | CLASS zcl_lasagne IMPLEMENTATION. 34 | 35 | METHOD remaining_minutes_in_oven. 36 | result = expected_minutes_in_oven - actual_minutes_in_oven. 37 | ENDMETHOD. 38 | 39 | METHOD preparation_time_in_minutes. 40 | result = number_of_layers * preparation_minutes_per_layer. 41 | ENDMETHOD. 42 | 43 | METHOD total_time_in_minutes. 44 | result = preparation_time_in_minutes( number_of_layers ) + actual_minutes_in_oven. 45 | ENDMETHOD. 46 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/triangle/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Determine if a triangle is equilateral, isosceles, or scalene. 4 | 5 | An _equilateral_ triangle has all three sides the same length. 6 | 7 | An _isosceles_ triangle has at least two sides the same length. 8 | (It is sometimes specified as having exactly two sides the same length, but for the purposes of this exercise we'll say at least two.) 9 | 10 | A _scalene_ triangle has all sides of different lengths. 11 | 12 | ## Note 13 | 14 | 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. 15 | 16 | ~~~~exercism/note 17 | _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`. 18 | We opted to not include tests for degenerate triangles in this exercise. 19 | You may handle those situations if you wish to do so, or safely ignore them. 20 | ~~~~ 21 | 22 | In equations: 23 | 24 | Let `a`, `b`, and `c` be sides of the triangle. 25 | Then all three of the following expressions must be true: 26 | 27 | ```text 28 | a + b ≥ c 29 | b + c ≥ a 30 | a + c ≥ b 31 | ``` 32 | 33 | See [Triangle Inequality][triangle-inequality] 34 | 35 | [triangle-inequality]: https://en.wikipedia.org/wiki/Triangle_inequality 36 | -------------------------------------------------------------------------------- /exercises/practice/itab-combination/zcl_itab_combination.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_itab_combination DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | TYPES: BEGIN OF alphatab_type, 9 | cola TYPE string, 10 | colb TYPE string, 11 | colc TYPE string, 12 | END OF alphatab_type. 13 | TYPES alphas TYPE STANDARD TABLE OF alphatab_type. 14 | 15 | TYPES: BEGIN OF numtab_type, 16 | col1 TYPE string, 17 | col2 TYPE string, 18 | col3 TYPE string, 19 | END OF numtab_type. 20 | TYPES nums TYPE STANDARD TABLE OF numtab_type. 21 | 22 | TYPES: BEGIN OF combined_data_type, 23 | colx TYPE string, 24 | coly TYPE string, 25 | colz TYPE string, 26 | END OF combined_data_type. 27 | TYPES combined_data TYPE STANDARD TABLE OF combined_data_type WITH EMPTY KEY. 28 | 29 | METHODS perform_combination 30 | IMPORTING 31 | alphas TYPE alphas 32 | nums TYPE nums 33 | RETURNING 34 | VALUE(combined_data) TYPE combined_data. 35 | 36 | PROTECTED SECTION. 37 | PRIVATE SECTION. 38 | 39 | 40 | ENDCLASS. 41 | 42 | CLASS zcl_itab_combination IMPLEMENTATION. 43 | 44 | METHOD perform_combination. 45 | 46 | ENDMETHOD. 47 | 48 | ENDCLASS. 49 | -------------------------------------------------------------------------------- /docs/INSTALLATION.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Exercism let's you program and test your ABAP code directly in your browser. No additional installation is required. However, if you prefer to code and test on your own system, you can get an ABAP trial system. 4 | 5 | Of course, your employer might be running SAP. Please check with your IT department if and how you can get access to an ABAP development sandbox. 6 | 7 | ## Which version to choose? 8 | 9 | We encourage to use a current release of the ABAP platform with active support. Currently this is **ABAP 7.5 and higher**. Details on current releases and their timelines can be found at [ABAP Development Center](https://developers.sap.com/topics/abap-platform.html). 10 | 11 | ## What to install? 12 | 13 | We recommend using the most recent [ABAP Cloud Developer Trial](https://hub.docker.com/r/sapse/abap-cloud-developer-trial). It's based on ABAP 7.58. You can install the SAP ABAP system as a Docker image or hosted in the SAP Cloud Appliance Library. In addition, you need to install SAP GUI either for Windows or for Java depending on your local operating system. You can download SAP GUI from [here](https://www.sap.com/products/try-sap/trials-downloads.html?search=sap+gui). 14 | 15 | For more details, see this [SAP Community](https://community.sap.com/t5/technology-blog-posts-by-sap/abap-cloud-developer-trial-2023-available-now/ba-p/14057183) blog. 16 | -------------------------------------------------------------------------------- /docs/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": [ 3 | { 4 | "uuid": "21b340f7-5709-4bfb-9e6f-b70e452c0d76", 5 | "slug": "installation", 6 | "path": "docs/INSTALLATION.md", 7 | "title": "Installing ABAP locally", 8 | "blurb": "Learn how to install ABAP locally to solve Exercism's exercises on your own machine" 9 | }, 10 | { 11 | "uuid": "21a13a0d-687b-40d2-933e-d510241e10d8", 12 | "slug": "learning", 13 | "path": "docs/LEARNING.md", 14 | "title": "How to learn ABAP", 15 | "blurb": "An overview of how to get started from scratch with ABAP" 16 | }, 17 | { 18 | "uuid": "e7aa0a32-7ee1-4a39-8f48-8f895ba2a4e9", 19 | "slug": "tests", 20 | "path": "docs/TESTS.md", 21 | "title": "Testing on the ABAP track", 22 | "blurb": "Learn how to test your ABAP exercises on Exercism" 23 | }, 24 | { 25 | "uuid": "28d04b1a-195d-4633-9fb4-042f703a7d37", 26 | "slug": "clone", 27 | "path": "docs/CLONE.md", 28 | "title": "Clone the ABAP track", 29 | "blurb": "Instructions on how to clone the ABAP track to your own system" 30 | }, 31 | { 32 | "uuid": "81756fdb-cbf1-4dd2-966f-59b820c447af", 33 | "slug": "resources", 34 | "path": "docs/RESOURCES.md", 35 | "title": "Useful ABAP resources", 36 | "blurb": "A collection of useful resources to help you master ABAP" 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /exercises/practice/anagram/.meta/zcl_anagram.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_anagram DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS anagram 8 | IMPORTING 9 | input TYPE string 10 | candidates TYPE string_table 11 | RETURNING 12 | VALUE(result) TYPE string_table. 13 | METHODS sort_string 14 | IMPORTING 15 | input TYPE string 16 | RETURNING 17 | VALUE(result) TYPE string. 18 | PROTECTED SECTION. 19 | PRIVATE SECTION. 20 | ENDCLASS. 21 | 22 | 23 | 24 | CLASS zcl_anagram IMPLEMENTATION. 25 | METHOD anagram. 26 | LOOP AT candidates ASSIGNING FIELD-SYMBOL(). 27 | IF sort_string( input ) = sort_string( ) AND to_lower( input ) <> to_lower( ). 28 | APPEND TO result. 29 | ENDIF. 30 | ENDLOOP. 31 | 32 | ENDMETHOD. 33 | 34 | METHOD sort_string. 35 | DATA input_letters TYPE string_table. 36 | DATA(input_lower) = to_lower( input ). 37 | DATA(do_count) = strlen( input_lower ). 38 | DO do_count TIMES. 39 | DATA(index) = sy-index - 1. 40 | APPEND input_lower+index(1) TO input_letters. 41 | ENDDO. 42 | SORT input_letters. 43 | LOOP AT input_letters ASSIGNING FIELD-SYMBOL(). 44 | result = |{ result }{ }|. 45 | ENDLOOP. 46 | 47 | ENDMETHOD. 48 | 49 | 50 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/phone-number/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Clean up phone numbers so that they can be sent SMS messages. 4 | 5 | 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. 6 | All NANP-countries share the same international country code: `1`. 7 | 8 | NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as _area code_, followed by a seven-digit local number. 9 | The first three digits of the local number represent the _exchange code_, followed by the unique four-digit number which is the _subscriber number_. 10 | 11 | The format is usually represented as 12 | 13 | ```text 14 | NXX NXX-XXXX 15 | ``` 16 | 17 | where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9. 18 | 19 | Sometimes they also have the country code (represented as `1` or `+1`) prefixed. 20 | 21 | Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code if present. 22 | 23 | For example, the inputs 24 | 25 | - `+1 (613)-995-0253` 26 | - `613-995-0253` 27 | - `1 613 995 0253` 28 | - `613.995.0253` 29 | 30 | should all produce the output 31 | 32 | `6139950253` 33 | 34 | **Note:** As this exercise only deals with telephone numbers used in NANP-countries, only 1 is considered a valid country code. 35 | -------------------------------------------------------------------------------- /exercises/practice/triangle/zcl_triangle.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_triangle DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC. 5 | 6 | PUBLIC SECTION. 7 | METHODS: 8 | is_equilateral 9 | IMPORTING 10 | side_a TYPE f 11 | side_b TYPE f 12 | side_c TYPE f 13 | RETURNING 14 | VALUE(result) TYPE abap_bool 15 | RAISING 16 | cx_parameter_invalid, 17 | is_isosceles 18 | IMPORTING 19 | side_a TYPE f 20 | side_b TYPE f 21 | side_c TYPE f 22 | RETURNING 23 | VALUE(result) TYPE abap_bool 24 | RAISING 25 | cx_parameter_invalid, 26 | is_scalene 27 | IMPORTING 28 | side_a TYPE f 29 | side_b TYPE f 30 | side_c TYPE f 31 | RETURNING 32 | VALUE(result) TYPE abap_bool 33 | RAISING 34 | cx_parameter_invalid. 35 | 36 | PROTECTED SECTION. 37 | PRIVATE SECTION. 38 | 39 | ENDCLASS. 40 | 41 | 42 | CLASS zcl_triangle IMPLEMENTATION. 43 | 44 | METHOD is_equilateral. 45 | "Implement solution 46 | ENDMETHOD. 47 | 48 | METHOD is_isosceles. 49 | "Implement solution 50 | ENDMETHOD. 51 | 52 | METHOD is_scalene. 53 | "Implement solution 54 | ENDMETHOD. 55 | 56 | ENDCLASS. 57 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean install of the dependencies and run tests across different versions 2 | # 3 | # Replace with the track name 4 | # Replace with an image to run the jobs on 5 | # Replace with a github action to setup tooling on the image 6 | # Replace with a cli command to install the dependencies 7 | # 8 | # Find Github Actions to setup tooling here: 9 | # - https://github.com/actions/?q=setup&type=&language= 10 | # - https://github.com/actions/starter-workflows/tree/main/ci 11 | # - https://github.com/marketplace?type=actions&query=setup 12 | # 13 | # Requires scripts: 14 | # - bin/test 15 | 16 | name: test 17 | 18 | on: 19 | push: 20 | branches: [main] 21 | pull_request: 22 | workflow_dispatch: 23 | 24 | jobs: 25 | ci: 26 | runs-on: ubuntu-24.04 27 | 28 | steps: 29 | - name: Checkout code 30 | uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 31 | - name: Use Node.js LTS (16.x) 32 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 33 | with: 34 | node-version: '16' 35 | - run: npm install @abaplint/cli -g 36 | - run: abaplint abaplint.json 37 | - run: abaplint abaplint_solutions.json 38 | - run: docker pull exercism/abap-test-runner 39 | - name: Run tests for all exercises 40 | run: sh ./bin/test 41 | -------------------------------------------------------------------------------- /exercises/practice/collatz-conjecture/.docs/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | One evening, you stumbled upon an old notebook filled with cryptic scribbles, as though someone had been obsessively chasing an idea. 4 | On one page, a single question stood out: **Can every number find its way to 1?** 5 | It was tied to something called the **Collatz Conjecture**, a puzzle that has baffled thinkers for decades. 6 | 7 | The rules were deceptively simple. 8 | Pick any positive integer. 9 | 10 | - If it's even, divide it by 2. 11 | - If it's odd, multiply it by 3 and add 1. 12 | 13 | Then, repeat these steps with the result, continuing indefinitely. 14 | 15 | Curious, you picked number 12 to test and began the journey: 16 | 17 | 12 ➜ 6 ➜ 3 ➜ 10 ➜ 5 ➜ 16 ➜ 8 ➜ 4 ➜ 2 ➜ 1 18 | 19 | Counting from the second number (6), it took 9 steps to reach 1, and each time the rules repeated, the number kept changing. 20 | At first, the sequence seemed unpredictable — jumping up, down, and all over. 21 | Yet, the conjecture claims that no matter the starting number, we'll always end at 1. 22 | 23 | It was fascinating, but also puzzling. 24 | Why does this always seem to work? 25 | Could there be a number where the process breaks down, looping forever or escaping into infinity? 26 | 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. 27 | 28 | [collatz-prize]: https://mathprize.net/posts/collatz-conjecture/ 29 | -------------------------------------------------------------------------------- /exercises/practice/nth-prime/.meta/zcl_nth_prime.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_nth_prime DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | METHODS prime 8 | IMPORTING 9 | input TYPE i 10 | RETURNING 11 | VALUE(result) TYPE i 12 | RAISING 13 | cx_parameter_invalid. 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | 17 | ENDCLASS. 18 | 19 | 20 | CLASS zcl_nth_prime IMPLEMENTATION. 21 | METHOD prime. 22 | IF input = 0. 23 | RAISE EXCEPTION TYPE cx_parameter_invalid. 24 | ENDIF. 25 | DATA int_list TYPE STANDARD TABLE OF i WITH EMPTY KEY. 26 | DATA int_list_result TYPE STANDARD TABLE OF i WITH EMPTY KEY. 27 | DATA max TYPE int8. 28 | DATA prime_number TYPE int8. 29 | DATA(times) = input * input. 30 | IF times <= 1. 31 | times = 2. 32 | ENDIF. 33 | DO times TIMES. 34 | APPEND sy-tabix + 1 TO int_list. 35 | ENDDO. 36 | DELETE int_list INDEX 1. 37 | int_list_result = int_list. 38 | prime_number = 2. 39 | max = input * input. 40 | WHILE prime_number * prime_number < max. 41 | LOOP AT int_list ASSIGNING FIELD-SYMBOL(). 42 | IF MOD prime_number = 0 AND <> prime_number. 43 | DELETE int_list_result WHERE table_line = . 44 | ENDIF. 45 | ENDLOOP. 46 | prime_number = prime_number + 1. 47 | ENDWHILE. 48 | result = int_list_result[ input ]. 49 | ENDMETHOD. 50 | 51 | 52 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/itab-basics/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Learn the basics about ABAP internal tables. 4 | 5 | Your class has an internal table named `initial_data`. It has three columns: `GROUP`, `NUMBER`, and `DESCRIPTION`. 6 | 7 | ```abap 8 | TYPES group TYPE c LENGTH 1. 9 | TYPES: BEGIN OF initial_type, 10 | group TYPE group, 11 | number TYPE i, 12 | description TYPE string, 13 | END OF initial_type, 14 | initial_data TYPE STANDARD TABLE OF initial_type WITH EMPTY KEY. 15 | ``` 16 | 17 | ## Step 1 18 | 19 | Your first task is to complete the method `fill_itab` and place 6 records into this table with the following values: 20 | 21 | | GROUP | NUMBER | DESCRIPTION | 22 | | --- | ----------- | ----------- | 23 | | A | 10 | Group A-2 | 24 | | B | 5 | Group B | 25 | | A | 6 | Group A-1 | 26 | | C | 22 | Group C-1 | 27 | | A | 13 | Group A-3 | 28 | | C | 500 | Group C-2 | 29 | 30 | ## Step 2 31 | 32 | Next implement the method `add_to_itab` to add a record to the end of the internal table with following value: 33 | 34 | | GROUP | NUMBER | DESCRIPTION | 35 | | --- | ----------- | ----------- | 36 | | A | 19 | Group A-4 | 37 | 38 | ## Step 3 39 | 40 | Now please sort the internal table in the method `sort_itab` with the `GROUP` column in alphabetical order and the `NUMBER` column in descending order. 41 | 42 | ## Step 4 43 | 44 | In the method `search_itab`, search the sorted table and return the index of the record that has a `NUMBER` column value of 6. 45 | -------------------------------------------------------------------------------- /exercises/practice/run-length-encoding/.meta/zcl_rle.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_rle DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | 8 | METHODS encode IMPORTING input TYPE string 9 | RETURNING VALUE(result) TYPE string. 10 | 11 | METHODS decode IMPORTING input TYPE string 12 | RETURNING VALUE(result) TYPE string. 13 | 14 | ENDCLASS. 15 | 16 | 17 | CLASS zcl_rle IMPLEMENTATION. 18 | 19 | METHOD encode. 20 | 21 | DATA: character TYPE string, 22 | duplicates TYPE string. 23 | 24 | DATA(str) = input. 25 | 26 | WHILE str IS NOT INITIAL. 27 | 28 | FIND REGEX '([\w|\s])(\1*)(.*)' IN str SUBMATCHES character duplicates str ##SUBRC_OK. 29 | 30 | IF duplicates IS NOT INITIAL. 31 | result = |{ result }{ strlen( duplicates ) + 1 }{ character }|. 32 | ELSE. 33 | result = |{ result }{ character }|. 34 | ENDIF. 35 | 36 | ENDWHILE. 37 | 38 | ENDMETHOD. 39 | 40 | 41 | METHOD decode. 42 | 43 | DATA: character TYPE string, 44 | reps TYPE string. 45 | 46 | DATA(str) = input. 47 | 48 | WHILE str IS NOT INITIAL. 49 | 50 | FIND REGEX '(\d*)([\w|\s])(.*)' IN str SUBMATCHES reps character str ##SUBRC_OK. 51 | 52 | IF reps IS NOT INITIAL. 53 | result = |{ result }{ repeat( val = character occ = reps ) }|. 54 | ELSE. 55 | result = |{ result }{ character }|. 56 | ENDIF. 57 | 58 | ENDWHILE. 59 | 60 | ENDMETHOD. 61 | 62 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/secret-handshake/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to convert a number between 1 and 31 to a sequence of actions in the secret handshake. 4 | 5 | The sequence of actions is chosen by looking at the rightmost five digits of the number once it's been converted to binary. 6 | Start at the right-most digit and move left. 7 | 8 | The actions for each number place are: 9 | 10 | ```plaintext 11 | 00001 = wink 12 | 00010 = double blink 13 | 00100 = close your eyes 14 | 01000 = jump 15 | 10000 = Reverse the order of the operations in the secret handshake. 16 | ``` 17 | 18 | Let's use the number `9` as an example: 19 | 20 | - 9 in binary is `1001`. 21 | - The digit that is farthest to the right is 1, so the first action is `wink`. 22 | - Going left, the next digit is 0, so there is no double-blink. 23 | - Going left again, the next digit is 0, so you leave your eyes open. 24 | - Going left again, the next digit is 1, so you jump. 25 | 26 | That was the last digit, so the final code is: 27 | 28 | ```plaintext 29 | wink, jump 30 | ``` 31 | 32 | Given the number 26, which is `11010` in binary, we get the following actions: 33 | 34 | - double blink 35 | - jump 36 | - reverse actions 37 | 38 | The secret handshake for 26 is therefore: 39 | 40 | ```plaintext 41 | jump, double blink 42 | ``` 43 | 44 | ~~~~exercism/note 45 | If you aren't sure what binary is or how it works, check out [this binary tutorial][intro-to-binary]. 46 | 47 | [intro-to-binary]: https://medium.com/basecs/bits-bytes-building-with-binary-13cb4289aafa 48 | ~~~~ 49 | -------------------------------------------------------------------------------- /exercises/practice/resistor-color/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | If you want to build something using a Raspberry Pi, you'll probably use _resistors_. 4 | For this exercise, you need to know two things about them: 5 | 6 | - Each resistor has a resistance value. 7 | - Resistors are small - so small in fact that if you printed the resistance value on them, it would be hard to read. 8 | 9 | To get around this problem, manufacturers print color-coded bands onto the resistors to denote their resistance values. 10 | Each band has a position and a numeric value. 11 | 12 | The first 2 bands of a resistor have a simple encoding scheme: each color maps to a single number. 13 | 14 | In this exercise you are going to create a helpful program so that you don't have to remember the values of the bands. 15 | 16 | These colors are encoded as follows: 17 | 18 | - black: 0 19 | - brown: 1 20 | - red: 2 21 | - orange: 3 22 | - yellow: 4 23 | - green: 5 24 | - blue: 6 25 | - violet: 7 26 | - grey: 8 27 | - white: 9 28 | 29 | The goal of this exercise is to create a way: 30 | 31 | - to look up the numerical value associated with a particular color band 32 | - to list the different band colors 33 | 34 | Mnemonics map the colors to the numbers, that, when stored as an array, happen to map to their index in the array: 35 | Better Be Right Or Your Great Big Values Go Wrong. 36 | 37 | More information on the color encoding of resistors can be found in the [Electronic color code Wikipedia article][e-color-code]. 38 | 39 | [e-color-code]: https://en.wikipedia.org/wiki/Electronic_color_code 40 | -------------------------------------------------------------------------------- /exercises/concept/lasagna/.docs/hints.md: -------------------------------------------------------------------------------- 1 | # Hints 2 | 3 | ## 1. Define the expected oven time in minutes 4 | 5 | - Define a [constant][constants] which should contain the [`number`][numbers] value specified in the recipe. 6 | 7 | ## 2. Calculate the remaining oven time in minutes 8 | 9 | - [Return a number][return] from the method by setting its value. 10 | - Use the [mathematical operator for subtraction][operators] to subtract values. 11 | 12 | ## 3. Calculate the preparation time in minutes 13 | 14 | - [Return a number][return] from the method by setting its value. 15 | - Use the [mathematical operator for multiplication][operators] to multiply values. 16 | - Use the extra constant for the time in minutes per layer. 17 | 18 | ## 4. Calculate the total working time in minutes 19 | 20 | - [Return a number][return] from the method by setting its value. 21 | - [Invoke][invocation] one of the other methods implemented previously. 22 | - Use the [mathematical operator for addition][operators] to add values. 23 | 24 | [return]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapmethods_functional.htm 25 | [operators]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapcompute_arith.htm 26 | [constants]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapconstants.htm 27 | [invocation]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapcall_method_meth_ident_stat.htm 28 | [numbers]: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abennumber_types.htm -------------------------------------------------------------------------------- /exercises/practice/word-count/.docs/instructions.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | Your task is to count how many times each word occurs in a subtitle of a drama. 4 | 5 | The subtitles from these dramas use only ASCII characters. 6 | 7 | The characters often speak in casual English, using contractions like _they're_ or _it's_. 8 | Though these contractions come from two words (e.g. _we are_), the contraction (_we're_) is considered a single word. 9 | 10 | Words can be separated by any form of punctuation (e.g. ":", "!", or "?") or whitespace (e.g. "\t", "\n", or " "). 11 | The only punctuation that does not separate words is the apostrophe in contractions. 12 | 13 | Numbers are considered words. 14 | If the subtitles say _It costs 100 dollars._ then _100_ will be its own word. 15 | 16 | Words are case insensitive. 17 | For example, the word _you_ occurs three times in the following sentence: 18 | 19 | > You come back, you hear me? DO YOU HEAR ME? 20 | 21 | The ordering of the word counts in the results doesn't matter. 22 | 23 | Here's an example that incorporates several of the elements discussed above: 24 | 25 | - simple words 26 | - contractions 27 | - numbers 28 | - case insensitive words 29 | - punctuation (including apostrophes) to separate words 30 | - different forms of whitespace to separate words 31 | 32 | `"That's the password: 'PASSWORD 123'!", cried the Special Agent.\nSo I fled.` 33 | 34 | The mapping for this subtitle would be: 35 | 36 | ```text 37 | 123: 1 38 | agent: 1 39 | cried: 1 40 | fled: 1 41 | i: 1 42 | password: 2 43 | so: 1 44 | special: 1 45 | that's: 1 46 | the: 2 47 | ``` 48 | -------------------------------------------------------------------------------- /exercises/practice/atbash-cipher/.meta/zcl_atbash_cipher.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_atbash_cipher DEFINITION PUBLIC FINAL CREATE PUBLIC. 2 | 3 | PUBLIC SECTION. 4 | METHODS decode 5 | IMPORTING 6 | cipher_text TYPE string 7 | RETURNING 8 | VALUE(plain_text) TYPE string . 9 | METHODS encode 10 | IMPORTING 11 | plain_text TYPE string 12 | RETURNING 13 | VALUE(cipher_text) TYPE string . 14 | PROTECTED SECTION. 15 | PRIVATE SECTION. 16 | ENDCLASS. 17 | 18 | 19 | 20 | CLASS zcl_atbash_cipher IMPLEMENTATION. 21 | 22 | METHOD decode. 23 | 24 | plain_text = encode( cipher_text ). 25 | REPLACE ALL OCCURRENCES OF ` ` IN plain_text WITH ''. 26 | 27 | ENDMETHOD. 28 | 29 | METHOD encode. 30 | DATA output TYPE string. 31 | DATA(input) = to_lower( plain_text ). 32 | REPLACE ALL OCCURRENCES OF ` ` IN input WITH ''. 33 | REPLACE ALL OCCURRENCES OF '.' IN input WITH ''. 34 | REPLACE ALL OCCURRENCES OF ',' IN input WITH ''. 35 | WHILE strlen( input ) > 0. 36 | DATA(index) = find( val = to_lower( sy-abcde ) sub = input(1) ). 37 | IF index < 0. 38 | cipher_text = cipher_text && input(1). 39 | ELSE. 40 | cipher_text = cipher_text && substring( val = reverse( to_lower( sy-abcde ) ) off = index len = 1 ). 41 | ENDIF. 42 | input = input+1. 43 | ENDWHILE. 44 | 45 | WHILE strlen( cipher_text ) > 5. 46 | output = output && cipher_text(5) && ` `. 47 | cipher_text = cipher_text+5. 48 | ENDWHILE. 49 | cipher_text = output && cipher_text. 50 | ENDMETHOD. 51 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/flower-field/.meta/tests.toml: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file. 2 | # 3 | # Regenerating this file via `configlet sync` will: 4 | # - Recreate every `description` key/value pair 5 | # - Recreate every `reimplements` key/value pair, where they exist in problem-specifications 6 | # - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) 7 | # - Preserve any other key/value pair 8 | # 9 | # As user-added comments (using the # character) will be removed when this file 10 | # is regenerated, comments can be added via a `comment` key. 11 | 12 | [237ff487-467a-47e1-9b01-8a891844f86c] 13 | description = "no rows" 14 | 15 | [4b4134ec-e20f-439c-a295-664c38950ba1] 16 | description = "no columns" 17 | 18 | [d774d054-bbad-4867-88ae-069cbd1c4f92] 19 | description = "no flowers" 20 | 21 | [225176a0-725e-43cd-aa13-9dced501f16e] 22 | description = "garden full of flowers" 23 | 24 | [3f345495-f1a5-4132-8411-74bd7ca08c49] 25 | description = "flower surrounded by spaces" 26 | 27 | [6cb04070-4199-4ef7-a6fa-92f68c660fca] 28 | description = "space surrounded by flowers" 29 | 30 | [272d2306-9f62-44fe-8ab5-6b0f43a26338] 31 | description = "horizontal line" 32 | 33 | [c6f0a4b2-58d0-4bf6-ad8d-ccf4144f1f8e] 34 | description = "horizontal line, flowers at edges" 35 | 36 | [a54e84b7-3b25-44a8-b8cf-1753c8bb4cf5] 37 | description = "vertical line" 38 | 39 | [b40f42f5-dec5-4abc-b167-3f08195189c1] 40 | description = "vertical line, flowers at edges" 41 | 42 | [58674965-7b42-4818-b930-0215062d543c] 43 | description = "cross" 44 | 45 | [dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8] 46 | description = "large garden" 47 | -------------------------------------------------------------------------------- /exercises/practice/itab-basics/zcl_itab_basics.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_itab_basics DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | 7 | PUBLIC SECTION. 8 | TYPES group TYPE c LENGTH 1. 9 | TYPES: BEGIN OF initial_type, 10 | group TYPE group, 11 | number TYPE i, 12 | description TYPE string, 13 | END OF initial_type, 14 | itab_data_type TYPE STANDARD TABLE OF initial_type WITH EMPTY KEY. 15 | 16 | METHODS fill_itab 17 | RETURNING 18 | VALUE(initial_data) TYPE itab_data_type. 19 | 20 | METHODS add_to_itab 21 | IMPORTING initial_data TYPE itab_data_type 22 | RETURNING 23 | VALUE(updated_data) TYPE itab_data_type. 24 | 25 | METHODS sort_itab 26 | IMPORTING initial_data TYPE itab_data_type 27 | RETURNING 28 | VALUE(updated_data) TYPE itab_data_type. 29 | 30 | METHODS search_itab 31 | IMPORTING initial_data TYPE itab_data_type 32 | RETURNING 33 | VALUE(result_index) TYPE i. 34 | 35 | PROTECTED SECTION. 36 | PRIVATE SECTION. 37 | ENDCLASS. 38 | 39 | 40 | 41 | CLASS zcl_itab_basics IMPLEMENTATION. 42 | METHOD fill_itab. 43 | "add solution here 44 | ENDMETHOD. 45 | 46 | METHOD add_to_itab. 47 | updated_data = initial_data. 48 | "add solution here 49 | ENDMETHOD. 50 | 51 | METHOD sort_itab. 52 | updated_data = initial_data. 53 | "add solution here 54 | ENDMETHOD. 55 | 56 | METHOD search_itab. 57 | DATA(temp_data) = initial_data. 58 | "add solution here 59 | ENDMETHOD. 60 | 61 | ENDCLASS. 62 | -------------------------------------------------------------------------------- /exercises/practice/high-scores/.meta/zcl_high_scores.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_high_scores DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | 9 | METHODS constructor 10 | IMPORTING 11 | scores TYPE integertab. 12 | 13 | METHODS list_scores 14 | RETURNING 15 | VALUE(result) TYPE integertab. 16 | 17 | METHODS latest 18 | RETURNING 19 | VALUE(result) TYPE i. 20 | 21 | METHODS personalbest 22 | RETURNING 23 | VALUE(result) TYPE i. 24 | 25 | METHODS personaltopthree 26 | RETURNING 27 | VALUE(result) TYPE integertab. 28 | PROTECTED SECTION. 29 | PRIVATE SECTION. 30 | DATA scores_list TYPE integertab. 31 | 32 | ENDCLASS. 33 | 34 | 35 | CLASS zcl_high_scores IMPLEMENTATION. 36 | 37 | METHOD constructor. 38 | scores_list = scores. 39 | ENDMETHOD. 40 | 41 | METHOD list_scores. 42 | result = scores_list. 43 | ENDMETHOD. 44 | 45 | METHOD latest. 46 | result = scores_list[ lines( scores_list ) ]. 47 | ENDMETHOD. 48 | 49 | METHOD personalbest. 50 | LOOP AT scores_list ASSIGNING FIELD-SYMBOL(). 51 | IF > result. 52 | result = . 53 | ENDIF. 54 | ENDLOOP. 55 | 56 | ENDMETHOD. 57 | 58 | METHOD personaltopthree. 59 | DATA(scores) = scores_list. 60 | SORT scores BY table_line DESCENDING. 61 | LOOP AT scores ASSIGNING FIELD-SYMBOL(). 62 | IF sy-tabix > 3. 63 | EXIT. 64 | ENDIF. 65 | APPEND TO result. 66 | 67 | ENDLOOP. 68 | 69 | ENDMETHOD. 70 | 71 | 72 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/matrix/.meta/zcl_matrix.clas.abap: -------------------------------------------------------------------------------- 1 | CLASS zcl_matrix DEFINITION 2 | PUBLIC 3 | FINAL 4 | CREATE PUBLIC . 5 | 6 | PUBLIC SECTION. 7 | TYPES integertab TYPE STANDARD TABLE OF i WITH EMPTY KEY. 8 | METHODS matrix_row 9 | IMPORTING 10 | string TYPE string 11 | index TYPE i 12 | RETURNING 13 | VALUE(result) TYPE integertab. 14 | METHODS matrix_column 15 | IMPORTING 16 | string TYPE string 17 | index TYPE i 18 | RETURNING 19 | VALUE(result) TYPE integertab. 20 | PROTECTED SECTION. 21 | PRIVATE SECTION. 22 | 23 | ENDCLASS. 24 | 25 | 26 | 27 | CLASS zcl_matrix IMPLEMENTATION. 28 | METHOD matrix_row. 29 | SPLIT string AT '\n' INTO TABLE DATA(lines). 30 | DATA(result_line) = lines[ index ]. 31 | SPLIT result_line AT space INTO TABLE DATA(result_chars). 32 | LOOP AT result_chars ASSIGNING FIELD-SYMBOL(). 33 | APPEND TO result. 34 | ENDLOOP. 35 | ENDMETHOD. 36 | 37 | METHOD matrix_column. 38 | DATA result_matrix TYPE TABLE OF string_table. 39 | SPLIT string AT '\n' INTO TABLE DATA(lines). 40 | LOOP AT lines ASSIGNING FIELD-SYMBOL(). 41 | SPLIT AT space INTO TABLE DATA(result_chars). 42 | APPEND result_chars TO result_matrix. 43 | ENDLOOP. 44 | 45 | LOOP AT result_matrix ASSIGNING FIELD-SYMBOL(). 46 | LOOP AT ASSIGNING FIELD-SYMBOL(). 47 | IF sy-tabix = index. 48 | APPEND TO result. 49 | ENDIF. 50 | ENDLOOP. 51 | ENDLOOP. 52 | ENDMETHOD. 53 | ENDCLASS. -------------------------------------------------------------------------------- /exercises/practice/nth-prime/zcl_nth_prime.clas.testclasses.abap: -------------------------------------------------------------------------------- 1 | CLASS ltcl_nth_prime DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. 2 | 3 | PRIVATE SECTION. 4 | DATA cut TYPE REF TO zcl_nth_prime. 5 | METHODS setup. 6 | METHODS test_first_prime FOR TESTING RAISING cx_static_check. 7 | METHODS test_second_prime FOR TESTING RAISING cx_static_check. 8 | METHODS test_sixth_prime FOR TESTING RAISING cx_static_check. 9 | METHODS test_big_prime FOR TESTING RAISING cx_static_check. 10 | METHODS test_no_zeroth_prime FOR TESTING RAISING cx_static_check. 11 | 12 | 13 | 14 | ENDCLASS. 15 | 16 | CLASS ltcl_nth_prime IMPLEMENTATION. 17 | 18 | METHOD setup. 19 | cut = NEW zcl_nth_prime( ). 20 | ENDMETHOD. 21 | 22 | "first prime 23 | METHOD test_first_prime. 24 | cl_abap_unit_assert=>assert_equals( 25 | act = cut->prime( 1 ) 26 | exp = 2 ). 27 | ENDMETHOD. 28 | 29 | "second prime 30 | METHOD test_second_prime. 31 | cl_abap_unit_assert=>assert_equals( 32 | act = cut->prime( 2 ) 33 | exp = 3 ). 34 | ENDMETHOD. 35 | 36 | "sixth prime 37 | METHOD test_sixth_prime. 38 | cl_abap_unit_assert=>assert_equals( 39 | act = cut->prime( 6 ) 40 | exp = 13 ). 41 | ENDMETHOD. 42 | 43 | "big prime 44 | METHOD test_big_prime. 45 | cl_abap_unit_assert=>assert_equals( 46 | act = cut->prime( 36 ) 47 | exp = 151 ). 48 | ENDMETHOD. 49 | 50 | "there is no zeroth prime 51 | METHOD test_no_zeroth_prime. 52 | TRY. 53 | cut->prime( 0 ). 54 | cl_abap_unit_assert=>fail( ). 55 | CATCH cx_parameter_invalid. 56 | ENDTRY. 57 | ENDMETHOD. 58 | 59 | 60 | ENDCLASS. 61 | --------------------------------------------------------------------------------