Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is not complete,
- Here is the documentation so far
- (it is also commented into the source code)
- Data Types (kinda):
- Everything defaults into a string
- numbers default into ints (I will problably change that to floats sometime)
- To create a string (that is more then one word) the syntax is:
- " words words words "
- (Note the space inbetween " and words.)
- Keywords and stuff:
- display (the print statement) "disp"
- disp words
- words
- disp 3
- 3
- if statement. syntax is "if true do this end"
- if true disp words end
- words
- if false disp words end
- (nothing prints)
- while loop.
- Syntax:
- while true
- do this
- do this
- end
- while whatever follows while is true, the code inside will loop.
- dotims.
- dotims (as in, do times) is similar to the while loop.
- repeats a line of code x amount of times (where x is an int)
- Syntax:
- dotims 3 do this end
- (this would 'do this' three times)
- comments.
- code code // this is a comment
- (NOTE: NOTICE THE SPACE BETWEEN // AND THE COMMENT)
- D! prints the dictionary of stored values and functions
- L! prints the line (usually used for debugging)
- Oporators/Calculations:
- Right now I only have +, - and =
- + works with ints and strings
- disp 3 + 3
- 6
- disp hello + world
- helloworld
- disp three + 3
- three3
- - works with ints but not strings
- disp 3 - 3
- 0
- disp 3 - 4
- -1
- disp 4 - 3
- 1
- * multiplication works with ints and strings
- disp 2 * 2
- 4
- disp hello * 2
- hellohello
- / devision, works with ints, allways rounds down
- disp 12 / 4
- 1
- disp 12 / 5
- 2
- % mod, works with ints,
- returns the remainder when devinding two numbers
- disp 13 % 4
- 1
- = will place either "true" or "false" in its place
- disp 3 = 3
- true
- disp 3 = 3 = false
- false
- > and <, greater then, less then. puts either true or false in its place
- disp 2 > 3
- false
- disp 2 < 3
- true
- NOTE: CALCULATIONS ARE ALWAYS DONE LEFT TO RIGHT.
- I KNOW IT CAN BE A PAIN IN THE ASS BUT DEAL WITH IT
- Functions and variables:
- All functions and variables are stored in a dictionary called d
- Variables are a single word (int or sting) saved to another word.
- Syntax:
- x -> 3
- d would be {"x":3}
- x -> word
- d would be {"x":"word"}
- x -> " this is x "
- d would be {"x":"this is x"}
- Functions are a series of words saved to a single word.
- Syntax:
- helloworld : disp " hello world " ;
- d would be {"helloworld": ["hello world", "disp"] (NOTE: it stores it backwards, read the source code if you are interested in why)
- typing helloword would put ' disp "hello world" ' in the line in its place
- Notes:
- I have grown acustom to starting all scripts with author -> " Wesley "
- and ending each script with D! so running the script will tell the author
- If something doesnt seem to work, try putting every command on a new line.
- I am still building/exploring the language myself, so be patient.
- -Wesley Wooten
Advertisement
Add Comment
Please, Sign In to add comment