MeowScript is a fun and simple programming language with cat-themed syntax! This is an interpreter for MeowScript, built using JavaScript.
- 📝 Variable assignments (
x = 5) - 📢 Printing output (
meow("Hello, World!")) - 🔄 Loops (
while (condition) { ... }) - 🤔 Conditionals (
if (condition) { ... }) - ⏳ Delays (
catnap(seconds)) - 🐾 Error handling (
try { ... } scratch { ... }) - 🐱 Cat-themed syntax!
git clone https://github.com/yourusername/MeowScript.git
cd MeowScriptnpm installconst MeowScriptInterpreter = require("./interpreter.js");
const interpreter = new MeowScriptInterpreter();
const code = `
~ purr purr This is a comment
x = 5
y = 10
z = x + y
meow("The sum is: " + z)
if (z > 10) {
meow("😺 " + z + " is greater than 10!")
}
purr()
while (z < 20) {
z = z + 2
meow("z is now: " + z)
}
try {
meow(undefinedVar) // This should throw an error
} scratch {
meow("Caught an error! 😼")
}`;
interpreter.execute(code).then(output => console.log(output));The sum is: 15
😺 15 is greater than 10!
😸 Purring...
z is now: 17
z is now: 19
z is now: 21
z is now: 23
Error: undefinedVar is not defined
Caught an error! 😼
meow("Hello, MeowScript!")
x = 42
y = x + 8
if (x > 40) {
meow("x is big!")
}
while (x < 50) {
x = x + 1
meow("x is now: " + x)
}
try {
meow(undefinedVar)
} scratch {
meow("Caught an error! 😼")
}
This project is licensed under the MIT License.
Pull requests and suggestions are welcome! If you find any bugs or have ideas, feel free to open an issue. 🐾
If you like MeowScript, give it a star ⭐ on GitHub! 😺