Home

Awesome

πŸ§™ PotterScript: The Wizarding World Programming Language

Parody Programming Language based in Harry Potter (Wizarding World). Experience the magical world of coding like never before! It's a really useful to project to learn Rust and how programming languages are done.

✨ Introduction

Ever wished you could speak the magical language of wizards and witches? PotterScript is your enchanted gateway to code with the charm and mystery of the Wizarding World.

This project is a remarkable endeavor to understand the magical connection between human logic and machine interpretation. It's a journey filled with trials, failures, and the sweet taste of success that only comes from the relentless pursuit of something extraordinary.

Powered by Rust and its incredible features like godlike error handling and orgasmic memory safety, PotterScript provides a solid toolkit for creating an enchanting programming experience.

πŸš€ Get Started

Ready to embark on this magical journey? Here you have a few options:

πŸ§™β€β™‚οΈ Features

Spell Functions

In PotterScript there are no such things as functions or args, but there are spells and targets. To cast a spell you have to use the wand character ~ followed by the spell name and the target expression.

You can only cast a spell on one target, and the spell will do something with the target. For example, the ~Revelio {target} spell will print the target expression (variable or raw value) to the console.

~Revelio "Hello World!"

Spells can also of course mutate the target, like ~Engorgio {target} that will increment the target value by one.

index = 0
~Engorgio index
~Revelio index # prints "1"

List of spells:

Sorting Hat

Generate HogwartsHouse values (is a type like String or Integer), using the Sorting Hat, just like:

house = 🎩✨ # or SortingHat

if house = Griffindor {
  ~Periculum
}

Quidditch Loops

Model your loops after a Quidditch match and use a 'Snitch' condition to end them.

index = 0

quidditch {
  snake = ~Serpensortia
  ~WingardiumLeviosa snake
  ~WingardiumLeviosa snake
  snake = snake + " some string"
  ~Revelio snake
  ~Incendio snake
  ~Revelio snake
  ~Engorgio index

  if index == 4 {
    snitch # Break loop
  }
}

Outputs:

🐍

 some string
🐍

 some stringπŸ”₯
🐍

 some string
🐍

 some stringπŸ”₯
🐍

 some string
🐍

 some stringπŸ”₯
🐍

 some string
🐍

TODO

Language

Packages

🌟 Contribute

PotterScript is open for contributions! Cast your magical spells and bring your creativity to life.

Disclaimer: This project is not affiliated with Warner Bros. Entertainment Inc. or J.K. Rowling in any way.