You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
In this chapter you will learn how to use Tic's if-statements. The variations of said statement, including if-else, if-elseif-else, etc. will also be discussed. Comparisons will too be addressed in this chapter.
The If Keyword
First things first: The If keyword. This keyword is the very foundation of any if-statements you'll be writing! Here's an example:
If true Then
PrintLine "true!"
EndIf
It's no mystery what this piece of code does. It prints "true!".
Let's move up to a bit of a "higher" level... If-else-statements! (wooooow...)
If false Then
PrintLine "this won't be printed!"
Else
PrintLine "but this will..."
EndIf
Again, no mystery what this does.
Since you're probably already familiar with this kind of stuff in other languages I'll just show you the rest.
If 1 == 2 Or 1 == 3 Then
PrintLine "won't be printed!"
ElseIf 1 == 4 And 1 == 5 Then
PrintLine "won't be printed!"
Else
PrintLine "but this will!"
EndIf
No rocket science right? Let's do some control flow stuff!