This issue is a discussion for contributors to collaborate in getting ready to be featured in 48in24. Please refer to this forum topic for more info.
We will be featuring Kindergarten Garden from Jul 30 onwards.
Staff jobs
These are things for Erik/Jeremy to do:
☐ Check/update exercise in Problem Specifications
☐ Create + schedule video
Community jobs
For each track:
Implement Kindergarten Garden
Add approaches (and an approaches introduction!) for each idiomatic or interesting/educational approach.
Add video walkthroughs (record yourself solving and digging deeper into the exercise).
Highlight up to 16 different featured exercises (coming soon)
Existing Approaches
You can use these as the basis for approaches on your own tracks. Feel free to copy/paste/reuse/rewrite/etc as you see fit! Maybe ask ChatGPT to translate to your programming language.
I’m not too familiar with F#, but having a look the identical parts are.
Operating on 2 distinct lines by splitting them:
let rows = diagram.Split('\n')
split /\n/, $diagram
Converting the first letter of the name into an index:
let n = int (student.[0]) - int 'A'
ord($student) - ord('A')
And as for the differences:
F# looks to use an index for each individual character, whereas Perl uses the index to extract a 2 character string from both rows, which is then split. These both result in an array of 4 letters.
F# maps each individual letter from the resulting array, Perl uses the entire list as a way of creating a hash slice.
Fundamentally they appear to move in the same direction to achieve their result, with some variation in how the plant letters are obtained and consumed. If they’re a bit too similar I can invesigate a more distinct approach.