exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 162 forks source link

[Elixir] New concept exercise: `erlang-libraries` and `randomness` #2876

Closed angelikatyborska closed 3 years ago

angelikatyborska commented 3 years ago

Related issue: https://github.com/exercism/v3/issues/2306

This is a draft that so far includes only the example solution and the instructions, to propose a story. If the story gets a green light, I'll write the rest.

I spent many hours obsessing over a story idea for introducing Erlang libraries as a concept. The two main themes were math and randomness. I really wanted to use math for this, but couldn't find a story that felt right... I considered a story with calculating the area of a circle (e.g. pizza) to use pi, or a volume of a cube to use raising a number to the 3rd power (but that's easy to do without the pow function). I considered calculating compound interest as a way to use raising numbers to a higher power than 3 but that's boring. I considered generating sine waves to use pi and trigonometry, but that's not fun if you can't then play the sound. I considered using the Pythagorean theorem to use sqrt but that felt like it needs pictures in the instructions to properly explain the exercise.

So... I have up on math and came up with something with randomness instead. To have a reason to use :rand.uniform instead of just Elixir's Enum.random, it needed to be a random float. The best random float that I could think of was... stardates from Star Trek 🤷.

The main problem with this exercise idea, except for being too nerdy, is that it requires ranges while introducing randomness, but the exercise that introduces ranges (mensch-aergere-dich-nicht) also uses a bit of randomness... so I was thinking that I could later also come up with a separate, simpler exercise to introduce ranges.

angelikatyborska commented 3 years ago

No, you didn't miss anything! I was waiting, hopeful that maybe somebody else will volunteer to review :)