Posted 02 January 2015 - 05:25 PM
WBASIC
A BASIC interpreter for ComputerCraft.
(PLEASE DO NOT PM ME OR COMMENT ABOUT NOT LIKING BASIC!)
Hello fellow Computers and Crafters! Today I bring you the really really early version of WBASIC!
WHAT IS WBASIC?
WBASIC is a programming language inspired by BASIC.
WHERE CAN I GET IT?
you can find it on pastebin by typing "pastebin get tW4vDUAF WB" on any computer.
WELL HOW DO I USE IT?
YOU RUN A PROGRAM BY SAVING CODE IN A FILE, STARTING WBASIC,
AND TYPING IN THAT FILE'S NAME!
SIMPLE DOCUMENTATION:
Spoiler
PRINT: prints text and goes to next line
WRITE: prints text without new line
GOTO: jumps to a line
SLEEP: delays in tenths of seconds
SET: sets variable in arg 1 to value in arg 2
GOIF: if arg1 is equal to arg2 then goto arg3
READ: reads a string and stores it in arg1
READNUM: same as READ but gets a number
SETCURSOR: sets cursor pos to arg1, arg2
FGC and BGC: set text and back color to color
specefied in string arg1.
GETKEY: waits until keypress or for arg1 sec.s
stores key or string "nil" in var "ret1"
ADD, SUB, MUL, POW, and DIV: perform basic
math operations on arg1 and arg2,
returning result to var "ret1"
REDSTONE:
REDSTONE "R":
reads signal on side of first argument and stores to "ret1"
REDSTONE "S":
sets side (first arg) to output a redstone signal with the
intensity found in the second argument.
MODEM:
MODEM "S":
SEND MODE(EG. MODEM "S","MESSAGE","KEY")
OR MODEM "S","message",[number channel]
OR JUST MODEM "S","MESSAGE" TO BROADCAST!
MODEM "R":
RECEIVE MODE
WAITS FOR REDNET MESSAGE TO COME IN TO MODEM AND THEN
SETS VARIABLES "ret1" and "ret2" to the sender ID and the message, respectively
MODEM "O":
OPENS MODEM ON SIDE OF FIRST ARG( EG. "MODEM "O" "top" )
MODEM "C":
SAME AS MODEM "O" BUT CLOSES MODEM
DATA TYPES:
"STRING" <–string
{VAR} <–variable recall statement (value of variable called var)
1337 <–number(NO DECIMALS OR NEGATIVES YET!
IF NEEDED PLEASE USE A MATH FUNCTION!)
Thanks to squiddev for showing me how to make a spoiler XD
Edited on 16 February 2015 - 12:59 PM