Functioninator 8000

Published by Matt in

Create a function that takes a single word string and does the following:

  1. Concatenates inator to the end if the word ends with a consonant, otherwise, concatenate -inator instead.

  2. Adds the word length of the original word to the end, supplied with "000".

The examples should make this clear.

Examples

inator_inator("Shrink") ➞ "Shrinkinator 6000"

inator_inator("Doom") ➞ "Doominator 4000"

inator_inator("EvilClone") ➞ "EvilClone-inator 9000"

Notes

N/A

Watch a quick demo on how Edabit works.