Skip to Content

Practice

Small implementation problems. Each one teaches one piece of the language.

Solve these in the editor on each page. Your code is judged in the browser against hidden tests, and after it is accepted the page explains what the problem was there to teach.

ProblemLevelTeachesAfter chapter
Halving gameAvar, /, %, ranges wider than 32 bits1
Odd one outAcount, lambdas, .items1
Collatz lengthAwhile, if as an expression, max=1
Range sumsAdomains, cuts, prefix sums2
Longest corridorAgrids, [Row, Col]Char, per-row state2
Second placeA?Int, max=, ??3
LeaderboardBrecords, reading records, sort(by:)3

More problems are coming.