Which exercises for #48in24?

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 :slight_smile:

1 Like

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.

2 Likes

My picks for particular language representation:

  • Elixir, F#, maybe Java or Python?

    • Phone Number - good demonstration of how to use railway-oriented programing to chain together many operations that can succeed or fail without getting bogged down in error handling
  • Racket, Scheme, Clojure, etc.

    • Matching Brackets - there’s some good elegant recursive solutions possible with this that these languages enable well, and I think having this exercise in the most bracket-heavy languages is fun
  • Prolog, maybe F# and Julia

    • Zebra Puzzle or Floored - a classic logic programming problem, has a really tidy constraint programming solution too as a way to explore CLPFD
  • Gleam, maybe Elixir and Rust?

    • Yacht or Forth - languages that that promote pattern matching everywhere make writing parsers surprisingly straightforward
2 Likes

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.

1 Like

I think minesweeper should be in there. For me it’s the one that has required the most thought and consideration about how to solve it, as there are many approaches.

1 Like

I feel that Rectangles is in the same realm as Minesweeper.

Two Bucket is one of my faves: a fairly gentle entry to OO.

1 Like

I like rail-fence-cipher. It might be the only exercise where I define a custom iterator: a rail-fence-iterator.

I’ll be another one chipping in for forth, I really enjoyed that excercise a lot.

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.

2 Likes

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?

Maybe so! I like the idea.

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.

4 Likes

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.

Oh great, another Nibbly November to kook forward to :frowning_face:

1 Like

I’m thinking that potentially we maybe have 5 languages (of which you have to choose 3) so people have a bit more variety and can opt of out things they don’t like.

3 Likes

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!

1 Like

Just FYI, you can get those monthly badge whenever those months came up again.

1 Like

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!

1 Like

For Python:

  • acronym (fun to compare all the various str methods/strategies, as well as RegEx)
  • robot-simulator (lots of opportunity for playing with classes and dynamic programming)
  • space-age (more fun with classes and dynamic method creation and/or other ways to calculate time-differences)
  • diamond

Editing this to add: Parallel Letter Frequency is unimplemented on purpose for Python, and Yacht is problematic. Discord Discussion Here. I’d prefer if Python wasn’t featured for either.

Will open a new thread to discuss how we might annotate/note/explain unimplemented on purpose cases or problematic exercises. :slightly_smiling_face:

2 Likes