BynixScript provides examples for those of you who want to learn BynixScript. 1. Condition statements:
var myAge = 12
if myAge.is_type === "number":
if myAge > 18 || myAge === 18:
print("Adult")
else:
print("Child")
end
else:
print("Value must be a number.")
end2. Function Declaration:
func greeting(message):
print(message)
end
greeting("Hey, There!")3. Loop statements:
for i=0 to 10:
print("Loop to " + i)
if i > 5:
print("Loop stops")
break
end
end4. Error Handling:
handle:
print("My name is " + name)
recovery (err):
if err.is_error === "type":
print("TypeError: " + err.message)
elif err.is_error === "reference":
print("ReferenceError: " + err.message)
end
end5. Flow control:
const choice = 0
match choice:
case 1:
print("Just one!")
break
case 2:
print("Just two!")
break
default:
print("No choice.")
end