-
Notifications
You must be signed in to change notification settings - Fork 0
Example Scripts
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.
The classic "hello world" to demonstrate how to write to the screen.
Python:
print("hello world")
Verboscript:
show hello world.
display hello world.
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.
Python:
a = 30
b = 40
if a > b:
print("a is larger than b")
elif a == 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".
using the recursive formula: xn = xn-1 + xn-2
Python:
first = 1
second = 1
for x in range(100):
next = first + second
first = second
second = next
print(next)
Verboscript:
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.