Which exercises for #48in24?

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

I’ d like to suggest the Grains exercise.
Why? It’s deceptively simple and yet can teach you a lot.

At first glance it’s very straight-forward: The nth field contains 2^(n-1) grains, and by a well known formula for the sum of powers of 2 the whole board holds 2^64 - 1 grains. (Or would, if that mainy grains existed in the universe.)

Wait! How do you calculate powers of 2? Maybe in your language you can just write 2**n. If not, there are a lot of possibilities: bit-shift or repeated doubling? Iteration or recursion? What other methods can you find? And are they efficient?

But that’s not all. With the explicit formula 2^64 - 1 you run right into the size limit for integers, at least on most systems.
Typically, 2^64 - 1 is still representable as a (long) integer (or similar) but not 2^64. Of course, there are loads of different ways to work around this.

Naturally, there’s alo the possibility of ignoring the ‘simple’ formula and just calculating the sum of grains on the board. And again, there are many interesting ways to do this.

1 Like

Can Erik generate some sort of massive grid that shows what tracks are missing which exercises for 48in24? That’d be helpful for tracking purposes. I already cross-referenced what I need from the track build status pages for Racket and Vim script.

1 Like

That is an excellent idea. I’ll get working on it next week.

2 Likes

I’d like to nominate Dart (Pascals Triangle specifically), but the lack of a working test runner is probably too much of an impediment for students.

It looks like Vim script and Emacs Lisp are no longer featured languages in the latest iteration of the schedule. That’s unfortunate.

Since Red is a DSL for creating GUI apps, it seems fitting that it would be featured during one of the Apps weeks. Maybe switch it with CoffeeScript on Pascal’s Triangle?

“Two Bucket” can be solved in a clever way, by solving a Diophantine equation . As far as I know the only language that has a dedicated function for the “extended Euclidean algorithm” built into the standard library is Julia (gcdx). If we get this exercise translated to Julia before October that would be a nice thing to show.

(edit: other languages have related functions, but of all the programming languages I checked Julia was the only one with a dedicated function that calculates Bézout’s coefficients directly. Thanks, @dreig)