-
-
Notifications
You must be signed in to change notification settings - Fork 402
[#767] New practice exercise darts
#777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for contributing to Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:
Automated comment created by PR Commenter 🤖. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! I'm actually glad this is so easy. Maybe we can modify prerequisites to make this exercise unlocks much earlier (erlang libraries are pretty far into the concept tree). Let's see what @neenjaw thinks.
config.json
Outdated
{ | ||
"slug": "darts", | ||
"name": "Darts", | ||
"uuid": "a68113f8-92be-40e0-a97f-eb4239303ef5", | ||
"prerequisites": [ | ||
"cond", | ||
"case", | ||
"if", | ||
"erlang-libraries" | ||
], | ||
"practices": [ | ||
"cond" | ||
], | ||
"difficulty": 2 | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neenjaw Did we agree recently that Float.pow
and Integer.pow
(added in Elixir 1.12) count as part of the integers and floats?
If that's the case, then we could say that this is a cond + integers + floats exercise (although we might need leaving a hint that sqrt(x) == pow(x, 0.5) for less math-savvy students).
We have a severe lack of very easy exercises that could be done after solving only very few learning exercises. If we made that decision, then this exercise will actually become the very first exercise that people learning Elixir can solve. All it takes it that they solve lasagna
(basics), freelancer-rates
(integers), pacman-rules
(booleans) and log-level
(cond)
For reference for @jiegillet (not sure if you have been on the staging website exercism.lol (sic)), here's our current concept tree (on the website you can browse it better than on a screenshot):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's leave out erlang-libraries
.
Technically there is also a solution that doesn't rely on square roots at all. Something like
radius_sq = x * x + y * y
cond do
radius_sq > 10 * 10 -> 0
...
Although I don't think less math-savvy students would think of that ^^
@@ -0,0 +1,10 @@ | |||
defmodule Darts do | |||
@type position :: {float, float} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are test cases that pass integers in the position. {number, number}
?
Could you add a hints document that mentions that |
Co-authored-by: Angelika Tyborska <angelikatyborska@fastmail.com>
Another one. Not the hardest.