Skip to content

Commit

Permalink
Sync files, tests, and metadata (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Dec 1, 2024
1 parent 97f6ed0 commit 3eb446c
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 24 deletions.
18 changes: 15 additions & 3 deletions exercises/practice/bob/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[e162fead-606f-437a-a166-d051915cea8e]
description = "stating something"
Expand Down Expand Up @@ -64,6 +71,7 @@ description = "alternate silence"

[66953780-165b-4e7e-8ce3-4bcb80b6385a]
description = "multiple line question"
include = false

[5371ef75-d9ea-4103-bcfa-2da973ddec1b]
description = "starting with whitespace"
Expand All @@ -76,3 +84,7 @@ description = "other whitespace"

[12983553-8601-46a8-92fa-fcaa3bc4a2a0]
description = "non-question ending with whitespace"

[2c7278ac-f955-4eb4-bf8f-e33eb4116a15]
description = "multiple line question"
reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a"
6 changes: 3 additions & 3 deletions exercises/practice/bob/bob-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@

(test multiple-line-question
(is
(equal "Whatever."
(equal "Sure."
(bob:response
(format nil "~%
Does this cryogenic chamber make me look fat?~%
No.")))))
Does this cryogenic chamber make~%
me look fat?")))))

(test starting-with-whitespace
(is (equal "Whatever." (bob:response " hmmmmmmm..."))))
Expand Down
11 changes: 0 additions & 11 deletions exercises/practice/hamming/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

Calculate the Hamming distance between two DNA strands.

Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!

When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them we can see how many mistakes occurred.
This is known as the "Hamming distance".

We read DNA using the letters C, A, G and T.
Two strands might look like this:

Expand All @@ -20,8 +11,6 @@ Two strands might look like this:

They have 7 differences, and therefore the Hamming distance is 7.

The Hamming distance is useful for lots of things in science, not just biology, so it's a nice phrase to be familiar with :)

## Implementation notes

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.
12 changes: 12 additions & 0 deletions exercises/practice/hamming/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Introduction

Your body is made up of cells that contain DNA.
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells.
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime!

When cells divide, their DNA replicates too.
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information.
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred.
This is known as the "Hamming distance".

The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :)
8 changes: 4 additions & 4 deletions exercises/practice/protein-translation/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Translate RNA sequences into proteins.

RNA can be broken into three nucleotide sequences called codons, and then translated to a polypeptide like so:
RNA can be broken into three-nucleotide sequences called codons, and then translated to a protein like so:

RNA: `"AUGUUUUCU"` => translates to

Codons: `"AUG", "UUU", "UCU"`
=> which become a polypeptide with the following sequence =>
=> which become a protein with the following sequence =>

Protein: `"Methionine", "Phenylalanine", "Serine"`

Expand All @@ -27,9 +27,9 @@ Protein: `"Methionine", "Phenylalanine", "Serine"`

Note the stop codon `"UAA"` terminates the translation and the final methionine is not translated into the protein sequence.

Below are the codons and resulting Amino Acids needed for the exercise.
Below are the codons and resulting amino acids needed for the exercise.

| Codon | Protein |
| Codon | Amino Acid |
| :----------------- | :------------ |
| AUG | Methionine |
| UUU, UUC | Phenylalanine |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Instructions
# Description

A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,

Expand Down
19 changes: 19 additions & 0 deletions exercises/practice/pythagorean-triplet/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Introduction

You are an accomplished problem-solver, known for your ability to tackle the most challenging mathematical puzzles.
One evening, you receive an urgent letter from an inventor called the Triangle Tinkerer, who is working on a groundbreaking new project.
The letter reads:

> Dear Mathematician,
>
> I need your help.
> I am designing a device that relies on the unique properties of Pythagorean triplets — sets of three integers that satisfy the equation a² + b² = c².
> This device will revolutionize navigation, but for it to work, I must program it with every possible triplet where the sum of a, b, and c equals a specific number, N.
> Calculating these triplets by hand would take me years, but I hear you are more than up to the task.
>
> Time is of the essence.
> The future of my invention — and perhaps even the future of mathematical innovation — rests on your ability to solve this problem.
Motivated by the importance of the task, you set out to find all Pythagorean triplets that satisfy the condition.
Your work could have far-reaching implications, unlocking new possibilities in science and engineering.
Can you rise to the challenge and make history?
4 changes: 2 additions & 2 deletions exercises/practice/pythagorean-triplet/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
".meta/example.lisp"
]
},
"blurb": "There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the triplet.",
"source": "Problem 9 at Project Euler",
"blurb": "Given an integer N, find all Pythagorean triplets for which a + b + c = N.",
"source": "A variation of Problem 9 from Project Euler",
"source_url": "https://projecteuler.net/problem=9"
}

0 comments on commit 3eb446c

Please sign in to comment.