Basics - Stone-Red-Code/YesNt-Interpreter GitHub Wiki
Hello World
Creating a hello world program in YesNt is very simple:
cwl Hello World!
Note:
cwl
stands for "Console Write Line" and prints everything to the console which comes after it and appends\n
to it
Printing to the console
There are two statements which can print text to the console
cw
(Console Write)
Prints everything to the console which comes after it
Example
cw Hello
cw World
Output:
HelloWorld
cwl
(Console Write Line)
Prints everything to the console which comes after it and appends \n
to it
Example
cwl Hello
cwl World
Output:
Hello
World
Reading from the console
You can read either a whole line or a single char from the console using the following statements:
%cr
(Console Read)
Replaces the statement through a single character read from the console
Example
cwl %cr
Input
A
Output
A
%crl
(Console Read Line)
Replaces the statement through a whole line read from the console
Example
cwl %crl
Input
Cool Text
Output
Cool Text
Variables
Declaring/Assigning variables
You can declare/assign variables by using the <
sign followed by the variable name and an equals sign
Example
<myVariable = myValue
Reading variables
You can get the value of a variable by using the >
sign followed by the variable name
Example
<myVariable = myValue
cwl >myVariable
Output
myValue
Next steps
These where the bare basics of YesNt. Check out the next article to learn more.