version 0.1

This commit is contained in:
Hans 2021-11-17 19:19:49 +01:00
parent eddfeb7bfc
commit dbfdde72ab
20 changed files with 740 additions and 55 deletions

9
examples/faculty.bisc Normal file
View file

@ -0,0 +1,9 @@
PRINT "This program calculates the faculty of a number."
ASSIGN 1 fac
NUMIN "Please input your number!" num
ASSIGN num i
MUL fac i fac
SUB i 1 i
GOTO 5 i
PRINT "The faculty of " num " is " fac "."
EXIT

11
examples/fibonacci.bisc Normal file
View file

@ -0,0 +1,11 @@
ASSIGN 8 n
ASSIGN 0 a
ASSIGN 1 b
PRINT a
ADD a b a
PRINT a
ADD a b b
PRINT b
SUB n 1 n
GOTO 5 n
EXIT

View file

@ -0,0 +1,13 @@
PRINT "Welcome to the number guessing game!"
RAND 100 number
NUMIN "Please input your guess!" guess
EQUAL number guess is_equal
GOTO 12 is_equal # win if equal
SUB number guess is_less
GOTO 10 is_less
PRINT "Too big! Try again!"
GOTO 3 1
PRINT "Too small! Try again!"
GOTO 3 1
PRINT "Correct! The number was " number "."
EXIT

View file

@ -1,2 +1,2 @@
print #hello_world
print 1.01234
PRINT "Hello world!" # This is a comment
EXIT

5
examples/numbers.bisc Normal file
View file

@ -0,0 +1,5 @@
ASSIGN 10 i
PRINT i
SUB i 1 i
GOTO 2 i
EXIT

11
examples/test.bisc Normal file
View file

@ -0,0 +1,11 @@
PRINT "Hello World, this is a number: " 15
ASSIGN number 15
PRINT "Let's double it's value, shall we?"
ADD number number number
PRINT "There we go: " number
PRINT "Now, what if we multiplied it by 5?"
MUL number 5 number
PRINT number
PRINT "Not bad :)"
PRINT "The program will now terminate!"
EXIT