Browse Source

Add readme

pull/2/head
Stephen 4 months ago
parent
commit
c03c9329ff
2 changed files with 65 additions and 0 deletions
  1. +65
    -0
      README.md
  2. BIN
      example.png

+ 65
- 0
README.md View File

@ -0,0 +1,65 @@
# cat-disruptor-6500
A Discord bot that reacts to certain messages with certain emojis. More importantly, it also lets you write code!
## Commands:
!START - start the interpreter
!STOP - stop the interpreter
LIST - list all code in memory
SAVE filename - save code into database
LOAD filename - load filename into memory
Code is specified by writing `line_num code`. For example, `10 print "hello world"`. This makes it easy to insert new code or overwrite lines.
### Example session
```
!START
10 for x in 0 to 10
20 print x
RUN
> expected NEXT after FOR statement. # oops - we forgot a line
30 next x
LIST
> 10 for x in 0 to 10
> 20 print x
> 30 next x
RUN
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
# actually, let's print them all on the same line
5 a = ""
20 a += x
LIST
> 5 a = ""
> 10 for x in 0 to 10
> 20 a += x
> 30 next x
RUN
012345678910 # oops - let's add spaces
20 a += " " + x
RUN
> 0 1 2 3 4 5 6 7 8 9 10 # awesome! let's save this program
SAVE count_to_ten
> Saved as count_to_ten
```
The interpreter can execute arbitrary code safely - it includes CPU and memory limits. For information on syntax, check out the xBASIC interpreter: https://git.scd31.com/stephen/xbasic
It even does graphics!
![Example session](https://git.scd31.com/stephen/cat-disruptor-6500/raw/branch/master/example.png)

BIN
example.png View File

Before After
Width: 878  |  Height: 1190  |  Size: 135 KiB

Loading…
Cancel
Save