Skip to content

Commit 842fe0a

Browse files
Merge with docs
1 parent 7988563 commit 842fe0a

9 files changed

Lines changed: 2695 additions & 0 deletions

File tree

docs/API-Docs.md

Lines changed: 492 additions & 0 deletions
Large diffs are not rendered by default.

docs/EZCode-Docs.md

Lines changed: 1438 additions & 0 deletions
Large diffs are not rendered by default.

docs/EZProject-Docs.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# EZProj
2+
3+
<details open>
4+
<summary>Directory</summary>
5+
6+
- [Syntax](#syntax)
7+
- [Properties](#properties)
8+
- [Variables](#vars)
9+
- [Comments](#comments)
10+
- [Code Seperation](#code-seperation)
11+
- [Examples](#examples)
12+
</details>
13+
14+
## Syntax
15+
16+
The Syntax is simple,
17+
```
18+
name:"Hello World Test"
19+
icon:"~/icon.ico"
20+
startup:"~/Main.ezcode"
21+
```
22+
It's the [property](#propery), a colon `:`, and then the value in quotations `""`.
23+
24+
## Properties
25+
26+
<details open>
27+
<summary>Properties</summary>
28+
29+
- [Clearconsole](#clear-console)
30+
- [Closeonend](#close-on-end)
31+
- [Debug](#debug)
32+
- [Exclude](#exclude)
33+
- [Fileinerror](#file-in-error)
34+
- [Icon](#icon)
35+
- [Include](#include)
36+
- [Isvisual](#is-visual)
37+
- [Name](#name)
38+
- [Showbuild](#show-build)
39+
- [Startup](#start-up)
40+
- [Window](#window)
41+
</details>
42+
43+
### Clear Console
44+
45+
The `clearconsole` property will clear the console before playing the program.
46+
47+
Default = "True"
48+
49+
### Close On End
50+
51+
the `closeonend` property will Stop the program when the program ends.
52+
53+
Default = "True"
54+
55+
### Debug
56+
57+
The `debug` property will Open a Debug window if the project property [Window](#window) is true. This Debug window contains a console and a quit button.
58+
59+
Default = "False"
60+
61+
### Exclude
62+
63+
The `exclude` property excludes files in the program. It takes a full or local file path (`~/` or `~\`) that has the EZCode extension `.ezcode`. It can also take `"all"` or `"folder"`.
64+
- `"all"`: will get all of the files in the current directory. It will get all `.ezcode` files including sub directories.
65+
- `"folder"`: will get all of the files in the current folder. It will not get any sub directories.
66+
67+
This is especially used when [Include](#include) proprety has `"all"` but a file or two needs to be excluded.
68+
69+
### File In Error
70+
71+
The `fileinerror` will show the file path the error occured in when an error occurers.
72+
73+
Default = "True"
74+
75+
### Icon
76+
77+
The `icon` property is the Icon of the program. It takes a file path with a `.ico` extension. The path can be local using `~/` or `~\`.
78+
79+
Default = "C:\ProgramData\EZCode\EZCode\EZCode_Logo.ico"
80+
81+
### Include
82+
83+
The `include` property includes files into the program. It takes a full or local file path (`~/` or `~\`) that has the EZCode extension `.ezcode`. It can also take `"all"` or `"folder"`.
84+
- `"all"`: will get all of the files in the current directory. It will get all `.ezcode` files including sub directories.
85+
- `"folder"`: will get all of the files in the current folder. It will not get any sub directories.
86+
87+
### Is Visual
88+
89+
The `isvisual` proprety will tell the program that the code uses the [visual-output](Programs#visual-output).
90+
91+
Default = "False"
92+
93+
### Name
94+
95+
The `name` property sets the name of the program.
96+
97+
Default = "EZCode_v{EzCode.Version}"
98+
99+
### Show Build
100+
101+
The `showbuild` property will show `Build Started` and `Build Ended` whenever the program starts and ends.
102+
103+
Default = "False"
104+
105+
### Start Up
106+
107+
The `startup` property sets the start up file for the program. Takes a full or local path (`~/` or `~\`). If there is only one file in the program, then using both `include` and `startup` is not needed, just choose one of them. See the example in [Syntax](#syntax).
108+
109+
The Default is the first file that was included. If includes `"all"`, the first on alphabetically.
110+
111+
### Window
112+
113+
The `window` property tells the program that this program uses one or more windows.
114+
115+
## Variable
116+
117+
This is a more complex use of EZProj syntax. To declare a variable, just put its name in quotation marks and the value on the other side of the colon also in quotation marks,
118+
```
119+
"varName":"value"
120+
```
121+
Then to use the variable,
122+
```
123+
isvisual:"varName"
124+
```
125+
126+
Another feature of variables is to read a file and get its value from that. It will read the file if the value side does not contain any quotations. Here is an example,
127+
```
128+
"varName":~/file.txt
129+
```
130+
131+
## Comments
132+
133+
Comments are apart of the code that doesn't run. It is started with // and the rest of that line is excluded from being executed. Here is an example, `name:"Hello World Test" // This sets the project name to 'Hello World Test' and doesn't cause any errors becaues of the presence of '//'`.
134+
135+
## Code Seperation
136+
137+
Each line of code is seperated by a newline, or the pipe character `|`. Here is an example,
138+
139+
```
140+
isvisual:"true" | clearconsole:"false"
141+
```
142+
143+
## Examples
144+
145+
Here is an example of a program that contains [windows](ezcode-docs#window).
146+
```
147+
name:"Hello World Test"
148+
window:"true"
149+
icon:"~/icon.ico"
150+
startup:"~/Main.ezcode"
151+
include:"all"
152+
```
153+
154+
Here is an example of a program that uses the [visual-output](Programs#visual-output).
155+
```
156+
name:"Visual Test"
157+
isvisual:"true"
158+
startup:"~\Main.ezcode"
159+
```
160+
161+
Here is an example of a program that just uses the [console](Programs#console).
162+
```
163+
name:"Console Test"
164+
startup:"~\Main.ezcode"
165+
```

docs/EZText-Docs.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# EZText
2+
3+
EZText is a part of [EZCode](ezcode-docs) that translates Formatted English to EZCode. The English has to be in a specific format for it to work, but it allows EZCode to be written in paragraphs. It is initiated in EZCode with the [Special Keyword](ezcode-docs#special-keywords) `# eztext start` and `# eztext end`. Here is an example,
4+
5+
```
6+
# eztext start
7+
Create a variable named X with the value of 10. If the console input is equal to AddFifty, then add 50 to X. If not, then subtract 50 from X.
8+
# eztext end
9+
```
10+
This EZText translates to the following EZCode,
11+
```
12+
var X 10
13+
var EZTEXT_GENERATED_VARIABLE : input console
14+
if 'EZTEXT_GENERATED_VARIABLE' = AddFifty : X + 50
15+
else : X - 50
16+
```
17+
18+
## Replacements
19+
20+
Some series of text is replaced when creating the different lines to execute. Here is the C# code used for this
21+
```csharp
22+
string[] lines = EZText.Replace(".", "|").Split(new[] { '\n', '|' }).Select(x => x.Trim()
23+
.Replace("is not equal to", "!=")
24+
.Replace("is not", "!")
25+
.Replace("is equal to", "equals")
26+
.Replace(" equals ", " = ")
27+
.Replace("is greater than or equal to", ">=")
28+
.Replace("is less than or equal to", "<=")
29+
.Replace("is greater than", ">")
30+
.Replace("is less than", "<")
31+
.Replace(", then ", " then ")
32+
.Replace(" then ", " : ")
33+
.Replace("[p]", ".")
34+
.Replace("[SPACE]", " ")
35+
).Where(y => !y.Equals("")).ToArray();
36+
```
37+
38+
## Syntax
39+
__Directory:__
40+
- [Add to list](#add-to-list)
41+
- [Add to variable](#add-to-variable)
42+
- [Clear list](#clear-list)
43+
- [Clear the console](#clear-the-console)
44+
- [Create list](#create-list)
45+
- [Create variable](#create-variable)
46+
- [Delete File](#delete-file)
47+
- [Destroy List](#destroy-list)
48+
- [Display messagebox](#display-messagebox)
49+
- [Divide Variable](#divide-variable)
50+
- [If](#if)
51+
- [If not](#if-not)
52+
- [Math](#math)
53+
- [Multiply variable](#multiply-variable)
54+
- [Play](#play)
55+
- [Remove from list](#remove-from-list)
56+
- [Replace in list](#replace-in-list)
57+
- [Split list](#split-list)
58+
- [Stop](#stop)
59+
- [Subtract from variable](#subtract-from-variable)
60+
- [Wait](#wait)
61+
- [Write to console](#write-to-console)
62+
- [Write to file](#write-to-file)
63+
- [Variable equals](#variable-equals)
64+
65+
---
66+
67+
### Add To List
68+
69+
The syntax for this, `Add value to list NAME`. The `NAME` is the name of the list. This will translate to `NAME add value`.
70+
71+
### Add To Variable
72+
73+
The syntax is, `Add value to Var`. `Var` is the name of the variable. This translates to `Var + value`.
74+
75+
### Clear List
76+
77+
The syntax for this, `Clear the list NAME`. The `NAME` is the name of the list. This will translate to `NAME clear`.
78+
79+
### Clear the Console
80+
81+
The syntax is simple for this, `Clear the console`. This will translate to `clear`.
82+
83+
### Create List
84+
85+
The syntax is, `Create a list named NAME` or `Crate a list named NAME with the value(s) VALUE`. The `NAME` is the name of the list and `VALUE` is the value(s) of the list. If just `value`, it will search for the next word. If `values`, it will search for everything after it. It needs to be seperated with commas `,` like in EZCode. For Example, `create a list named List1 with the values of A, B, C`.
86+
87+
### Create Variable
88+
89+
The syntax is, `Create a vcariable named NAME` or `Crate a variable named NAME with the value VALUE`. The `NAME` is the name of the variable and `VALUE` is the value of the variable. To assign the variable to other values, use `of` after `value`. Here are the following values that it can be set to,
90+
- `of if A intersects B`: This will translate to, `var NAME : intersects A B`.
91+
- `of if the file FILEPATH exists`: This will translate to, `var NAME : file exists FILEPATH`.
92+
- `of if the file path FILEPATH is valid`: This will translate to, `var NAME : file validpath FILEPATH`.
93+
- `of the console input`: This translates to, `var NAME : input console`.
94+
- `of the current keys being pressed`: This translates to, `var NAME : input key`.
95+
- `of if KEY is being pressed`: This translates to, `var NAME : input key KEY`.
96+
- `of the current mouse buttons being pressed`: This translates to, `var NAME : input mouse button`.
97+
- `of if the BUTTON mouse button is pressed`: This translates to, `var NAME : input mouse button BUTTON`.
98+
- `of the current mouse position`: This translates to, `var NAME : input mouse position`.
99+
- `of the current X/Y mouse position`: This translates to, `var NAME : input mouse position X/Y`.
100+
- `of the current mouse wheel state`: This translates to, `var NAME : input mouse wheel`.
101+
102+
Here is an example,
103+
```
104+
Create a variable named X with the value of the current X mouse position
105+
```
106+
107+
### Delete File
108+
109+
The syntax is, `Delete the file FILEPATH`. `FILEPATH` is the file path that is going to be deleted. This will translate to `file delete FILEPATH`.
110+
111+
### Destroy List
112+
113+
The syntax for this, `Destroy NAME`. The `NAME` is the name of the list. This will translate to `destroy NAME`.
114+
115+
### Display Messagebox
116+
117+
The syntax is, `Display TEXT with the title, TITLE via messagebox`. `TEXT` is the text of the messagebox and `TITLE` is the title of the messagebox. This translates to `messagebox TITLE TEXT`
118+
119+
### Divide Variable
120+
121+
The syntax is, `Divide Var by value`. `Var` is the name of the variable. This translates to `Var / value`.
122+
123+
### If
124+
125+
The syntax to this is similar to EZCode, `if argument : code...`. Although, `:` the same as putting `then` or `, then` with the [replacements](#replacements). As an example, `if X is greater than or equal to 20, then X is equal to 50`. This will translate to `if x >= 20 : X = 50`. It can also create variables inside of the if with the followinf syntax,
126+
- `if A intersects B then CODE`: This will translate to,
127+
- ```
128+
var EZTEXT_GENERATED_VARIABLE : intersects A B
129+
if 'EZTEXT_GENERATED_VARIABLE' : CODE
130+
```
131+
- `if the console input is equal to TEXT then CODE`: This will translate to,
132+
- ```
133+
var EZTEXT_GENERATED_VARIABLE : input console
134+
if 'EZTEXT_GENERATED_VARIABLE' = TEXT : CODE
135+
```
136+
- `if the contents of the file FILEPATH is equal to TEXT then CODE`: This will translate to,
137+
- ```
138+
var EZTEXT_GENERATED_VARIABLE : file read FILEPATH
139+
if 'EZTEXT_GENERATED_VARIABLE' = TEXT : CODE
140+
```
141+
- `if KEY is being pressed then CODE`: This will translate to,
142+
- ```
143+
var EZTEXT_GENERATED_VARIABLE : input key KEY
144+
if 'EZTEXT_GENERATED_VARIABLE' : CODE
145+
```
146+
- `if the BUTTON mouse button is being pressed then CODE`: This will translate to,
147+
- ```
148+
var EZTEXT_GENERATED_VARIABLE : input mouse button BUTTON
149+
if 'EZTEXT_GENERATED_VARIABLE' : CODE
150+
```
151+
- `if the X/Y mouse position is equal to VALUE then CODE`: This will translate to,
152+
- ```
153+
var EZTEXT_GENERATED_VARIABLE : input mouse position X/Y
154+
if 'EZTEXT_GENERATED_VARIABLE' = VALUE : CODE
155+
```
156+
- `if the mouse wheel state is equal to VALUE then CODE`: This will translate to,
157+
- ```
158+
var EZTEXT_GENERATED_VARIABLE : input mouse wheel
159+
if 'EZTEXT_GENERATED_VARIABLE' = VALUE : CODE
160+
```
161+
162+
### If Not
163+
164+
The syntax is, `if not : CODE`. `:` is replaced by `then` or `, then` with the [replacements](#replacements). It is translated to `else : CODE`. It is only used after an [if](#if) and will be executed if it is false.
165+
166+
### Math
167+
168+
The syntax is, `VAR = MATH`. `MATH` is any mathematical stuff including Functions. The `=` is the same as `is equal to` or `equals` with [replacement](#replacements). It translates to, `var VAR : math MATH`.
169+
170+
### Multiply Variable
171+
172+
The syntax is, `Multiply Var by value`. `Var` is the name of the variable. This translates to `Var * value`.
173+
174+
### Play
175+
176+
The syntax is, `play the file/project FILEPATH`. Either use `file` or `project`. It is translated as `file play file/project FILEPATH`.
177+
178+
### Remove From List
179+
180+
The syntax is, `Remove INDEX/VALUE in list NAME`. `NAME` is the name of the list and `INDEX/VALUE` is either the index or value that is going to be removed. It is translated to `NAME remove INDEX/VALUE`.
181+
182+
### Replace In List
183+
184+
The syntax is, `Replace INDEX with VALUE in list NAME`. `NAME` is the name of the list. `INDEX` is the index of the value that is going ot be replaced with `VALUE`. It is translated to `NAME equals INDEX VALUE`.
185+
186+
### Split List
187+
188+
The syntax is `NAME = split by VALUE SPLITTER`. The `=` is the same as `is equal to` or `equals` with [replacement](#replacements). The `NAME` is the name of the list, `VALUE` is the value going to be split, and the `SPLITTER` is the value that is going to split the `VALUE`. It translates to, `NAME split VALUE SPLITTER`.
189+
190+
### Stop
191+
192+
The syntax, `Stop the program/file`. Expected either `program` or `file`. Translates to `stop program` or `stop file`.
193+
194+
### Subtract From Variable
195+
196+
The syntax is, `Add value from Var`. `Var` is the name of the variable. This translates to `Var - value`.
197+
198+
### Wait
199+
200+
The syntax is, `Wait X miliseconds` or `Wait until X is equal to true`. `X` in the first example is a number. In the second example, it is an argument. It translates to, `await X`.
201+
202+
### Write To Console
203+
204+
The syntax is, `Write TEXT to the console`. `TEXT` is the text that ias going to be written to the console. It can be more than one word. It translates to, `print TEXT`.
205+
206+
### Write To File
207+
208+
The syntax is, `Write TEXT to the file FILEPATH`. `FILEPATH` is the file path and `TEXT` is the text that is going to be written. This will translate to `file write TEXT FILEPATH`.
209+
210+
### Variable Equals
211+
212+
The syntax is, `VAR = VALUE`. `VALUE` is the value that the variable is going to be equal to. The `=` is the same as `is equal to` or `equals` with [replacement](#replacements). It translates to, `VAR = VALUE`.

0 commit comments

Comments
 (0)