8 kyu

Crash Override

5,579 of 10,022Peter Rhodes

Description:

Every budding hacker needs an alias! The Phantom Phreak, Acid Burn, Zero Cool and Crash Override are some notable examples from the film Hackers.

Your task is to create a function that, given a proper first and last name, will return the correct alias.

Notes:

  • Two objects that return a one word name in response to the first letter of the first name and one for the first letter of the surname are already given. See the examples below for further details.

  • If the first character of either of the names given to the function is not a letter from A - Z, you should return "Your name must start with a letter from A - Z."

  • Sometimes people might forget to capitalize the first letter of their name so your function should accommodate for these grammatical errors.


Examples

// These two objects are preloaded, you need to use them in your code
var firstName = {A: 'Alpha', B: 'Beta', C: 'Cache' ...}
var surname = {A: 'Analogue', B: 'Bomb', C: 'Catalyst' ...}

aliasGen('Larry', 'Brentwood') === 'Logic Bomb'
aliasGen('123abc', 'Petrovic') === 'Your name must start with a letter from A - Z.'
# These two hashes are preloaded, you need to use them in your code
FIRST_NAME = {'A': 'Alpha', 'B': 'Beta', 'C': 'Cache', ...}
SURNAME = {'A': 'Analogue', 'B': 'Bomb', 'C': 'Catalyst' ...}

alias_gen('Larry', 'Brentwood') == 'Logic Bomb'
alias_gen('123abc', 'Petrovic') == 'Your name must start with a letter from A - Z.'
# These two dictionaries are preloaded, you need to use them in your code
FIRST_NAME = {'A': 'Alpha', 'B': 'Beta', 'C': 'Cache', ...}
SURNAME = {'A': 'Analogue', 'B': 'Bomb', 'C': 'Catalyst' ...}

alias_gen('Larry', 'Brentwood') == 'Logic Bomb'
alias_gen('123abc', 'Petrovic') == 'Your name must start with a letter from A - Z.'
FirstName = {{"A", "Alpha"}, {"B", "Beta"}, {"C", "Cache"}, ...}
Surname = {{"A", "Analogue"}, {"B", "Bomb"}, {"C", "Catalyst"} ...}

// These dictionaries are defined on other partial Kata class

AliasGen('Larry', 'Brentwood') == 'Logic Bomb'
AliasGen('123abc', 'Petrovic') == 'Your name must start with a letter from A - Z.'

Happy hacking!

Strings
Fundamentals

Stats:

CreatedJul 18, 2016
PublishedJul 18, 2016
Warriors Trained20886
Total Skips911
Total Code Submissions49804
Total Times Completed10022
JavaScript Completions5579
Python Completions3809
Ruby Completions358
C# Completions541
Total Stars209
% of votes with a positive feedback rating85% of 1669
Total "Very Satisfied" Votes1291
Total "Somewhat Satisfied" Votes260
Total "Not Satisfied" Votes118
Ad
Contributors
  • Peter Rhodes Avatar
  • fenring76 Avatar
  • zebulan Avatar
  • anter69 Avatar
  • aryan-firouzian Avatar
  • 10XL Avatar
  • Chrono79 Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • BobtheLantern Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad