diff --git a/examples/01_variables.peb b/examples/01_variables.peb new file mode 100644 index 0000000..250b216 --- /dev/null +++ b/examples/01_variables.peb @@ -0,0 +1,6 @@ +let var1 = 13 +let var2 = "Hello" +let var3 = false +let var4 = var3 +var4 = var2 +var3 = null \ No newline at end of file diff --git a/examples/02_operations.peb b/examples/02_operations.peb new file mode 100644 index 0000000..fcc1707 --- /dev/null +++ b/examples/02_operations.peb @@ -0,0 +1,5 @@ +let a = 4 +let b = 5 +let c = a + b +c *= 7 +let d = (3.2 - 0.2) + 4 * 6 / 2 diff --git a/examples/03_comparisons.peb b/examples/03_comparisons.peb new file mode 100644 index 0000000..ceaa2aa --- /dev/null +++ b/examples/03_comparisons.peb @@ -0,0 +1,9 @@ +let a = 5 +let b = 7 + +let equal = a == b +let not_equal = a != b +let less = a < b +let more = a > b +let less_eq = a <= b +let more_eq = a >= b diff --git a/examples/04_if_else.peb b/examples/04_if_else.peb new file mode 100644 index 0000000..7552429 --- /dev/null +++ b/examples/04_if_else.peb @@ -0,0 +1,18 @@ +let age = 14 + +if age >= 18 { + print("You are an adult") +} else { + print("You are a child) +} + +let guess = 12 +let secret = 14 + +if guess == secret { + print("You guessed the secret !") +} else if guess < secret { + print("You're too low") +} else { + print("You're too high") +} \ No newline at end of file diff --git a/examples/05_loop.peb b/examples/05_loop.peb new file mode 100644 index 0000000..f2b7a9d --- /dev/null +++ b/examples/05_loop.peb @@ -0,0 +1,17 @@ +for i from 1 to 5 { + print(i) +} + +for j from 0 until 10 by 2 { + print(j) +} + +for k to 4 { + print(k) +} + +let l = 0 +while l < 10 { + print(l) + l += 3 +}