Skip to content

Commit

Permalink
fix: tests for saddle points/word count/atbash-cipher
Browse files Browse the repository at this point in the history
- Saddle points: Corrected example coordinates.
- Word count: Fixed example syntax.
- Atbash cipher: Fixed example syntax.
  • Loading branch information
kkweon committed Nov 22, 2024
1 parent 43fe138 commit 44289d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/atbash-cipher/atbash_cipher_tests.plt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pending :-
Ciphertext == "gifgs rhurx grlm".

test(encode_all_the_letters, condition(pending)) :-
encode("The quick brown fox jumps over the lazy dog." Ciphertext),
encode("The quick brown fox jumps over the lazy dog.", Ciphertext),
Ciphertext == "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt".

test(decode_exercism, condition(pending)) :-
Expand Down
12 changes: 6 additions & 6 deletions exercises/practice/saddle-points/.meta/saddle_points.example.pl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:- use_module(library(clpfd)).

saddle_point(Matrix, RowMaxes, ColMins, X, Y) :-
nth1(Y, Matrix, Row),
nth1(X, Row, Cell),
nth1(Y, RowMaxes, RowMax),
nth1(X, ColMins, ColMin),
saddle_point(Matrix, RowMaxes, ColMins, R, C) :-
nth1(R, Matrix, Row),
nth1(C, Row, Cell),
nth1(R, RowMaxes, RowMax),
nth1(C, ColMins, ColMin),
Cell #>= RowMax, Cell #=< ColMin.

saddle_points(Matrix, SaddlePoints) :-
Expand All @@ -13,4 +13,4 @@
maplist(min_list, Transposed, ColMins),
length(RowMaxes, Rows),
length(ColMins, Cols),
findall((X, Y), (between(1, Rows, Y), between(1, Cols, X), saddle_point(Matrix, RowMaxes, ColMins, X, Y)), SaddlePoints).
findall((X, Y), (between(1, Rows, X), between(1, Cols, Y), saddle_point(Matrix, RowMaxes, ColMins, X, Y)), SaddlePoints).
2 changes: 1 addition & 1 deletion exercises/practice/word-count/word_count_tests.plt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pending :-
"don't"-2,
"first"-1,
"getting"-1,
"it"-1
"it"-1,
"laugh"-1,
"then"-1,
"you're"-1
Expand Down

0 comments on commit 44289d8

Please sign in to comment.