• Home
  • News
  • Forum
  • Games and Apps
    • Web Bot API>
      • Try it
    • Leumas programing language
  • My animations
    • Ducksy Stuffy
  • Tutorials
    • Coding>
      • HTML>
        • Getting started
        • Introduction to HTML
      • Leumas programming language>
        • Introduction to Leumas programming language
        • Basic hello world and message_box
        • The prompt and variables.
        • Math operators and more variables
        • If statment and more math operators
  • Pauline - Assistant
Previous Section

If statement and more math operators

The if statement is similar to most coding languages.

So if you've coded before you already know how to.
But we are gonna learn anyways.

Here is an example of the if statement.

Code example:

  1. if variable='value'
  2. {
  3. message_box('do this')
  4. }


Ok so imagine i have already assigned a value to the variable variable.
This value will be 'value'.
So now it will see if variable is equal to 'value'.
If it is it is gonna execute the commands in the curly brackets.
Now if variable is equal to 'val' then it is not gonna execute the commands in the curly brackets.
Why? Because 'val' is not equal to 'value'.
You can also do the if statement with numbers and math operations.

Code example:

  1. if 1+2=3
  2. {
  3. message_box('is equal to 3')
  4. }


Since 1+2 is equal to 3 it will execute the commands in the curly brackets.
What if the 1 was a 2.
It would have not executed the code because 2+2 is equal to 4 not 3.
Powered by
✕