main.ks
Output

Run your code to see output

Hello World

Your first KnockScript program

Arithmetic Operations

Variables and mathematical operations

Loops & Conditionals

Control flow with while loops

Object-Oriented Programming

Classes, methods, and objects

Variables

Knock knock
Who's there?
Set
Set who? x to 10

Print Output

Knock knock
Who's there?
Print
Print who? "Hello!"

Conditionals

Knock knock
Who's there?
If
If who? x greater than 5
    [statements]
Otherwise
    [statements]
Done

While Loops

Knock knock
Who's there?
While
While who? x less than 10
    [statements]
Done

For Loops

Knock knock
Who's there?
For
For who? i from 1 to 5
    [statements]
Done

Classes & Objects

Knock knock
Who's there?
Class
Class who? Person with name and age

Knock knock
Who's there?
Set
Set who? p to new Person 
with name "Alice" and age 30