A simple text based programming language made in scratch! Enjoy! READ THIS BEFORE USING!!! Here is a quick rundown of how the language works: --Writing commands: Each line is one command, for example, "out" prints an output to the console. To write a command, first write its name like this: sum -Then add any necessary inputs for the command in parentheses: sum(1, 1) -That command tells the interpreter to calculate 1+1 and save it in the variable "math.sum" to be used later. -Typing an @ before an input will get the value of the variable with that name. For example: out(@number) prints the value of the "number" variable. --Command list: -#(string): this is a comment and will be ignored by the interpreter. -in(variable,string): takes a user input and stores it in a variable. -out(string): prints text to the console. -var(name): creates a variable with the name given by the "name" argument. -set(variable,value): sets a variable to a given value. -rand(variable,min,max): generates a random number and stores it in a variable. -sum(number1,number2): calculates the sum of two numbers and stores it in the variable "math.sum". -sub(number1,number2): calculates the difference of two numbers and stores it in the variable "math.sub". -mul(number1,number2,variable): calculates the product of two numbers and stores it in the variable "math.mul". -div(number1,number2): calculates the quotient of two numbers and stores it in the variable "math.div". -if(value1,boolean_opperator,value2): executes the code inside if a condition is met. (must be terminated by an end command) -loopif(value1,boolean_opperator,value2,line_num): skips to a specific line if a condition is met. -end(): ends the program (or if/loop statement). (must be at the end of the program) --Lists: -To define a list use the "list" comand like this: list(list_name) -To add items to the list use the "app" command like this: app(item_to_add,list_name) -To delete items from the list use "del": del(index,list_name) -To get an item from a list, use the "get" command: get(list_name,index), Then to use the item, type @list.item to use it's value as an argument. -Here is an example program to get started with lists: list(my_list) app(1,my_list) app(2,my_list) get(my_list,1) out(@list.item) get(my_list,2) out(@*item) --Time commands: -The time module has many functions for time-related things, for example use time.start() to start updating the current time. -To pause the program for a certain amount of time use time.wait(time_in_seconds) -To get the current time/date you can use the following variables: -.date is the current date -.month is the current month -.year is the current year -.hour is the current hour -.min is the current minute -.sec is the current second -.runtime is the amount of time the program has run for in seconds you can reset this timer using time.start() -Please note that none of these variables will be set until time.start() is run.
This language was based off of Python, BASIC and C++. It's also the language I used for an operating system I made: https://scratch.mit.edu/projects/1311023810/ Please feel free to share programs you create in the comments, I'd love to see what you make with this. Changelog: -Added commands for creating and interacting with lists -Added commands for pausing for an amount of time as well as get the current time -Added variables to save the output of commands like sum, sub, mul and div. -Improved performance, Added parameters to functions Another example program: #(Guess the number game) var(guess) var(correct) var(guesses_left) var(running) set(guesses_left,5) rand(correct,1,10) set(running,1) out(I am thinking of a number between 1 and 10.) #(start of main loop) out(Guesses left:) out(@guesses_left) in(guess,Take a guess:) if(@guess,=,@correct,2) out(You guessed it!) set(running,0) if(@guess,!=,@correct,2) out(Thats not it!) sub(@guesses_left,1,guesses_left) if(@guesses_left,<,1,2) out(Game Over!) set(running,0) loopif(@running,=,1,10) end()