Back
Close

Artificial Emotional Intelligence

Statement

 Goal

You've been tasked to build an A.I. machine that can sense the essence and future of its human-partner/user. But that seems way too hard. What to do?

Then you remember that people are all pretty much the same, so using generic adjectives and destinies will perfectly fit most people most of the time. So you create 3 lists, shown below:
~ adjList = 20 Adjectives to generically describe a person
~ goodList = 6 phrases for common Good things that happen to a person
~ badList = 6 phrases for common Bad things that happen to a person

There are 6 vowels (a,e,i,o,u,y) and 20 consonants in the alphabet.
You decide you will use the first 3 unique consonants and the first 2 vowels in a person's name to create a customized Greeting to that person.

Here is an example for someone named "Missy Marie":
The first 3 unique consonants are: M, S, and R
"M" is the 10th consonant in the alphabet, "S" is the 15th, and "R" is the 14th.
The first 2 vowels are: I and Y
"I" is the 3rd vowel in the alphabet, and "Y" is the 6th.

So your mock-A.I. greets her like this:
It's so nice to meet you, my dear [10th word in adjList] name.
I sense you are both [15th word in adjList] and [14th word in adjList].
May our future together have much more [3rd phrase in goodList] than [6th phrase in badList].

... which becomes ...

It's so nice to meet you, my dear gregarious Missy Marie.
I sense you are both non-judgmental and honest.
May our future together have much more friendship than investment loss.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If a name doesn't have the letters required for this (like "John" or "Paw Paw") then output this basic greeting: "Hello name." (for example "Hello John.")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
About the name:
~Names often have spaces, hyphens, periods (and sometimes symbols and numbers) in them: Ignore all those. We only care about letters.
~It's fine if both of the first two vowels are the same, for example: if both are "A", as in "Lamar"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

adjList = "Adaptable Adventurous Affectionate Courageous Creative Dependable Determined Diplomatic Giving Gregarious Hardworking Helpful Hilarious Honest Non-judgmental Observant Passionate Sensible Sensitive Sincere"
goodList = "Love, Forgiveness, Friendship, Inspiration, Epic Transformations, Wins"
badList = "Crime, Disappointment, Disasters, Illness, Injury, Investment Loss"


Sources of the lists:
https://argoprep.com/blog/206-personality-adjectives-to-describe-anybody/
https://simplicable.com/en/life-events
Input
name
Output
The customized Greeting that is either 1-line or 3-lines long.
If it's the 3-line greeting, make sure it reads as normal sentences (adjust capitalization and spacing as needed).
Constraints
name can be upper or lower case or any combination thereof.
name can contain letters, numbers, and symbols.
name is at least 1 character long.
Example
Input
Frankie
Output
It's so nice to meet you, my dear courageous Frankie.
I sense you are both honest and hardworking.
May our future together have much more love than disasters.

Tags
Lists and ArraysStringsCharsArraysLists

Difficulty
Easy

Test cases
Simple case Test
Input
Frankie
Output
It's so nice to meet you, my dear courageous Frankie. I sense you are both honest and hardworking. May our future together have much more love than disasters.

Simple case (Validator) Validator
Input
Leighsa
Output
It's so nice to meet you, my dear giving Leighsa. I sense you are both creative and dependable. May our future together have much more forgiveness than disasters.

Repeating letters and space Test
Input
Meg Eagleton
Output
It's so nice to meet you, my dear gregarious Meg Eagleton. I sense you are both creative and giving. May our future together have much more forgiveness than disappointment.

Repeating letters and space (Validator) Validator
Input
Lee Annette
Output
It's so nice to meet you, my dear giving Lee Annette. I sense you are both hardworking and observant. May our future together have much more forgiveness than disappointment.

With hyphen and period Test
Input
K.D. Lang-McDonald
Output
It's so nice to meet you, my dear diplomatic K.D. Lang-McDonald. I sense you are both affectionate and giving. May our future together have much more love than illness.

With hyphen and period (Validator) Validator
Input
J.D. Salinger-Writer
Output
It's so nice to meet you, my dear determined J.D. Salinger-Writer. I sense you are both affectionate and non-judgmental. May our future together have much more love than disasters.

Symbols and numbers Test
Input
Sir A$AP the 2nd
Output
It's so nice to meet you, my dear non-judgmental Sir A$AP the 2nd. I sense you are both honest and helpful. May our future together have much more friendship than crime.

Symbols and numbers (Validator) Validator
Input
7-of-9! (from Star Trek)
Output
It's so nice to meet you, my dear courageous 7-of-9! (from Star Trek). I sense you are both honest and gregarious. May our future together have much more inspiration than illness.

You are not enough Test
Input
Libby
Output
Hello Libby.

You are not enough (Validator) Validator
Input
Acer
Output
Hello Acer.

With "Y" and "Z" Test
Input
Lizzy Rae
Output
It's so nice to meet you, my dear giving Lizzy Rae. I sense you are both sincere and honest. May our future together have much more friendship than investment loss.

With "Y" Validator Validator
Input
Yves Saint Laurent
Output
It's so nice to meet you, my dear passionate Yves Saint Laurent. I sense you are both non-judgmental and hardworking. May our future together have much more wins than disappointment.

Solution language

Solution

Stub generator input