> Tutorial
You have seen that it is possible to manipulate numbers, but the LeekScript also has special values: null and booleans.
null valuenull is a value representing an empty, invalid or even an error value, but it is different from the number 0.
For example, the getWeapon() function returns the weapon your leek is holding, or null if you don't have a weapon in your hands.
You may have noticed that setWeapon() costs 1 TP per turn. It is possible to limit its use to turn 1 with this condition:
true and falseBooleans are two values: true and false. These are two values that can be used to represent something that can have two states like:
Examples of functions that use booleans:
true if the chip needs a line of sight, false otherwise (like the chip Spark).true if the entity is alive and false otherwise.Example: we check if a chip needs a line of sight:
What can null be used for?
Representing a lack of information/value Represent the number 0 Represent an error Representing a poor quality program
What are booleans for?
Represent a value with two possible states Represent a very high value
Impossible de charger les données du jeu.
Vérifiez votre connexion et réessayez.