Skip to content

RosettaYH/CoffeeMaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Welcome, all coffee lovers! Haven’t fully clenched your taste buds with coffee? Do you need that little bit of extra caffeine to get you going through the morning or night? Want to be able to go to Starbucks or Dunkin Donuts or any of your favorite coffee shops? You are in the right place with our coffeemaker language here! Ready to recreate Espresso, Macchiato, Americano, Latte, Cappuccino, and the others that come to your mind? After a few minutes in our coffeemaker, you will be able to create and taste your very own coffee! Are you ready to replicate or even surpass the “great” Starbucks? Check out our site here: https://rosettayh.github.io/CoffeeMaker/

Features

  • Statically typed language
  • Coffee-themed
  • Loops
  • Classes
  • Functions
  • Basic Types: int, floats, strings, boolean
  • No billian dollar mistake!

Types

Static Type CoffeeMaker
Numbers (from Javascript) regular
Decimals (from Javascript) decaf
Strings (from Javascript) put
function cup
Boolean boolean

Other Keywords

Javascript CoffeeMaker
function cup
if sugar
else if cream sugar
else cream

Examples

Printing

JavaScriptCoffeeMaker
console.log(“A cup of coffee”)
 brew(“A cup of coffee”)

Assigning and Intiliazing

JavaScriptCoffeeMaker
// two slashes is a comment in javascript
let number = 100;
const name = "Walter White";
var boss = "Gus Fring"; //OH NO, NOT var! :(
 # the pound (hash) is a comment in CoffeeMaker
 regular number = 100 	#for numbers/integers
 decaf decimal = 3.14 	#for floats
 put name = "Walter White" 	#for Strings

Loops

JavaScriptCoffeeMaker
for (let i = 0; i < 10; i++) {
  print("I love compilers!");
}
regular i = 4
while(i < 10){
  brew("I love to sleep!")
  i = i + 1
}

Conditionals (If-Statement)

JavaScriptCoffeeMaker
if (age < 18) {
  console.log("Enjoy your early years!");
} else if (age > 60) {
  console.log("Retirement age is finally here!");
} else {
  console.log("Errr, good luck in adulthood :p");
}
sugar (age < 18) {
    brew("Enjoy your early years!")
} cream sugar(age > 60) {
    brew("Retirement age is finally here!")
} cream {
    brew("Errr, good luck in adulthood :p")
}

Functions

JavaScriptCoffeeMaker
function add(x, y) {
  return x + y;
}
cup decaf add -> (decaf x, decaf y) {
    complete x + y
}

Classes

JavaScriptCoffeeMaker
class Car {
    constructor(name, year) {
        this.name = name;
        this.year = year;
    }

    function add(x, y) {
         return x + y;
    }
}
keurig Car {
    create(self, put name, regular year) {
        this.name = name
        this.year = year
    }

    cup regular add -> (self, regular x, regular y) {
         complete x + y
    }
}

List of Static Semantic Errors

  • Use of undeclared identifiers.
  • Variable used as a function.
  • Redeclaring an already declared identifier.
  • Value returned outside of function.
  • decrementing/incrementing a string
  • function with more arguments then allowed
  • wrong types for identifiers
  • Variable used within a loop is declared and initialized outside of the loop.

Authors: Rosetta Yu and Jose Fuentes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published