PiratesCode



pirates code logo

About


Ahoy mateys! Real pirates no longer surf the seven seas, they surf the world wide web! Inspired by the swashbuckling buccaneers of legend, PiratesCode be designed to make programming easy and fun for scurvy new programming recruits.

PiratesCode be a language for those fixing to get an education and have fun while doing it! Since we’re all swashbuckling corsairs here, PiratesCode specifically helps ye write secure code so ye can protect your loot. All hop on the Flyin’ Dutchman and set your sails for the sea (of code) with PiratesCode!

Code Examples


Hello World


ahoy “world!”
                

Even Or Odd


captain evenOrOdd(int x) -> booty {
    x = -14
    anchor x % 2 == 0
}
                

For Loops


vargh pirates = [1, 4, 3, 4, -1]
chase int i = 0 until 5 {
    yo pirates[i] < 0 {
        ahoy "invalid pirate!"
        maroon
    } yo ho pirates[i] % 2 == 1 {
        ahoy "found an odd pirate!"
        ahoy pirates[i]
    }
}
[int] numbers = [1, 2, 3]
chase vargh x through numbers {
    ahoy evenOrOdd(x)
}
                  

While Loops


vargh age = 10 
vargh ageLimit = 18
parrot age < ageLimit {
    ahoy "yer a little lad?" 
    yo aye {
        ahoy age < ageLimit ? "aye" : "nay"
    }
    age = age + 1
}
ahoy "yer a pirate!"
                  

If Statements


    yo x < 10 {
        anchor 1
    } yo ho (x < 20) {
        anchor -1
    } ho {
        anchor 0
    }
                

Classes


            ship Rectangle {
                build (doubloon h, int w) {
                    doubloon me.height = h
                    int me.width = w
                }
                captain getWidth() -> int {
                    anchor me.width
                }
                captain setWidth(int newWidth) -> none {
                    me.width = newWidth
                }
            }
            Rectangle p = new Rectangle(3,4)
            ahoy p.getWidth()
            p.setWidth(15)
              

The Developers


Jason Douglas


Jason Photo

Jason is a Junior at Loyola Marymount University pursing a BS in Computer Science. In his free time, he likes to read books, play a variety of games and search for buried treasure amongst the many islands in the seas.
His favorite pirate is Captain Jack Sparrow.


Close

Maya Epps


Maya Photo

Maya is pursuing a Bachelor of Science in Computer Science and a minor in History at Loyola Marymount University. In her free time, Maya likes to bake pies, read as many books as possible, play soccer, and sail the seven seas.
Her favorite pirate is Anne Bonny


Close

Tanya Nobal


Tanya Photo

Tanya is pursuing a Bachelor of Science in Computer Science with minors in Mathematics and Studio Arts. In her free time, she dreams of being on Jeopardy, creates art, and plunders pantries for chocolate.
Her favorite pirate is the Pirate King Elizabeth Swann.


Close

Saad Salman


Saad Photo

Saad is pursuing a Bachelor of Science in Computer Science and a Bachelor of Arts in Film and Television Production. In their free time, they co-captain film crews and play Dungeons and Dragons.
Their favorite pirate is Stede Bonnet.


Close

Jennifer Siao


Jen Photo

Jennifer is pursuing a Bachelor of Science in Computer Science and a minor in Environmental Studies at Loyola Marymount University. In her free time, Jennifer enjoys spending time with her pet rabbits, hanging out with friends, doing puzzles, and sleeping in the crow's nest. :)
Her favorite pirate is Madame Cheng.


Close

Pirate Resources