mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-09 23:43:16 +02:00
Create YesNt basics explantation
+99
@@ -0,0 +1,99 @@
|
|||||||
|
# Hello World
|
||||||
|
|
||||||
|
Creating a hello world program in YesNt is very sample:
|
||||||
|
```
|
||||||
|
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`
|
||||||
|
|
||||||
|
## `cwl` (Console Write 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.
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Creating a hello world program in YesNt is very sample:
|
|
||||||
```
|
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user