Course Introduction
See the Pen Client Side JavaScript basic example by Mattia A Fritz ( @mafritz) on CodePen.
Develop interactive applications to foster learning.
“We consider computational thinking to be the thought processes involved in formulating problems so their solutions can be represented as computational steps and algorithms”
— Alfred V. Aho, 2012
Suggested reading: Denning, P. J. (2016). Remaining Trouble Spots With Computational Thinking. Cacm, 60(33), 33–39.
Frère Luc est l'intendant de l'abbaye. Très économe, il réutilise les bouts de cierges usagés pour en faire de nouveaux. Il est capable de reconstituer un cierge à partir de trois bouts de cierges qu'il fait fondre. Combien pourra-t-il reconstituer de cierges avec les neuf bouts de cierges qu'il a récupérés ce matin dans l'abbatiale ?
In total he obtains {{totalCandles}} candles.
//Set the initial number of candles and pieces required
var numberOfPieces = 9;
var piecesRequired = 3;
//Set a variable to be incremented for each new candle
var totalCandlesObtained = 0;
//Go on until the number of candles can be divided by the pieces
while (numberOfPieces / piecesRequired >= 1) {
//At each cycle, define the new number of candles and add them to the total
numberOfPieces = Math.floor(numberOfPieces / piecesRequired);
totalCandlesObtained += numberOfPieces;
}
//Print the result
console.log('TOTAL:' + totalCandlesObtained + ' candles');
You can copy the code in your browser's console.
Comment obtenir 1'000 au moyen d'une addition ne comportant que des 8 ?
{{ solution }}
{{ message }}
The closest it can get is: {{solution}}
See the Pen Client Side JavaScript basic example 10 by Mattia A Fritz (@mafritz) on CodePen.
Switch from decimal to binary counting
“...is a kind of action that occurs as two or more objects have an effect upon one another. The idea of a two-way effect is essential in the concept of interaction, as opposed to a one-way causal effect”
— Wikipedia
For a simple interaction...
Add an event listener
Determine a behavior
Modify the current state.
Use all criteria that comes to your mind!
There is no right or wrong answer!