Calling functions
Functions are a foundational part of most programming languages. In ink, a function is a subset of code that can accept input separated by commas, may produce output, and can be accessed through an operation called calling.
A function is called by using its name and then opening ((
) and closing ()
) parentheses. The operation of calling a function in ink temporarily moves the flow of the story to the code of a function and then returns it when the code finishes.
Note
Functions can only be called when used within code in ink. This means they either appear within opening and closing curly brackets or on lines starting with the tilde (~) as part of variable reassignment.
In this topic, we will start by reviewing some functions that are built into ink and how they can help us with common operations. Next, we will look at functions that have been designed to work exclusively with values created with the LIST
keyword. These functions perform common operations...