endbasic 0.10.0

The EndBASIC programming language - CLI
[?25l
 EndBASIC tour: Welcome!
=========================

Welcome to the EndBASIC tour demo program.  I'm glad you have made it this far!

EndBASIC is an interpreter for a BASIC-like language and is inspired by
Amstrad's Locomotive BASIC 1.1 and Microsoft's QuickBASIC 4.5.  The main idea
behind EndBASIC is to provide a playground for learning the foundations of
programming in a simplified environment.

EndBASIC is written in Rust and is proven to work on Linux, macOS and Windows.
It likely works on other Unix systems too.  And, thanks to WASM, it also runs
on the web--which I bet is how you are reading this right now.

If you are accessing EndBASIC via the web interface, please be aware that
this interface is highly experimental and has many rough edges.  In particular,
things will go wrong if you try to resize the browser window.  Just reload
the page for a "reboot".

When not in the tour, use the HELP command to access the interactive help
system.

Without further ado, let's get started!

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: Language basics
================================

There are four primitive types: booleans (?), double-precision floating
point numbers (#), 32-bit signed integers (%), and strings ($).

The common IF and SELECT CASE conditional structures, the DO, FOR, and WHILE
loops, as well as GOSUB and GOTO are supported.

A trivial program to ask a question and print an answer would look like:

    @retry: INPUT "Enter a number greater than 10: ", n
    IF n <= 10 THEN GOTO @retry
    PRINT "Good job!"

Type HELP "LANG" for specific details about the language constructs.

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: File manipulation
==================================

Given that you are reading this tour, you have already encountered how to
load a program and run it.  But here is how you'd go about creating a new
program from scratch:

1. Type NEW to clear the machine's program and variables.
2. Type EDIT to enter the full-screen editor.
3. Type your program in the editor and then press ESC to exit.
4. Optionally save your program with SAVE "some-name.bas".
5. Run the program with RUN.
6. Repeat from 2 if things don't go as planned.

The cycle above works for demos too.  You can LOAD any demo program and
enter the interactive editor with EDIT to see and modify its code.  What
you cannot do is save them under their original name; you will have to pick
a different name.

If you are in the browser, rest assured that all programs are stored in
your browser's local storage.  Nothing goes to the cloud.

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: The file system
================================

In the previous page, you learned how to create files and how to save and
load them.  Those examples used relative paths.  However, EndBASIC supports
multiple drives (although it does not yet support directories).

Paths in EndBASIC have the form DRIVE:FILE or DRIVE:/FILE.  Given that
directories are not yet supported, both are equivalent, but their meaning
might change in the future.  All commands that operate on paths accept these
syntaxes.  Note that the DRIVE: part is optional: when not specified, the
current drive (shown by the DIR command) will be used.

You can use the MOUNT command to display the list of currently-mounted drives
and to attach new ones.  Pay attention to the default MOUNT output as it
shows some of the possible URIs you can use to mount other drives.
For example, if you want to gain access to an arbitrary directory in the
system, you could do:

    MOUNT "TMP", "file:///PATH/TO/TMPDIR"
    CD "TMP:/"

Pay attention to the double quotes surrounding these arguments: these are
EndBASIC commands and thus you must provide the arguments as strings.  You
are bound to trip over this a few times due to muscle memory...

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: Screen manipulation
====================================

You have several commands at your disposal to manipulate the contents of
the screen.  Visual features are particularly interesting for teaching
purposes, so expect more in this regard.

For example, we can print the foundational colors by selecting them with
the "COLOR" command and positioning the cursor with "LOCATE":

This is color 0
This is color 1
This is color 2
This is color 3
This is color 4
This is color 5
This is color 6
This is color 7
This is color 8
This is color 9
This is color 10
This is color 11
This is color 12
This is color 13
This is color 14
This is color 15

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: Hardware access
================================

If you happen to be running on a Raspberry Pi, EndBASIC has some support
to manipulate its hardware.  At the moment this includes only basic access
to the GPIO lines.  See the "DEMOS:/GPIO.BAS" demo for an example.

Please note that you have to be running on a Raspberry Pi *AND* you must
have compiled EndBASIC with --features=rpi for this to work.

Press ENTER to continue or ESC to exit the demo...[?25h[?25l
 EndBASIC tour: Enjoy
======================

And that's it for the tour.  You can now type EDIT to see the code that
took you over this journey, load other demo files or... just go forth and
explore.  HELP, MOUNT, and DIR are your friends at any point, but so that
you don't feel too lost, run this now:

    CD "DEMOS:/"
    DIR

If you like what you have seen so far, please head to the project's GitHub
page and give it a star:

    https://github.com/endbasic/endbasic/

Then, visit my blog and subscribe to receive fresh EndBASIC content or...
you know, to keep me motivated in writing stuff and building this project:

    https://jmmv.dev/

Thank you! :-)

-- Brought to you by Julio Merino <jmmv@>
[?25h