Skip to content

[#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

Merged
merged 7 commits into from
Jun 26, 2021

Conversation

jiegillet
Copy link
Contributor

Another one. Not the hardest.

@github-actions
Copy link
Contributor

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (reputation/contributed_code/{minor,major})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Practice exercise changed

    • 🌲 Do prerequisites, practices, and difficulty in config.json need to be updated?
    • 🧑‍🏫 Are the changes in accordance with the community-wide problem specifiations?
  • Practice exercise tests changed

    • ⚪️ Are all tests except the first one skipped?
    • 📜 Does <exercise>/.meta/tests.toml need updating?

Automated comment created by PR Commenter 🤖.

Copy link
Member

@angelikatyborska angelikatyborska left a 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
Comment on lines 2468 to 2482
{
"slug": "darts",
"name": "Darts",
"uuid": "a68113f8-92be-40e0-a97f-eb4239303ef5",
"prerequisites": [
"cond",
"case",
"if",
"erlang-libraries"
],
"practices": [
"cond"
],
"difficulty": 2
},
Copy link
Member

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):

elixir concepts

Copy link
Contributor Author

@jiegillet jiegillet Jun 25, 2021

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}
Copy link
Member

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}?

@angelikatyborska angelikatyborska requested a review from neenjaw June 24, 2021 14:51
@angelikatyborska angelikatyborska added the x:size/large Large amount of work label Jun 26, 2021
@angelikatyborska
Copy link
Member

Could you add a hints document that mentions that sqrt(x) == pow(x, 0.5) and maybe also links to instructions how to calculate the distance between two points? I know it's basic math, but since this is supposed to be a very exercise, I don't want anyone to get stuck because of that.

jiegillet and others added 2 commits June 26, 2021 17:21
Co-authored-by: Angelika Tyborska <angelikatyborska@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants