Raahaao Code: Logic & Problem Solving
Learn to think like a programmer before, and while, you code.
9+ ore di lezioni · 2 progetti · €35
Oppure includila in un piano mensile da €3.46 a settimana (addebitati €15 al mese) →
Serve un account per aprire qualsiasi lezione. Senza account puoi sfogliare le torri e i prezzi.
Cosa imparerai, piano per piano
- 1
Thinking in steps (Beginner)
- What programmers actually do
- Breaking problems down
- Patterns and abstraction
- 2
Decisions (Beginner)
- True or false
- Making decisions
- Edge cases: test the edges
- 3
Repetition (Intermediate)
- Loops: doing it again
- Accumulating and counting
- Off-by-one and loop bugs
- 4
Organising ideas (Intermediate)
- Functions as named ideas
- Lists as collections
- Dictionaries as lookup
- 5
Problem-solving strategies (Job-ready)
- Work backwards and simplify
- Brute force, then smarter
- Recursion, gently
- Debugging as a method
I due progetti sul tetto
Vending machine
Build a small vending machine by turning its rules into clear steps. You will calculate change with a limited set of coin values, decide whether an item can be bought, and connect those decisions to a text menu.
- make_change(price_cents, paid_cents) returns a dictionary mapping each non-zero coin value in cents to its count, using the fewest coins from 200, 100, 50, 20, 10, and 5; it raises ValueError when payment is below price or the change is not representable.
- can_buy(stock, item, paid) returns True only when item exists in stock, its quantity is positive, paid covers its price, and any change due is representable by the listed coins.
- run_menu(stock) reads buy <item> <paid_cents>, stock, and quit commands from stdin; a successful buy reduces quantity by one and every command prints the exact response specified in the brief.
Puzzle solver
Build a small Sudoku solver that checks a 4×4 puzzle, finds the next blank, and fills a valid solution. You will break the puzzle rules into checks for rows, columns, and 2×2 boxes, then use backtracking: try a number, continue solving, and undo the choice if it leads to a dead end.
- valid(grid) accepts only valid 4×4 Sudoku grids with values 0–4, where 0 means blank and no nonzero digit repeats in any row, column, or 2×2 box
- next_empty(grid) returns the first blank cell as a (row, column) pair, or None when the grid is full
- solve(grid) fills a solvable grid in place and returns True, or leaves an unsolvable grid unchanged and returns False
- count_solutions(grid) returns the number of solutions, stopping once it reaches 2, and does not change the supplied grid
- pretty_print(grid) returns a readable string with four rows, separating each pair of columns with a vertical bar
Domande
Devo installare qualcosa?
No. Tutto funziona nel tuo browser. Per i progetti puoi anche lavorare sul tuo computer e caricare i tuoi file.
Posso saltare quello che conosco già?
Sì. Una volta che possiedi una torre, ogni piano ha un test di salto: segna 8 su 10 e quel piano si apre.
Qual è la politica di restituzione?
Rimborsi entro 5 giorni dall'acquisto. Dopo 5 giorni, nessun rimborso o reso.
Mantengo l'accesso?
Sì. Una torre che acquisti è tua, senza abbonamento.
Le torri
HTML & CSS · JavaScript · Python · SQL · C++ · Node.js · Python per i dati · Flask · Algorithms & Data Structures · Java · Machine Learning · Building with AI