Variables and DECLARE · Variables et DÉCLARATION
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
English
A variable stores one value
- A variable has a name and holds one value you can change.
- The 2026 guide writes names in mixed case, starting with a letter:
NumberOfPlayersornumberOfPlayers. - These lessons use a capital first letter, the same shape as the guide's own examples.
Français
Une variable stocke une seule valeur
- Une variable a un nom et contient une valeur que vous pouvez modifier.
- Le guide 2026 écrit les noms en casse mixte, commençant par une lettre :
NumberOfPlayersounumberOfPlayers. - Ces leçons utilisent une majuscule initiale, la même forme que les exemples du guide lui-même.
DECLARE Counter : INTEGER
Counter ← 0
Counter ← Counter + 1
OUTPUT Counter
English
DECLARE, then the arrow
DECLARE Counter : INTEGERcreates the variable and names its type.- The assignment operator is
←. It stores the value on the right. =is not how you store a value.=means "is equal to" inside a test.
Français
DECLARE, puis la flèche
DECLARE Counter : INTEGERcrée la variable et nomme son type.- L'opérateur d'affectation est
←. Il stocke la valeur à droite. =n'est pas la façon de stocker une valeur.=signifie « est égal à » dans un test.
DECLARE Score : INTEGER
Score ← 40
Score ← Score + 2
OUTPUT Score
English
Watch out
- Declare a variable before you use it.
- An identifier starts with a letter. Digits may follow. The guide also allows
_.
Français
Attention
- Déclarez une variable avant de l'utiliser.
- Un identifiant commence par une lettre. Des chiffres peuvent suivre. Le guide autorise également
_.
English
Common mistakes
Counter ← 1stores 1.Counter = 1is not an assignment.- One variable holds one value. Assigning again replaces it.
Français
Erreurs courantes
Counter ← 1stocke 1.Counter = 1n'est pas une affectation.- Une variable contient une seule valeur. Une nouvelle affectation la remplace.
English
Now you try
- Declare an integer, store a value with
←, and output it.
Français
À vous maintenant
- Déclarez un entier, stockez une valeur avec
←, et affichez-la.
Declare Total as an INTEGER, store 8, and output it. · Déclarez Total comme INTEGER, stockez 8, et affichez-le.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.
Declare Counter as an INTEGER. Start it at 0, add 1, and output it. · Déclarez Counter comme INTEGER. Commencez à 0, ajoutez 1, et affichez-le.
Click Run to see the output here. · Cliquez sur Exécuter pour voir le résultat ici.