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
Jack Lloyd-Walters edited this page Jul 8, 2021
·
6 revisions
The following is a collection of example scripts that showcase how Verboscript works:
Note: As verboscript is still a W.I.P, these are subject to change.
Write to screen
The classic "hello world" to demonstrate how to write to the screen.
Python:
print("hello world")
Verboscript:
show hello world.
display hello world.
Fetch and display user input.
Python:
x=input("What is your name?\n> ")
print("your name is", x)
Verboscript:
ask "What is your name?" and store the response in x.
show your name is x.
Compare two values using an if-elif-else block
Python:
a=30b=40ifa>b:
print("a is larger than b")
elifa==b:
print("a is equal to b")
else:
print("a is smaller than b")
Verboscript:
set a to 30. set b to 40.
if a is greater than b, then:
show "a" is larger than "b".
alternatively, if a is equal to b:
show "a" is equal to "b".
otherwise, do the following:
show "a" is smaller than "b".
set first and second equal to 1.
repeat the following one hundred times:
make next equal to first plus second.
set first equal to second, and second equal to next.
show next.