Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ bin/configlet.exe
.cache
.pytest_cache
__pycache__

# virtual environments
venv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

4 changes: 4 additions & 0 deletions exercises/alphametics/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
skip_tests:
- description: "puzzle with ten letters and 199 addends"
property: "solve"
message: "extra-credit"
2 changes: 2 additions & 0 deletions exercises/armstrong-numbers/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
isArmstrongNumber: is_armstrong
5 changes: 5 additions & 0 deletions exercises/atbash-cipher/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cases:
- description: "encode decode"
property: "decode"
input: 'encode("Testing, 1 2 3, testing.")'
expected: "testing123testing"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for track-specific cases?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the input value is a string it'll insert it as is, so property(STRING)... allows a little more flexibility for cases like this.

2 changes: 2 additions & 0 deletions exercises/binary-search/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
find: binary_search
2 changes: 2 additions & 0 deletions exercises/bob/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
response: hey
2 changes: 2 additions & 0 deletions exercises/book-store/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
total: calculate_total
2 changes: 2 additions & 0 deletions exercises/change/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
findFewestCoins: find_minimum_coins
2 changes: 2 additions & 0 deletions exercises/collatz-conjecture/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
steps: collatz_steps
2 changes: 2 additions & 0 deletions exercises/crypto-square/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
ciphertext: encode
2 changes: 2 additions & 0 deletions exercises/diamond/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
rows: make_diamond
2 changes: 2 additions & 0 deletions exercises/difference-of-squares/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
differenceOfSquares: difference
10 changes: 10 additions & 0 deletions exercises/flatten-array/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cases:
- description: "empty nested lists"
property: "flatten"
input: '[[()]]'
expected: []
- description: "strings"
property: "flatten"
input:
array: ['0', ['1', '2']]
expected: ['0', '1', '2']
22 changes: 22 additions & 0 deletions exercises/grains/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
properties_map:
square: on_square
total: total_after
cases:
- description: "total of square 0 raises an exception"
property: "total"
input:
square: 0
expected:
error: "square must be between 1 and 64"
- description: "total of negative square raises an exception"
property: "square"
input:
square: -1
expected:
error: "square must be between 1 and 64"
- description: "square greater than 64 raises an exception"
property: "square"
input:
square: 65
expected:
error: "square must be between 1 and 64"
63 changes: 63 additions & 0 deletions exercises/hamming/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
cases:
- description: "complete distance in single nucleotide strands"
property: "distance"
input:
strand1: "A"
strand2: "G"
expected: 1

- description: "complete distance in small strands"
property: "distance"
input:
strand1: "AG"
strand2: "CT"
expected: 2

- description: "small distance in small strands"
property: "distance"
input:
strand1: "AT"
strand2: "CT"
expected: 1

- description: "small distance"
property: "distance"
input:
strand1: "GGACG"
strand2: "GGTCG"
expected: 1

- description: "small distance in long strands"
property: "distance"
input:
strand1: "ACCAGGG"
strand2: "ACTATGG"
expected: 2

- description: "non unique character in first strand"
property: "distance"
input:
strand1: "AAG"
strand2: "AAA"
expected: 1

- description: "non unique character in second strand"
property: "distance"
input:
strand1: "AAA"
strand2: "AAG"
expected: 1

- description: "same nucleotides in different positions"
property: "distance"
input:
strand1: "TAG"
strand2: "GAT"
expected: 2

- description: "large distance"
property: "distance"
input:
strand1: "GATACA"
strand2: "GCATAA"
expected: 4
2 changes: 2 additions & 0 deletions exercises/isbn-verifier/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
isValid: verify
6 changes: 6 additions & 0 deletions exercises/isogram/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cases:
- description: "duplicated letter and nonletter character"
property: "isIsogram"
input:
phrase: "Aleph Bot Chap"
expected: false
27 changes: 27 additions & 0 deletions exercises/largest-series-product/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
skip_tests:
- description: "project euler big number"
property: "largestProduct"
message: "extra-credit"
cases:
- description: "project euler big number"
property: "largestProduct"
input:
digits:
"73167176531330624919225119674426574742355349194934969835203127745\
06326239578318016984801869478851843858615607891129494954595017379\
58331952853208805511125406987471585238630507156932909632952274430\
43557668966489504452445231617318564030987111217223831136222989342\
33803081353362766142828064444866452387493035890729629049156044077\
23907138105158593079608667017242712188399879790879227492190169972\
08880937766572733300105336788122023542180975125454059475224352584\
90771167055601360483958644670632441572215539753697817977846174064\
95514929086256932197846862248283972241375657056057490261407972968\
65241453510047482166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586178664583591245\
66529476545682848912883142607690042242190226710556263211111093705\
44217506941658960408071984038509624554443629812309878799272442849\
09188845801561660979191338754992005240636899125607176060588611646\
71094050775410022569831552000559357297257163626956188267042825248\
3600823257530420752963450"
span: 13
expected: 23514624000
2 changes: 2 additions & 0 deletions exercises/leap/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
leapYear: is_leap_year
2 changes: 2 additions & 0 deletions exercises/markdown/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
parse: parse_markdown
20 changes: 20 additions & 0 deletions exercises/minesweeper/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
properties_map:
annotate: board
cases:
- description: "board9"
property: "annotate"
input:
minefield: [" ", " * ", " ", " ", " * "]
expected: [" 111", " 1*1", " 111", "111 ", "1*1 "]
- description: "different length"
property: "annotate"
input:
minefield: [" ", "* ", " "]
expected:
error: "Board rows must be of the same length"
- description: "invalid character"
property: "annotate"
input:
minefield: ["X * "]
expected:
error: "Illegal characters not allowed."
2 changes: 2 additions & 0 deletions exercises/nth-prime/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
prime: nth-prime
3 changes: 3 additions & 0 deletions exercises/palindrome-products/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
properties_map:
largest: largest_palindrome
smallest: smallest_palindrome
2 changes: 2 additions & 0 deletions exercises/prime-factors/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
factors: prime_factors
2 changes: 2 additions & 0 deletions exercises/rectangles/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
rectangles: count
2 changes: 2 additions & 0 deletions exercises/roman-numerals/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
roman: numeral
2 changes: 2 additions & 0 deletions exercises/secret-handshake/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
commands: handshake
2 changes: 2 additions & 0 deletions exercises/sieve/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
primes: sieve
2 changes: 2 additions & 0 deletions exercises/spiral-matrix/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
spiralMatrix: spiral
2 changes: 2 additions & 0 deletions exercises/sum-of-multiples/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
properties_map:
sum: sum_of_multiples
4 changes: 4 additions & 0 deletions exercises/triangle/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
properties_map:
equilateral: is_equilateral
isosceles: is_isosceles
scalene: is_scalene
29 changes: 29 additions & 0 deletions exercises/word-count/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
properties_map:
countWords: word_count
cases:
- description: "tabs"
property: "countWords"
input:
sentence: "rah rah ah ah ah\troma roma ma\tga ga oh la la\twant your bad romance"
expected:
rah: 2
ah: 3
roma: 2
ma: 1
ga: 2
oh: 1
la: 2
want: 1
your: 1
bad: 1
romance: 1
- description: "non alphanumeric"
property: "countWords"
input:
sentence: "hey,my_spacebar_is_broken."
expected:
hey: 1
my: 1
spacebar: 1
is: 1
broken: 1
15 changes: 15 additions & 0 deletions exercises/wordy/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
properties_map:
answer: calculate
cases:
- description: "missing operation"
property: "answer"
input:
question: "What is 2 2 minus 3?"
expected:
error: "An operation is missingh"
- description: "missing number"
property: "answer"
input:
question: "What is 7 plus multiplied by -2?"
expected:
error: "A number is missing."
15 changes: 15 additions & 0 deletions exercises/yacht/.meta/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
imports:
- YACHT
- ONES
- TWOS
- THREES
- FOURS
- FIVES
- SIXES
- FULL_HOUSE
- FOUR_OF_A_KIND
- LITTLE_STRAIGHT
- BIG_STRAIGHT
- CHOICE
inputs_map:
category: "lambda c: c.upper().replace(' ', '_')"
Loading