-
Notifications
You must be signed in to change notification settings - Fork 0
Variables Math and RNG
egyptron edited this page Sep 24, 2026
·
1 revision
Awake Simple S1 provides dynamic typing (integers, strings, and booleans), a full PEMDAS arithmetic parser, and inclusive random number generation.
Variables are declared and updated using set variable:
set variable <name> = <value>
note: Integer
set variable player_hp = 100
note: String
set variable hero_name = "Kaelen"
note: Boolean
set variable is_alive = true
Strings and variables can be merged using the + operator:
set variable score = 450
display("Player " + hero_name + " has a score of: " + score)
The engine evaluates complex mathematical formulas adhering strictly to order of operations:
-
Parentheses
() -
Multiplication
*, Division/, Modulo% -
Addition
+, Subtraction-
Variables can be placed directly within arithmetic expressions:
set variable base_atk = 25
set variable gear_bonus = 15
set variable enemy_armor = 8
set variable total_damage = (base_atk + gear_bonus) * 2 - (enemy_armor / 2)
display("Calculated Damage: " + total_damage)
Quickly increment or decrement numeric variables:
increase variable <name> by <amount>
decrease variable <name> by <amount>
set variable gold = 50
increase variable gold by 25
decrease variable gold by 10
display("Current Gold: " + gold) note: Outputs 65
Generates an inclusive random integer between minimum and maximum bounds:
pick random number between <min> and <max> into variable <target_variable>
pick random number between 1 and 20 into variable d20
display("Dice Roll: " + d20)
statement(start)
if variable d20 == 20 then
display_success("NATURAL 20! Critical Hit!")
else
display("Standard attack executed.")
statement(end)