Emojicode

Odds are youโ€™ll have to teach yourself a new programming language some day, perhaps even installing some software for it. Letโ€™s prepare you for that day!

Emojicode is โ€œan open-source, full-blown programming language consisting of emojis.โ€ Here, for instance, is a now-familiar program, implemented in Emojicode:

๐Ÿ ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คhello, world๐Ÿ”คโ—๏ธ
๐Ÿ‰

Installing

In order to compile that program from Emojicode to machine code, youโ€™ll need a compiler, emojicodec. Hereโ€™s how to install it VS Code:

  1. Install some โ€œdependenciesโ€ that Emojicodeโ€™s compiler requires:

     sudo apt install -y libncurses5 rsync
    
  2. Download a โ€œgzipped tarballโ€ (which is similar to a Zip file) of Emojicodeโ€™s installer:

     wget https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz
    
  3. Decompress that gzipped tarball:

     tar -xzf Emojicode-1.0-beta.2-Linux-x86_64.tar.gz 
    
  4. Change into the decompressed directory:

     cd Emojicode-1.0-beta.2-Linux-x86_64
    
  5. Run the installer therein:

     sudo ./install.sh
    

    And answer y to any questions when prompted.

If you then run

emojicodec

without any command-line arguments, you should see:

๐Ÿ‘‰  Option 'file' is required

If not, best to retry these steps!

Compiling

Execute

code hello.๐Ÿ‡

to create a new file called hello.๐Ÿ‡. (Youโ€™ll probably find it easier to copy/paste than type manually.) Thatโ€™s right, Emojicode uses a file extension of .๐Ÿ‡!

Next, copy/paste this now-familiar program into the file:

๐Ÿ ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คhello, world๐Ÿ”ค โ—๏ธ
๐Ÿ‰

Then compile the program with:

emojicodec hello.๐Ÿ‡

And run it with:

./hello

You should see a familiar greeting. If not, best to retry these steps!

Understanding

To understand this new language, start by reading Emojicodeโ€™s guide. Then answer each of the below.

  1. (1 point.) What is ๐Ÿ similar to in C?
  1. (1 point.) What are ๐Ÿ‡ and ๐Ÿ‰ similar to in C?
  1. (1 point.) What is ๐Ÿ˜€ similar to in C?
  1. (1 point.) What are ๐Ÿ”ค and ๐Ÿ”ค similar to in C?
  1. (1 point.) What is โ—๏ธ similar to in C?

Keeping Emojicodeโ€™s guide still in mind, consider the program below. You might find it helpful to copy/paste it, too, into a .๐Ÿ‡ file so that you can compile and run it a few times.

๐Ÿ ๐Ÿ‡
  ๐Ÿฟ 1 2 3 4 5 6 7 8 9 10 ๐Ÿ† โžก๏ธ ๐Ÿ–๏ธ๐Ÿ†• numbers
  ๐Ÿน numbers โ—๏ธ
  ๐Ÿ˜€ ๐Ÿ”ก ๐Ÿฝ numbers 0 โ—๏ธ โ—๏ธ โ—๏ธ
๐Ÿ‰
  1. (2 points.) In emojicode/6.py, re-implement the program in Python.

Letโ€™s now stray a bit from the guide. Consider the program below. You might find it helpful to copy/paste it, too, into a .๐Ÿ‡ file so that you can compile and run it. You might also find it helpful to skim Emojicodeโ€™s package index for strings.

๐Ÿ ๐Ÿ‡
  ๐Ÿ‘„ ๐Ÿ”ค๐Ÿคท ๐Ÿ”คโ—๏ธ
  ๐Ÿ†• ๐Ÿ”กโ–ถ๏ธ๐Ÿ‘‚๐Ÿผ โ—๏ธ โžก๏ธ s
  ๐Ÿ‘„ ๐Ÿ”ค๐Ÿ‘‹ ๐Ÿ”ค โ—๏ธ
  ๐Ÿ˜€ s โ—๏ธ
๐Ÿ‰
  1. (2 points.) In emojicode/7.py, re-implement the program in Python.

Finally, consider the program below. You might find it helpful to copy/paste it, too, into a .๐Ÿ‡ file so that you can compile and run it. You might also find it helpful to skim Emojicodeโ€™s language reference for control flow.

๐Ÿ ๐Ÿ‡
  ๐Ÿ”‚ i ๐Ÿ†•โฉ 10 0 -1 โ—๏ธ ๐Ÿ‡
    ๐Ÿ˜€ ๐Ÿ”กiโ—๏ธ โ—๏ธ
  ๐Ÿ‰
๐Ÿ‰
  1. (2 points.) In emojicode/8.py, re-implement the program in Python.