What would happen if emoji were brought to life? That must somewhat have been the idea when Tony Leondis and Eric Siegel started working on the story for the The Emoji Movie1 (2017).

The Emoji Movie
Theatrical release poster of The Emoji Movie (2017).

The result is the worst of cinematic under-achievements that premiered on July 23, 2017 and was theatrically released in the United States five days later. The film was a commercial success after grossing $217.8 million worldwide β€” against its $50 million production budget β€” but was universally lambasted by critics, who criticized its script, humor, use of product placement, tone, voice performances, lack of originality, and plot, with negative comparisons and similarities to other animated films.

The Emoji Movie was nominated for five awards at the 38th Golden Raspberry Awards2, winning four. It was the first animated film to win in any of those categories. It is frequently cited as the worst film of 2017, as well as one of the worst animated movies ever made. On the review aggregator website Rotten Tomatoes3, The Emoji Movie has an approval rating of 6% based on 134 professional reviews, with an average rating of 2.9/10. The movie has an audience rating of 3.4/10 on IMDb4.

Assignment

There's plenty of room for improvement here, is what we must have thought when coming up with this assignment. As a result, we used various techniques to encode the names of characters from animated movies in the form of emoji. This was done by replacing each letter in the name of the character with one or more emoji, without making a distinction between uppercase and lowercase letters. All non-letter characters in the name have simply been left in place. For example, this is such an encoded name:

πŸ‡πŸΊπŸ΅β˜ƒβ˜ƒ

To be able to decipher the encoded name, we give you a tip by means of a dictionary (dict) that maps each emoji (str) in the encoded name onto the name (str) of a character from an animated movie. The name of the animated character only consists of uppercase letters and the character itself is anthropomorphized5 version of what is represented by the emoji. These are the names of the animated characters that go with the emoji in the encoded name we used as an example above:

emoji name
β˜ƒ OLAF
πŸ‡ BUGSBUNNY
🐡 LOUIE
🐺 AKELA

In this case, the encoded name can be deciphered by replacing each emoji with the first letter of the name that goes with it according to the tip. This yields BALOO6 β€” the name of the anthropomorphic sloth bear who appears as a character in The Jungle Book7. But we also used other ways to encode names as sequences of emoji.

Your task:

Example

>>> first_letter('πŸ‡πŸΊπŸ΅β˜ƒβ˜ƒ', {'β˜ƒ': 'OLAF', 'πŸ‡': 'BUGSBUNNY', '🐡': 'LOUIE', '🐺': 'AKELA'})
'BALOO'
>>> first_letter('🐸🐺🧜', {'🐸': 'KERMIT', '🐺': 'AKELA', '🧜': 'ARIEL'})
'KAA'
>>> first_letter('πŸ§šβ˜ƒπŸ‘¦', {'β˜ƒ': 'OLAF', 'πŸ‘¦': 'MOWGLI', '🧚': 'TINKERBELL'})
'TOM'

>>> repeated_emoji('πŸ˜ΈπŸ§ΈπŸ§ΈπŸš—πŸš—πŸš—β˜ƒβ˜ƒβ˜ƒπŸ’°πŸ’°πŸ’°πŸ³πŸ³', {'β˜ƒ': 'OLAF', '🐳': 'MONSTRO', 'πŸ’°': 'SCROOGEMCDUCK', '😸': 'FELIXTHECAT', 'πŸš—': 'LIGHTNINGMCQUEEN', '🧸': 'WINNIETHEPOOH'})
'FIGARO'
>>> repeated_emoji('β„πŸ¦ŠπŸ¦ŠπŸ¦ŠπŸΊπŸΊπŸΊπŸ­πŸ­πŸ­πŸ˜ΈπŸ˜Έ 🐺🐺🐘🦘🦘🐾🐾', {'❄': 'SNOWWHITE', '🐘': 'HATHI', '🐭': 'JERRY', '🐺': 'AKELA', '🐾': 'SNOOPY', '😸': 'FELIXTHECAT', '🦊': 'JOHNWORTHINGTONFOULFELLOW', '🦘': 'KANGA'})
'SHERE KHAN'
>>> repeated_emoji('πŸ‘¦πŸ‘¦πŸ‘¦πŸ¦—πŸ¦—β„β„πŸ¦†πŸ¦†πŸ¦†πŸš—πŸš—πŸ€πŸ€πŸ€-⭐⭐⭐🦊🦊🦊🐀🐀🐀-πŸ§½πŸ§½πŸ³πŸ³πŸ°πŸ°πŸ‘§πŸ‘§', {'❄': 'SNOWWHITE', '⭐': 'PATRICKSTAR', '🐀': 'TWEETY', '🐰': 'ROGERRABBIT', '🐳': 'MONSTRO', 'πŸ‘¦': 'MOWGLI', 'πŸ‘§': 'SHANTI', 'πŸš—': 'LIGHTNINGMCQUEEN', 'πŸ¦†': 'DONALDDUCK', '🦊': 'JOHNWORTHINGTONFOULFELLOW', 'πŸ¦—': 'JIMINY', '🧽': 'SPONGEBOBSQUAREPANTS'})
'WINNIE-THE-POOH'

>>> next_letter('πŸΆπŸ§œπŸ§œπŸ±πŸ§œπŸ§œπŸ΅πŸ¦†', {'🐱': 'FIGARO', '🐡': 'LOUIE', '🐢': 'GOOFY', 'πŸ¦†': 'DONALDDUCK', '🧜': 'ARIEL'})
'GARFIELD'
>>> next_letter('πŸβ˜ƒπŸ§ΈπŸΆπŸ΅πŸ§Έ', {'β˜ƒ': 'OLAF', '🐁': 'MICKEYMOUSE', '🐡': 'LOUIE', '🐢': 'GOOFY', '🧸': 'WINNIETHEPOOH'})
'MOWGLI'
>>> next_letter('πŸ—πŸ΅πŸ—πŸ…πŸ΅', {'πŸ…': 'TIGGER', 'πŸ—': 'PUMBAA', '🐡': 'LOUIE'})
'PLUTO'
>>> next_letter('πŸΌπŸΌπŸ€“πŸΌπŸ§œπŸŸπŸΌπŸ™πŸ§œ', {'πŸ™': 'URSULA', '🐟': 'DORY', '🐼': 'PO', 'πŸ€“': 'MINION', '🧜': 'ARIEL'})
'POMPADOUR'

Epilogue

David Hampton planted douglas fir (Pseudotsuga menziesii) and larch trees (Larix) in a forest in Oregon to resemble a face. Every autumn the larch pines turn orange and the smiley face stands out.

happy forest
David Hampton planted douglas fir (Pseudotsuga menziesii) and larch trees (Larix) in a forest in Oregon to resemble a face. Every autumn the larch pines turn orange and the smiley face stands out.
happy forest
David Hampton planted douglas fir (Pseudotsuga menziesii) and larch trees (Larix) in a forest in Oregon to resemble a face. Every autumn the larch pines turn orange and the smiley face stands out.

The face is about 300 feet in diameter. Rope was used to measure the circle in which douglas fir was planted for the eyes and mouth. The rest of the face was filled out with larch. Both species will eventually be harvested but will smile at least for the next 30-50 years.