Difference between revisions of "Emojicode"

From Hackers and Designers
Jump to navigation Jump to search
Line 36: Line 36:
 
   🏁 🍇
 
   🏁 🍇
 
     😀 🔤Hello world!🔤
 
     😀 🔤Hello world!🔤
 +
  🍉
 +
 +
Making a variable...first the "frozen" type.  Frozen means you can never change it.  Here we make a variable called "a"
 +
 +
  🍦 a 10
 +
 +
You can also compare two numbers with this program.
 +
 +
  🏁 🍇
 +
    🍦 a 10
 +
    🍦 b 4
 +
    🍊 ▶️ a b 🍇
 +
      😀 🔤a is bigger than b🔤
 +
    🍉
 
   🍉
 
   🍉
  
Line 43: Line 57:
 
     🍦 input 🔷🔡😯 🔤Ask something here?🔤
 
     🍦 input 🔷🔡😯 🔤Ask something here?🔤
 
     😀 🍪🔤You said: 🔤 input🍪
 
     😀 🍪🔤You said: 🔤 input🍪
 +
  🍉
 +
 +
Convert integers to strings and back.
 +
 +
  🏁🍇
 +
    🍦 a 🍺 🚂 🔤9🔤 10
 +
    🍊 ▶️  a 0 🍇
 +
      😀 🔤a is bigger than 10🔤
 +
      😀 🔡 a 10
 +
    🍉
 
   🍉
 
   🍉

Revision as of 16:46, 10 September 2017

Emojicode Workshop

About

Emojicode is an open-source, full-blown programming language consisting of emojis.

Workshop

Please note that lines that begin with $, should be executed with the Terminal and are NOT program syntax. This workshop also assumes you have completed the Emojiterm workshop. The $ should not be pasted in the terminal.

All other code blocks should be considered valid Emojicode syntax.

Create a file.

  $ 📝 myprog.emojic

The simplest Emojicode program looks as follows.

  🏁 🍇
  🍉

To save and exit the text editor (nano📝), first do Cntl+O, and then Cntl+X.

You can run it by first compiling it.

  $ emojicodec greeter.emojic

Running it.

  $ emojicode myprog.emojib

This program is so simple, it doesn't do anything.

The famous "Hello world!" example.

  🏁 🍇
    😀 🔤Hello world!🔤
  🍉

Making a variable...first the "frozen" type. Frozen means you can never change it. Here we make a variable called "a"

  🍦 a 10

You can also compare two numbers with this program.

  🏁 🍇
    🍦 a 10
    🍦 b 4
    🍊 ▶️ a b 🍇
      😀 🔤a is bigger than b🔤
    🍉
  🍉

User input.

  🏁 🍇
    🍦 input 🔷🔡😯 🔤Ask something here?🔤
    😀 🍪🔤You said: 🔤 input🍪
  🍉

Convert integers to strings and back.

  🏁🍇
    🍦 a 🍺 🚂 🔤9🔤 10
    🍊 ▶️  a 0 🍇
      😀 🔤a is bigger than 10🔤
      😀 🔡 a 10
    🍉
  🍉