QZ is a scripting language with:
Script files use .qzx
Header/module files use .qzh
;hello log "Hello world"
@math pi:3.14159
Used with:
use "math.qzh"
;program
10 -5 3.14
"hello" 'hello' `hello`
true false
| Constant | Value |
|---|---|
| inf | Infinity |
| nan | NaN |
| Constant | Value |
|---|---|
| pi | π |
| tau | 2π |
| e | Euler's number |
| phi | Golden ratio |
use math.qzh log pi
asn x,10 log x
log "Hello" log 5+5
err "Something failed"
ask "Name?",name log name
| Operator | Meaning |
|---|---|
| + | Add |
| - | Subtract |
| * | Multiply |
| / | Divide |
| % | Modulo |
| & | Bitwise AND |
| | | Bitwise OR |
| ^ | Bitwise XOR |
log 9 // 2
Outputs:
3
asn a,[1,2,3] log a[0] asn a[1],50
log length "hello"
Outputs:
5
asn square,fn n{
ret n*n
}
log square 5
asn double,fn x{
ret x*2
}
log double 10
Outputs:
20
if x>5{
log "big"
}
or x==5{
log "equal"
}
else{
log "small"
}
| Operator | Meaning |
|---|---|
| == | Loose equal |
| === | Strict equal |
| != | Loose not equal |
| !== | Strict not equal |
| > | Greater than |
| < | Less than |
| >= | Greater/equal |
| <= | Less/equal |
repeat 3{
log "hello"
}
asn x,0
while x<5{
log x
inc x,1
}
| Command | Effect |
|---|---|
| inc | Add |
| minc | Multiply |
| einc | Exponentiate |
| ainc | Bitwise AND |
| oinc | Bitwise OR |
| xinc | Bitwise XOR |
<< this is ignored >>
cl cl-var x cl-vars cl-stack f
tm
use math.qzh
math.qzhtime.qzhdebug.qzhjs.qzhbrowser.qzh| Name | Description |
|---|---|
| ln | Natural logarithm |
| sin | Sine |
| cos | Cosine |
| tan | Tangent |
| abs | Absolute value |
| pi | π |
| tau | 2π |
| e | Euler's number |
| Name | Description |
|---|---|
| time | Current timestamp |
| date | Current local date/time |
use debug.qzh debug
use js.qzh
js "alert('hello')"
open "https://example.com"
rdir "https://example.com"
use "header.qzh"
;demo
use math.qzh
asn square,fn x{
ret x*x
}
asn n,5
if n>3{
log "large"
}
log square n
Expected output:
large 25