Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion exercises/practice/perfect-numbers/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
},
"blurb": "Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for positive integers.",
"source": "Taken from Chapter 2 of Functional Thinking by Neal Ford.",
"source_url": "https://www.oreilly.com/library/view/functional-thinking/9781449365509/"
"source_url": "https://nealford.com/books/functionalthinking.html"
}
3 changes: 3 additions & 0 deletions exercises/practice/perfect-numbers/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ description = "Abundant numbers -> Medium abundant number is classified correctl
[ec7792e6-8786-449c-b005-ce6dd89a772b]
description = "Abundant numbers -> Large abundant number is classified correctly"

[05f15b93-849c-45e9-9c7d-1ea131ef7d10]
description = "Abundant numbers -> Perfect square abundant number is classified correctly"

[e610fdc7-2b6e-43c3-a51c-b70fb37413ba]
description = "Deficient numbers -> Smallest prime deficient number is classified correctly"

Expand Down
4 changes: 4 additions & 0 deletions exercises/practice/perfect-numbers/perfect_numbers_tests.plt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ pending :-
classify(33550335, Classification),
Classification == abundant.

test(perfect_square_abundant_number_is_classified_correctly, condition(pending)) :-
classify(196, Classification),
Classification == abundant.

test(smallest_prime_deficient_number_is_classified_correctly, condition(pending)) :-
classify(2, Classification),
Classification == deficient.
Expand Down
Loading