Which exercises should we include in #48in24? We want lots of variety in subject, difficulty, and type. We want fun, interesting, exercises and ones where there are different approaches that people can explore.
Which exercise’s are your favourites and why should we include them?
Edit: It’d also be good to not re-feature exercises in the same tracks as we did in 12in23.
To start us off, two exercises that I’ve spent many many hours exploring and I’ll insist on are Bob and Food Chain. Both can be solved in so many ways and have so much learning goodness in them. I’d like to feature Ruby as a language in both of those, as there’s lots of good material out there that Katrina made for both
I’m fond of Matching Brackets. It lends itself well to exploring recursion and iterators, and provides good opportunities for mentor feedback, as naive solutions often involve multiple loops over the input string.
Also I remember Poker being a good one. Making the mental leap of using a scoring system for comparison as opposed to hard coding an ordering was good, and there’s plenty of opportunity for creative ways to model a poker hand.
Bob should definitely be covered. There is also a really nice F#-specific approach that we could mention, involving custom pattern matching.
Some exercises that I’d like to see featured (in random order):
Isogram and/or Pangram: you’ll have to work with characters in a string, which languages take different approaches on. They can also be solved using several different approaches: using sets, using recursion, using bit fields, and more. This would work well in most languages, but I’d suggest featuring a functional language (for a high-level solution) and a systems language for a more low-level solution.
Space Age: this is perfect for a dynamic language (like Ruby) or one that allows for compile-time code generation/macros (like Lisp), as they can generate the code for the various planets.
Two-Fer: a relatively simple exercise, but we’ve found out that students can come up with a wide variety of solutions. For many languages this involves a parameter with a default value, and for others some “Option/Maybe” type. Combine that with the various ways in which strings can be concatenated/formatted/interpolated, and this could be very interesting. I would suggest using at least one language that supports default values, one that requires an “Option/Maybe” type and one that supports string interpolation.
Collatz Conjecture: can be implemented via recursion, imperative looping, counting a lazy sequence and more. I’d suggest featuring languages that allow for each of those three approaches.
Difference of Squares: can be solved using while loops, higher-order list/sequences or math. We can also mention ranges, and how they are relevant here. As for featured languages, I’d like to feature R and/or Julia, as they are perfect for this exercise.
Knapsack: typically solved using recursion or dynamic programming, which are both interesting concepts.
Raindrops: a classic exercise, and can be solved in many ways. Python allows for some very neat implementations.
Reverse String: another classic exercise, which is quite simple but we could do deeper into performance aspects of various approaches here.
Secret Handshake: bitwise operations, possibly enums, and string concatentation make this a really fun exercise.
Linked List/Simple Linked List/Circular Buffer: we should feature at least one custom data structure exercise. I personally like Circular Buffer best, but any of them would do. Featuring a language where one has to manually manage memory could be really interesting here, as well as a higher-level, or even functional language.
D&D Character: we have very few exercises that deal with randomness, and I’ve always felt this exercise was more fun than Robot Name.
Protein Translation: lots of fun ways to solve this, using iteration, recursion, early returns, and lots more.
Yacht: iterating/processing a small sequence/array of integers is nice and there are lots of different approaches. I’d like to feature a somewhat low level language where one has to use iteration but also a higher level one that gives you lots of options to use built-in higher-order functions.
Parallel Letter Frequency: we have few exercises that lend themselves well to parallellization, but this is one of them! For featured languages, Go and Elixir/Erlang make a ton of sense.
Meetup: one of our few date-based exercises, so it would be great to feature.
Pop Count: bitwise manipulation is key here. Would be fun to feature an assembly language here.
Robot Simulator: perfect for being solved using different paradigms, e.g. an object-oriented one and a functional one.
Roman Numerals: many different ways to solve this making it a fun exercise.
In languages with first class support for complex numbers (eg Python), I find complex numbers make problems like these (manipulating Euclidian coordinates) a breeze.
Does it make sense to somehow support language agnostic approaches to some of these? Or an approach collection where all you need to do is copy/paste and replace pseudocode blocks with language specific code?
Note to self: When choosing the featured languages for each week, it would be nice if we could pick one option each week from the featured month type (e.g. for Feb, pick >=1 language each week that’s functional). Just for people who are also looking to get the Functional February badge as well as do 48in24.
You should add this information when the first exercise for 24in48 got rolled out, or make an announcement. Many people probably thought those badges are tied specific to 12in2023, so knowing they can also get the monthly badge will probably motivate them a bit more.
That exciting news! Completing 12in23 was great fun, but since I joined Excerism too late in the year, I missed the first four monthly badges. So now that’s one more thing to look forward to in 48in24!
Here’s our draft list of languages for all the weeks:
We’ve tried to stick roughly to the 12in23 themes when choosing exercises. We’ve selected some tracks that we feel are good. In general, we’re happy for alternative suggestions to tracks if there’s something really specific that would make something better. And we need your help in choosing the missing tracks.
Please comment on this forum post telling us which exercise you think really showcase certain languages (or are fun/interesting/etc), and we’ll update the spreadsheet!