Skip to content
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

Add new practice exercise game-of-life #1481

Merged
merged 4 commits into from
Jul 2, 2024
Merged

Add new practice exercise game-of-life #1481

merged 4 commits into from
Jul 2, 2024

Conversation

jiegillet
Copy link
Contributor

It's been a while since the last exercise, it's always a pleasure.

I watched the recent 48in24 video about the minesweeper exercise, and I was a bit frustrated not to have seen a higher-order solution using matrix convolution kernels or something, and since this exercise is also about counting neighbors, it was the perfect way to pass my frustration :)

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 (x:size/{tiny,small,medium,large,massive})? (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 🤖.

{:ok, {_status, _header, description}} =
:httpc.request(:get, {url ++ ~c"/description.md", []}, [], [])

Mix.Generator.create_file("exercises/practice/#{exercise}/.docs/instructions.md", description)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configlet can create these files now, so it's better to let it do it (and also there are introduction.md files now that this didn't handle)

neighbors = count_neighbors(matrix)

Enum.zip_with(matrix, neighbors, fn row_matrix, row_neighbor ->
Enum.zip_with(row_matrix, row_neighbor, &rule/2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aw man, Elixir 1.11 doesn't have Enum.zip_with, it's the heart and soul of my algorithm :(

Copy link
Contributor Author

@jiegillet jiegillet May 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking up when 1.17 might come out, and noticed that 1.11 is not maintained security-wise. Maybe that's also a good cutoff for us (says the super biased contributor)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice table! How come I never knew before that Elixir versions have a "security support" lifespan? Feel free to drop 1.11 if it's in the way, but maybe when we ad 1.17, we can keep 1.12.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm too lazy to come up with an alternative example solution to this exercise)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice table! How come I never knew before that Elixir versions have a "security support" lifespan? Feel free to drop 1.11 if it's in the way, but maybe when we ad 1.17, we can keep 1.12.

There is also this page: https://hexdocs.pm/elixir/compatibility-and-deprecations.html which is probably a better source.

I feel a bit conflicted about removing a whole version just for one function in an example solution. Maybe I'll simply re-define it with a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like 1.17 is on its way, perfect timing. I'll wait for that.

@angelikatyborska
Copy link
Member

@jiegillet rebase/merge main? 1.17 is here 🙂

@jiegillet
Copy link
Contributor Author

Excellent suggestion :)

We have a seemingly dead link:

José Valim, the creator of Elixir, explains in his 2012 conference talk how he built the language for applications to be:

But actually the link works. Maybe it's just an anti-bot policy... What do we do in those cases?

@angelikatyborska
Copy link
Member

.lycheeignore

@jiegillet jiegillet merged commit 587f44e into main Jul 2, 2024
10 checks passed
@jiegillet jiegillet deleted the jie-game-of-life branch July 2, 2024 07:14
jiegillet added a commit that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants