Skip to content

replit-archive/emoticoffee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Emoticoffee

An Emoticon v1.5 language interpreter written in CoffeeScript.

:-O Hello World :-Q S:-P :-Q

The only deviation from the original spec is the addition of the input operator :-*

:-O :-* :-P

#Usage

var hello_world = ':-O Hello World :-Q S:-P :-Q';
var code = new Emoticon.Parser(hellow_world);
config = {
  input: function (cb) {
    cb(window.prompt("input"));
  },
  print: function (to_print) {
    alert(to_print);
  },
  result: function (result) {
    for (var list in result)
      alert(list.toString());
  },
  logger: function (log_message){
    console.log(log_message);
  },
  source: code
};
var interpreter = new Emoticon.Interpreter(config);
interpreter.run();

To run a new program with the current program state:

interpreter.lists.Z = interpreter.lists.Z.concat(new_code);
interpreter.run();

About

Emoticon interpreter in CoffeeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published