Which exercises for #48in24?

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)

A bunch of languages seem to have modular inverse in their standard lib: RosettaCode-Modular-Inverse

Among them Python, Go, Java/Kotlin and Racket (though math-lib is currently missing on exercism).

Yeah, we were using the full Racket distribution for the test runner until around July of last year. Using the minimal Racket distribution reduced the test runner image size by about 80% to 60 MB since we’re not pulling in DrRacket and Scribble dependencies. Adding math-lib by itself to the minimal distribution pulls in most of those dependencies. At that point, we might as well go back to the full Racket distribution, but we’re trying to keep test runner image sizes at reasonable sizes across the board.

I should put a note in the track-specific documentation about this situation since the docs defer to the official Racket installation docs which prefer the full distribution. However, I haven’t heard yet of any other students having issues submitting code that only passes locally.

I have a suggestion to make the dart test runner faster, but I don’t know if it is feasible:

The reasoning behind this would be that we don’t want student to have to write their code in a specific editor.

1 Like

I spent some time updating the list yesterday: 48in24 exercises - Google Sheets Let me know if you feel anything is wrong or could be improved.

Here are some of the constraints I imposed on myself:

  • Select exercises which difficulty is such that many students will be able to solve it. For example, alphametics and pov are quite difficult and might be too hard for a lot of people to solve.
  • Select one featured track from the corresponding 12in23’s month. So for the exercises in February, one of the featured tracks is taken from the Functional February tracks.
  • Feature tracks that allow the exercise to be solved in interesting ways.
  • Feature tracks that allow for different approaches (e.g. one imperative, one object-oriented and one functional language).
  • Feature as many tracks as possible.
  • Minimize the number of exercises needed to be implemented (the current selection only requires three exercises to be implemented).
  • Attempt to spread out the tracks as much as possible (so no two consecutive weeks featuring the same track).
  • Don’t feature tracks that are editor/platform specific or hard to work with. This includes Delphi (Windows-only), Objective-C (mostly mac-specific), PL/SQL (hard to get setup locally), Vimscript (requires Vim-compatible IDE) and Emacs Lisp (requires Emacs).

There is an open PR to add this grid: Add page for 48in24 implementation status by ErikSchierboom · Pull Request #6712 · exercism/website · GitHub

Yeah - we’re not going to feature any tracks that don’t have a working test runner. That said, Pascal’s Triangle is late in the year, so there’s time if anyone can work out how to speed up the test runner!

I do: Which exercises for #48in24? - #29 by vaeng

It would be interesting to solve a problem in Zig and C or C++ and Rust in the same week.

It would, but that is what 12in23 is for. For 48in24 we try to feature tracks that allow for a variety of approaches.

1 Like

Can I be added to the Dart team please. I have some PRs and I can’t add reviewers.

1 Like

You’ve been added to the Dart team.

Can I be added as a Red maintainer? :slight_smile:

I’ve added you to the team @BNAndras

1 Like