//////////////////////////////////////////////////////////////////////////////////////-------------------------------- U++ --------------------------------- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Hello, this is a basic text based programming language (it's Turing complete and I'll still improve it soon !!) Please read all or you'll get errors without understanding... The code already here is the 3x+1 problem, have fun with it... This language is so fast that it can perform around 10 operations/second (yeah... that's really slow...) If you press the green flag the memory will be delet (every variables/functions will be remove), use ';' to make a new line. You can also enter 'clear()' to clear the console [built-in imports and functions are at the end] # What you can do : - doing basic arithmetic (+,-,*, / and %); - set varibles (using : [name] = [value]); [only supported type : int, float, strings, functions and lists (use negative number by entering : "0 - [your number]" ] - supported string literal : ["] and [']; - use bools (operators : '==', '!=', '<', '<=', '>', '>=', 'and' and 'or'); - use 'True','False' and 'None' (the upercases are not needed); - use 'if' (like that : if cond{...}(else{...})); - use loops (enter: for name=int to int{...}); - use while loops (enter while cond{...}); - use comments (start with /* and end with */); - create function (enter: def name(arg1,arg2...){...}); - use the 'return keyword (enter: return value); - call functions (enter: name(arg1,arg2...)); - use lists (enter : [item1,item2...] like the python list); - access and assign items (enter name[index](=...)); - delete a variable (enter : del name,name2...); - import modules (enter : import name); - use the ';' to make a new line; /!\ You can use the ';' to make a new line /!\ You can create functions inside functions that won't appear outside the function /!\ Recursion does work now !!! /!\ The 'return' keyword doesn't like to take too much (can make bugs in your programs) /!\ DO NOT USE THE del name[index], it will enter in a forever loop... /!\ there is no buit-in function for the 'not' operation but you can create one by entering : def not(bool) {return bool == 0;} Buit-in functions (taking only one argument): - int(*) => int - float(*) => float - str(*) => str - list(*) -> list (return a list made of the argument) - type(*) => str (type of an object) - len(*) => int (return the length of a list or a string) - print(*) => 0 (print an object) - input(*) => str (take an input from the user) - Exception(*) => Error (raise an error) - isDigit(*) => 0/1 (return 1 if the number can be an int and 0 otherwise) - sqrt(*) => float (return the square root of a number) [cos,sin and tan are working with degres not radiants] - cos(*) => float - sin(*) => float - tan(*) => float - exp(*) => float (return e^n) - ln(*) => float (return ln(n)) Taking 0 argument : - clear() => 0 (clear the console) - time() => float (return the days since 2000) Taking 2 arguments: - random(*,*) => int/float (return a random number between the 2 arguments) /!\ modules (only one for now): - math : functions : abs(n), log(base,n), pow(base,n), floor(n), ceil(n), round(n); constant : pi; That's it for now (I'm working on loading programs)
Everythings by me, More improvement soon Turbowarp to run faster : https://turbowarp.org/775354326?turbo Comment if you find any bugs... U++ stand for Useless++, cause you gessed it, it's a useless language but that was fun to make. Change log : - v0.0.1 : made a lexer, parser and an interpreter using the postfix method; - v0.1 : added variables; - v0.1.1 : added bools; - v0.2 : added the if statements; - v0.3 : added the loops; - v0.3.1 : fixed the loops (the if inside loops) and errors; - v0.4 : added the while loop; - v0.5 : added strings, else case and comments; - v0.6 : added functions; - v0.6.1 : fixed function return and call functions inside function; - v0.6.2 : fixed re-defined buit-in function; - v0.6.3 fixed loop for special cases (like 1 or 0); - v0.6.4 : added that you can set functions inside functions; - v0.7 : remade the function system (fixing all bugs); - v0.8 : added lists; - v0.8.1 : added strings access and some buit-in functions; - v0.8.2 : added representations for functions and lists; - v0.9 : added imports; - v1.0 : added a little interface and a thumbnail; - v1.0.1 : found and fixed the not running while loop; - v1.0.2 : added the '%' operator; - v1.0.3 : (finally) added the not operation and fixed the bug with the '&' symbol; [well don't mind this :] #programming #useless #u++ #language #math #python #c #c++ #java #css #html #javascript #game #tutoriel #interpreted #calculator #compiled #recursion #variable #function #parse #lexer