8 kyu

Crash Override

5,631 of 10,163Peter 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 Trained21149
Total Skips928
Total Code Submissions50238
Total Times Completed10163
JavaScript Completions5631
Python Completions3885
Ruby Completions359
C# Completions554
Total Stars212
% of votes with a positive feedback rating85% of 1684
Total "Very Satisfied" Votes1302
Total "Somewhat Satisfied" Votes263
Total "Not Satisfied" Votes119
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