Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
/ apscript-zig-archive Public archive

An interpreter for the AP© Computer Science Principles pseudocode language written in Zig.

License

Notifications You must be signed in to change notification settings

sno2/apscript-zig-archive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APScript (WIP)

An interpreter for the AP© Computer Science Principles pseudocode language written in Zig.

Warning: Heavily WIP as this is only on GitHub for me to work on while at school.

Examples

Printing to the console

age <- 23
DISPLAY("You are", age, "years old.")
You are 23 years old.

Mutating variables

age <- 0

REPEAT UNTIL (age > 105) {
  age <- age + 1
  DISPLAY("You are", age, "years old.")
}

DISPLAY("RIP")
You are 1 years old.
You are 2 years old.
You are 3 years old.
You are 4 years old.
...
You are 102 years old.
You are 103 years old.
You are 104 years old.
You are 105 years old.
RIP

Accessing input from the console

Note: The interpreter always tries to coerce results from INPUT() into numbers first. If that fails, then it returns a string.

age <- INPUT("What is your age?")
DISPLAY("You are", age, "years old and will be", age + 1, "next year!")
What is your age? 23 [Enter]
You are 23 years old and will be 24 next year!

License

MIT

About

An interpreter for the AP© Computer Science Principles pseudocode language written in Zig.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages