Skip to content

Commit bea6d7a

Browse files
committed
chore: update readme
1 parent 73a4cc6 commit bea6d7a

1 file changed

Lines changed: 9 additions & 110 deletions

File tree

Readme.md

Lines changed: 9 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -117,122 +117,21 @@ Open `http://localhost:3000` to start coding in Z--!
117117

118118
---
119119

120-
## Z-- Language Reference
120+
## Language Reference
121121

122-
### Program Structure
122+
For the complete Z-- language specification, see the dedicated reference:
123123

124-
Every Z-- program starts with `start` and ends with `end`.
124+
> **📖 [Z-- Language Reference (zmm-lang.md)](docs/zmm-lang.md)**
125+
>
126+
> Covers: program structure, data types, numeric literals, all operators, control flow,
127+
> functions, arrays, strings, and 10 annotated sample programs.
125128
126-
```text
127-
start
128-
// statements...
129-
end
130-
131-
```
132-
133-
### Variable Declaration
134-
135-
```text
136-
let name = value // with initial value
137-
let name // without initial value (null until assigned)
138-
139-
```
140-
141-
### Data Types & Numeric Literals
142-
143-
* **Integer:** `let n = 42`
144-
* **Float:** `let f = 3.14`
145-
* **String:** `let s = "hello"`
146-
* **Boolean:** `let flag = true`
147-
148-
```text
149-
let decimal = 42 // base 10
150-
let hex = 0x2A // hexadecimal
151-
let binary = 0b101010 // binary
152-
let octal = 0o52 // octal
153-
154-
```
155-
156-
### Operators
157-
158-
**Arithmetic:** `+`, `-`, `*`, `/`, `%`
159-
**Unary:**
160-
* `++x` (pre-increment)
161-
* `x--` (post-decrement)
162-
* `-x` (unary minus/negation)
163-
164-
165-
**Comparison:** `==`, `!=`, `<`, `<=`, `>`, `>=`
166-
**Logical & Bitwise:** `&&`, `||`, `&`, `|`, `^`, `%`
167-
168-
### Control Flow
169-
170-
**If / Else / Else If:**
171-
172-
```text
173-
if score >= 90 {
174-
print("A")
175-
} else if score >= 75 {
176-
print("B")
177-
} else {
178-
print("C")
179-
}
180-
181-
```
182-
183-
**Loops (While & For):**
184-
185-
```text
186-
while n > 0 {
187-
if n == 5 { break } // exit loop early
188-
print(n)
189-
n = n - 1
190-
}
191-
192-
for i = 1, i <= 10, i++ {
193-
print(i)
194-
}
195-
196-
```
197-
198-
### Functions
199-
200-
```text
201-
fun add {
202-
arg = (a, b)
203-
return a + b
204-
}
205-
206-
let result = add(3, 4)
207-
208-
```
209-
210-
### Arrays
211-
212-
Indexing is 0-based.
213-
214-
```text
215-
let nums = [2, 4, 6, 8]
216-
print(nums[0]) // read
217-
nums[1] = 5 // write
218-
219-
```
220-
221-
### Strings & Input
222-
223-
```text
224-
let msg = "Hello"
225-
let full = msg + ", Z--"
226-
print(full)
227-
228-
let n
229-
print("Enter a number:")
230-
input(n)
231-
232-
```
129+
The language reference is maintained separately to keep this README focused on
130+
project setup and usage.
233131

234132
---
235133

134+
236135
## Usage Examples
237136

238137
### Hello World

0 commit comments

Comments
 (0)