Rouge Documentation Help

Fundamental data types

Previously, we only used numbers in our program. We learnt that we can use integers as well as real numbers. However, most programming languages, such as Rouge, allow you to work with more complex kinds of data. These kinds of data are referred to as Data Types. In this chapter, we will learn about two other important data types.

Boolean

Aside from numbers, the second important data type is called Boolean. Even though it has a strange name, it is very straightforward to understand and work with. A Boolean describes whether something is true or false. For instance, you might be building a software that allows users to look at train departure times. To see whether a train will arrive late or not, you might save this information in a variable called is_late. When the train company notices that a train is running late, the variable can be set to true such as is_late = true. In case the train speeds up and the train company thinks the train is going to make its scheduled arrival time, the variable can be set back to false such as is_late = false.

// the train is running late is_late = true // the train has caught up is_late = false

The reason why the Boolean data type is so simple is because it can only ever have one of two values (true or false). This is different from numbers, because (for now) you can think of Number as a data type that can have an infinite number of possible values (essentially any rational number you can imagine).

String

The third data type we will learn about is called String. A String contains text. The name String stems from the fact that a piece of text is nothing more than a sequence, or string, of characters. To create a String, surround any text you would like to save in variable in double quotes such as name = "Jess". Strings are not limited to letters, they can include any character you can type on your keyboard. For instance, you might save someone's address in a variable using a String.

address = "Main Street 4 73948 Rouge-City"

Combining fundamental types

The data types introduced in this chapter are referred to as fundamental because all further data types that can be used with Rouge comprise of these fundamental data types. For now, we will continue to work with these basic, fundamental data types. However, for your reference, more complex data types are introduced in Creating your own types

Last modified: 07 January 2026