-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
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 🤖. |
{:ok, {_status, _header, description}} = | ||
:httpc.request(:get, {url ++ ~c"/description.md", []}, [], []) | ||
|
||
Mix.Generator.create_file("exercises/practice/#{exercise}/.docs/instructions.md", description) |
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.
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) |
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.
Aw man, Elixir 1.11 doesn't have Enum.zip_with
, it's the heart and soul of my algorithm :(
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.
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)
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.
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 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.
(I'm too lazy to come up with an alternative example solution to this exercise)
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.
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.
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.
Seems like 1.17 is on its way, perfect timing. I'll wait for that.
@jiegillet rebase/merge main? 1.17 is here 🙂 |
69035fc
to
a7a6872
Compare
Excellent suggestion :) We have a seemingly dead link:
But actually the link works. Maybe it's just an anti-bot policy... What do we do in those cases? |
|
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 :)