The chains

The chains

> Tutorial

The chains

Character strings are a type of value used to represent text.

A string is written between single or double quotes:

String operations

Only one operator is available on the strings, it is +, the concatenation operator, which will "glue" two strings together:

Many functions are available for strings, in the "Strings" part of the documentation, the main ones are:

Examples of use:

Salute your opponent

Several standard functions use strings, such as getName, which returns the name of an entity. We'll use it to greet our opponent on turn 1:

The say function allows your leek to say something, it costs 1 TP . As you may have guessed, the sentence that our leek will say will be for an enemy Domingo: "Hi Domingo!". Do not hesitate to personalize it, remaining polite!

❓ Quiz

What is the result of the code "10" + 5 + "aa"?

"105aa" "15aa" "10aaaaaaaa" "15aaaaa"

What is the result of the code substring("eucalyptus", 4, 3)?

"lyp" "euc" "ptus" "euca"

Full AI