Skip to content

Commit 969bfb6

Browse files
Added example to README
1 parent 4bb634e commit 969bfb6

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
## \*\**Version 3.0.0 Currently in Development*\*\*
2+
*What EZCode is going to look like,*
3+
```
4+
make ^int {NAME} {VALUE} => var {NAME} new : {VALUE}
5+
// turns: var name 0
6+
// into: var name new : 0
7+
// which is the valid way to create class instance
8+
9+
// color class that stores R, G, B values
10+
// looks for c[R, G, B] and turns that into a new color instance
11+
class color {
12+
explicit watch c\[{R}, {G}, {B}\] => set : R, G, B
13+
int R 0
14+
int G 0
15+
int B 0
16+
method set : @int:r, @int:g, @int:b {
17+
R = r
18+
G = g
19+
B = b
20+
}
21+
}
22+
23+
// prints color with the new instance of color class c[50, 60, 90]
24+
printColor : c[50, 60, 90]
25+
26+
method printColor : @color:c {
27+
print The color: 'c:r' 'c:g' 'c:b'
28+
}
29+
// Outputs:
30+
// The color: 50 60 90
31+
```
32+
233

334
![Main Image](https://raw.githubusercontent.com/JBrosDevelopment/EZCode/master/docs/Images/EZCode_Wide_Logo.png)
435
---

0 commit comments

Comments
 (0)