-
Create a file named
first.bts
-
Type in:
exit 3
- Compile and run:
bts run first.bts
- Check that the exit code was indeed
3
:
echo $?
-
Create a file named
hello.bts
-
Type in:
const hi = "Hello, World!", 10
write(hi)
- Compile and run:
bts run hello.bts
- The output should be:
"Hello, World!"
- Compile hello.bts from project 2:
bts build hello.bts
- Observe that the resulting executable is tiny:
bts size hello.bts
- Run it:
./hello
- Clean up by removing all the generated files:
bts clean
- Add this at the top of
hello.bts
:
#!/usr/bin/bts
- Make it executable:
chmod +x hello.bts
- Run it as a script:
./hello.bts
- Create
loop.bts
- Type in:
const hi = "Hello there", 10
fun main
loop 7
print(hi)
end
end
"Hello there", 10
is the same as "Hello there\n"
since '\n'
has ASCII value 10.