pna is a custom scripting language with a simple, readable syntax designed to define variables, objects, conditionals, loops, and logging output. It supports built-in functions, input/output, and flow control structures like if, loop, break, and continue.
enemy: {
name: "Slime",
hp: 100,
}
- Defines a dictionary-style variable enemy with properties name and hp.
enemy.hp: 75
- Sets the hp field of enemy to 75.
enemy.hp: enemy.hp - 10
log "Hello"
log "HP: " + str(enemy.hp)
- Strings can be concatenated with +.
- str() converts other types to string for logging.
Pna supports various built-in functions:
randint 1 10 // Random int from 1 to 10
str(123) // Convert to string
int("123") // Convert to integer
len("abc") // Length of string
not true // Boolean not
inlist "a" "a,b,c" // True
input "What is your name?" -> player.name
- Asks the question and stores input into player.name.
input "NO" -> player.age
- Equivalent to input() in python.
cond (enemy.hp <= 0) -> {
log "Enemy defeated!"
} end
- If condition is true, the block runs.
loop (anycondition) -> {
log "Repeating"
break
} end
- Runs while the condition is true.
break // exits the loop
continue // skips to next iteration