Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 3.81 KB

README.md

File metadata and controls

96 lines (62 loc) · 3.81 KB

VikingScript

VikingScript Logo

Introduction to VikingScript

All programming languages shall be conquered!

Welcome to the ambitious world of VikingScript. VikingScript is a Viking themed language which keeps the essence of many other high-level programming languages like JavaScript. Years of delicate syntax has turned us into barbaric hammer-swinging Vikings!

by Will Ruskin, Zander Zemilak and Dylan McGoldrick

Features

VikingScript has a number of features:

  • Weakly typed
  • Dynamically typed
  • .VK file extension

Example Code

Below is the example code which you can see has a big viking influence!

Print to the console:

  • Classic hello, world program
  • runes are the letters of an ancient Latin alphabet which the Vikings used
JavaScript VikingScript
console.log("hello, world") runes("hello, world")

Variable declaration:

  • kalla means declare in Norse
  • No semi-colons
  • No need to specify the type of the variable
JavaScript VikingScript
let x = 5 kalla x = 5

Return

hverfa identifier used, meaning "to return" in Norse

Function declaration

  • valhalla being the majestic heaven in Asgard where all Vikings strive to be
  • No return type needed
JavaScript VikingScript
function add(x,y) { 
return x + y
}
valhalla add(x, y) { 
hverfa x + y
}

Comments

  • The comment is based off a Viking helmet
JavaScript VikingScript
//Bjorn }:| Odin
 /_ 
Erik
_/
 {:| 
Gorm
}:|

Relational Operators

  • A barbaric syntax that even Vikings can understand
x equal y
x lessThanOrEqual y
x greaterThanOrEqual y
x doesNotEqual y
x greaterThan y
x lessThan y

Conditionals

  • ef translates to if in Norse
  • kostr the Norse word for "Otherwise" replaces else
JavaScript VikingScript
 let x = 5 
if(x == 5) {
console.log(x)
}
else if (x > 10) {
console.log("greater")
}
else (x < 10) {
console.log("less")
}
 kalla x = 5 
ef(x equal 5) {
runes(x)
}
kostr ef (x greaterThan 10) {
runes("greater")
}
kostr (x lessThan 10) {
runes("less")
}

True / False

  • Replaced true and false values to please the Gods
JavaScript VikingScript
 true 
false
 thor 
loki