Sort the Code
The lines of a short algorithm appear shuffled; drag them until they're in the right order.
- Algoritmo
- 1/8
- Pontos
- 0
Tentativas
Arrasta as linhas para as ordenares ↑ ↓ movem a linha escolhida Arrasta pela pega, ou toca numa linha e depois onde a queres Resolve 6 em 8 para ganhares
Each round has 8 algorithms, in JavaScript, Python or PHP, from the shortest to the hardest. The card at the top says what each one does, and its lines appear shuffled.
Drag the lines until they're in the right order and press "Verificar" ("Check"). You can also tap a line and then the place you want it to go, or pick it with the keyboard and move it with the up and down arrows.
You have 3 tries per algorithm, and after each one you see which lines are already in the right place. Getting it at the first try is worth 3 points, at the second 2 and at the third 1. At the end, the editor runs the algorithm on an example. Put 6 of the 8 in order to win the round.
Tip: Start with the first and last lines: the function's declaration always comes first, and the last return or the brace that closes the function comes at the end.
Tip: Indentation tells you what's inside what: a line further to the right belongs to the block of the line that opens it.
Tip: A variable has to get its value before it's used, so initialisations come before loops.
This exercise format matches what computing education research calls "Parsons Problems", a technique formally described in 2006 by researcher Dale Parsons, who proposed teaching programming by asking students to rearrange blocks of already-correct code instead of writing it from scratch, reducing the early frustration with syntax errors typical of beginners.
Rate this game
No ratings yet
Log in to rateYour stats
Create a free account to keep your wins and your favourite games.
Create a free account →