Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
README.md
index.html
parser.js

README.md

Canadascript

Welcome to Canadascript, eh?

Getting Started

To begin on your journey into Canadianisms, grab the parser.js script.

To start a new project, load in the parser.js script like so:

<script src="parser.js"></script>

Now that you have loaded the parser, you may create the canadascript script tag:

<script type="text/canadian"></script>

Ehh... that was easy! Your code should probably look something like this now:

<html>
<head>
  <title>CANADA</title>
  <script src="parser.js"></script>
</head>
<body>
  <script type="text/canadian">
    //Your canadian code will go here
  </script>
</body>
</html>

Nice Work!

How To Use?

Just follow the instructions and you will be coding canadian in no time, eh?

Variables

Creating a variable is simple eh?

my_new_variable = 'hello world' eh?

Changing a variable is just like creating it!

my_new_variable = 9000 eh?

Functions

To create a function:

O function_name, param1 param2 param3:
  //code goes here
sorry

or

O function_name:
  //code goes here
sorry

Sorry is a very common word used in Canadascript so you better get used to it now, eh?

here is an example of a function being used for real purposes...

O Canada, we stand on guard for thee:
  whadda'yat we+stand+on+guard+for+thee?
sorry

O Canada, 1 2 3 4 5 6!

Wow! the code above will console log 21...

To call a function all you have to do is:

O function_name, params! or O function_name, params.

OR

O function_name! or O function_name.

And that brings us to...

Console Log

You may have noticed that whadda'yat was used while explaining functions.

whadda'yat is how you console log things in Canadascript. Here is a simple use of it:

whadda'yat 100?

This will console log 100.

I have been asked aboot this before, what does whadda'yat mean? Good question, it is not a common canadian slang. It originates mainly from Newfoundland and is a jumble of the words 'what are you at' and means 'what are you doing' or 'what are you up to'. Often when I console log something, I am trying to figure out what something is doing. And so, I found it fitting to use whadda'yat for console logs.

For Loop

Here is an example of a for loop in Canadascript:

oot 'n aboot 10:
  //code goes here
sorry

This calls the code inside 10 times.

10 is the number of times to iterate

n is the iteration counter (in this case it goes from 0 to 9)... Not required to be n, could be i, and, an, or anything else you want it to be.

This for loop is equivalent to this javascript for loop:

for(n = 0; n < 10; n++){
  //code goes here
}
Something went wrong with that request. Please try again.