From b491cac5ff350c99e019209a979cb450c57b5cd8 Mon Sep 17 00:00:00 2001 From: keiravillekode Date: Fri, 6 Sep 2024 14:05:50 +1000 Subject: [PATCH] Sync exercises (#268) --- exercises/practice/darts/.docs/instructions.md | 4 ++-- exercises/practice/darts/.meta/config.json | 2 +- exercises/practice/hello-world/.meta/config.json | 2 +- .../practice/matching-brackets/.docs/instructions.md | 3 ++- .../practice/matching-brackets/.docs/introduction.md | 8 ++++++++ exercises/practice/pig-latin/.docs/instructions.md | 4 ++-- exercises/practice/protein-translation/.meta/tests.toml | 5 +++++ exercises/practice/protein-translation/runner.mips | 4 ++-- exercises/practice/raindrops/.meta/config.json | 2 +- exercises/practice/roman-numerals/.meta/tests.toml | 3 +++ exercises/practice/roman-numerals/runner.mips | 4 +++- 11 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 exercises/practice/matching-brackets/.docs/introduction.md diff --git a/exercises/practice/darts/.docs/instructions.md b/exercises/practice/darts/.docs/instructions.md index 5e57a86..6518201 100644 --- a/exercises/practice/darts/.docs/instructions.md +++ b/exercises/practice/darts/.docs/instructions.md @@ -1,6 +1,6 @@ # Instructions -Write a function that returns the earned points in a single toss of a Darts game. +Calculate the points scored in a single toss of a Darts game. [Darts][darts] is a game where players throw darts at a [target][darts-target]. @@ -16,7 +16,7 @@ In our particular instance of the game, the target rewards 4 different amounts o The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. Of course, they are all centered at the same point — that is, the circles are [concentric][] defined by the coordinates (0, 0). -Write a function that given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), returns the correct amount earned by a dart landing at that point. +Given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), calculate the correct score earned by a dart landing at that point. ## Credit diff --git a/exercises/practice/darts/.meta/config.json b/exercises/practice/darts/.meta/config.json index ef00ca0..f6f7e53 100644 --- a/exercises/practice/darts/.meta/config.json +++ b/exercises/practice/darts/.meta/config.json @@ -13,6 +13,6 @@ ".meta/example.mips" ] }, - "blurb": "Write a function that returns the earned points in a single toss of a Darts game.", + "blurb": "Calculate the points scored in a single toss of a Darts game.", "source": "Inspired by an exercise created by a professor Della Paolera in Argentina" } diff --git a/exercises/practice/hello-world/.meta/config.json b/exercises/practice/hello-world/.meta/config.json index 2f6ae7f..922ad42 100644 --- a/exercises/practice/hello-world/.meta/config.json +++ b/exercises/practice/hello-world/.meta/config.json @@ -13,7 +13,7 @@ ".meta/example.mips" ] }, - "blurb": "The classical introductory exercise. Just say \"Hello, World!\".", + "blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".", "source": "This is an exercise to introduce users to using Exercism", "source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program" } diff --git a/exercises/practice/matching-brackets/.docs/instructions.md b/exercises/practice/matching-brackets/.docs/instructions.md index 544daa9..ea17084 100644 --- a/exercises/practice/matching-brackets/.docs/instructions.md +++ b/exercises/practice/matching-brackets/.docs/instructions.md @@ -1,4 +1,5 @@ # Instructions Given a string containing brackets `[]`, braces `{}`, parentheses `()`, or any combination thereof, verify that any and all pairs are matched and nested correctly. -The string may also contain other characters, which for the purposes of this exercise should be ignored. +Any other characters should be ignored. +For example, `"{what is (42)}?"` is balanced and `"[text}"` is not. diff --git a/exercises/practice/matching-brackets/.docs/introduction.md b/exercises/practice/matching-brackets/.docs/introduction.md new file mode 100644 index 0000000..0618221 --- /dev/null +++ b/exercises/practice/matching-brackets/.docs/introduction.md @@ -0,0 +1,8 @@ +# Introduction + +You're given the opportunity to write software for the Bracketeer™, an ancient but powerful mainframe. +The software that runs on it is written in a proprietary language. +Much of its syntax is familiar, but you notice _lots_ of brackets, braces and parentheses. +Despite the Bracketeer™ being powerful, it lacks flexibility. +If the source code has any unbalanced brackets, braces or parentheses, the Bracketeer™ crashes and must be rebooted. +To avoid such a scenario, you start writing code that can verify that brackets, braces, and parentheses are balanced before attempting to run it on the Bracketeer™. diff --git a/exercises/practice/pig-latin/.docs/instructions.md b/exercises/practice/pig-latin/.docs/instructions.md index 6c84308..a9645ac 100644 --- a/exercises/practice/pig-latin/.docs/instructions.md +++ b/exercises/practice/pig-latin/.docs/instructions.md @@ -19,7 +19,7 @@ For example: ## Rule 2 -If a word begins with a one or more consonants, first move those consonants to the end of the word and then add an `"ay"` sound to the end of the word. +If a word begins with one or more consonants, first move those consonants to the end of the word and then add an `"ay"` sound to the end of the word. For example: @@ -33,7 +33,7 @@ If a word starts with zero or more consonants followed by `"qu"`, first move tho For example: -- `"quick"` -> `"ickqu"` -> `"ay"` (starts with `"qu"`, no preceding consonants) +- `"quick"` -> `"ickqu"` -> `"ickquay"` (starts with `"qu"`, no preceding consonants) - `"square"` -> `"aresqu"` -> `"aresquay"` (starts with one consonant followed by `"qu`") ## Rule 4 diff --git a/exercises/practice/protein-translation/.meta/tests.toml b/exercises/practice/protein-translation/.meta/tests.toml index 5fb1890..de680e3 100644 --- a/exercises/practice/protein-translation/.meta/tests.toml +++ b/exercises/practice/protein-translation/.meta/tests.toml @@ -87,11 +87,16 @@ description = "Translation stops if STOP codon in middle of three-codon sequence [2c2a2a60-401f-4a80-b977-e0715b23b93d] description = "Translation stops if STOP codon in middle of six-codon sequence" +[f6f92714-769f-4187-9524-e353e8a41a80] +description = "Sequence of two non-STOP codons does not translate to a STOP codon" + [1e75ea2a-f907-4994-ae5c-118632a1cb0f] description = "Non-existing codon can't translate" +include = false [9eac93f3-627a-4c90-8653-6d0a0595bc6f] description = "Unknown amino acids, not part of a codon, can't translate" +reimplements = "1e75ea2a-f907-4994-ae5c-118632a1cb0f" [9d73899f-e68e-4291-b1e2-7bf87c00f024] description = "Incomplete RNA sequence can't translate" diff --git a/exercises/practice/protein-translation/runner.mips b/exercises/practice/protein-translation/runner.mips index e25f5ba..824e813 100644 --- a/exercises/practice/protein-translation/runner.mips +++ b/exercises/practice/protein-translation/runner.mips @@ -42,7 +42,7 @@ ins: .asciiz "AUGUUUUAA", "UGGUAGUGG", "UGGUGUUAUUAAUGGUUU", - "AAA", + "AUGAUG", "XYZ", "AUGU", "UUCUUCUAAUGGU" @@ -74,7 +74,7 @@ outs: .asciiz "Methionine\nPhenylalanine\n", "Tryptophan\n", "Tryptophan\nCysteine\nTyrosine\n", - "", # Invalid codon, + "Methionine\nMethionine\n", "", # Invalid codon, "", # Invalid codon, "Phenylalanine\nPhenylalanine\n" diff --git a/exercises/practice/raindrops/.meta/config.json b/exercises/practice/raindrops/.meta/config.json index 0011582..ee35668 100644 --- a/exercises/practice/raindrops/.meta/config.json +++ b/exercises/practice/raindrops/.meta/config.json @@ -16,7 +16,7 @@ ".meta/example.mips" ] }, - "blurb": "Convert a number to a string, the content of which depends on the number's factors.", + "blurb": "Convert a number into its corresponding raindrop sounds - Pling, Plang and Plong.", "source": "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.", "source_url": "https://en.wikipedia.org/wiki/Fizz_buzz" } diff --git a/exercises/practice/roman-numerals/.meta/tests.toml b/exercises/practice/roman-numerals/.meta/tests.toml index 57c6c4b..709011b 100644 --- a/exercises/practice/roman-numerals/.meta/tests.toml +++ b/exercises/practice/roman-numerals/.meta/tests.toml @@ -84,5 +84,8 @@ description = "3000 is MMM" [3bc4b41c-c2e6-49d9-9142-420691504336] description = "3001 is MMMI" +[2f89cad7-73f6-4d1b-857b-0ef531f68b7e] +description = "3888 is MMMDCCCLXXXVIII" + [4e18e96b-5fbb-43df-a91b-9cb511fe0856] description = "3999 is MMMCMXCIX" diff --git a/exercises/practice/roman-numerals/runner.mips b/exercises/practice/roman-numerals/runner.mips index 3fbe948..7498050 100644 --- a/exercises/practice/roman-numerals/runner.mips +++ b/exercises/practice/roman-numerals/runner.mips @@ -13,7 +13,7 @@ .data # number of test cases -n: .word 26 +n: .word 27 # input values (word sized ints) ins: .word 1, @@ -41,6 +41,7 @@ ins: .word 1666, 3000, 3001, + 3888, 3999 # expected output values (null terminated) outs: .asciiz @@ -69,6 +70,7 @@ outs: .asciiz "MDCLXVI", "MMM", "MMMI", + "MMMDCCCLXXXVIII", "MMMCMXCIX" failmsg: .asciiz "failed for test input: "