7 kyu

Player Contact Manager

500 of 961IanEarley

Description:

You are the Dungeon Master for a public DnD game at your local comic shop and recently you've had some trouble keeping your players' info neat and organized so you've decided to write a bit of code to help keep them sorted!

The goal of this code is to create an array of objects that stores a player's name and contact number from a given string.

The method should return an empty array if the argument passed is an empty string or nil/None/null.

Examples

player_manager("John Doe, 8167238327, Jane Doe, 8163723827") returns [{player: "John Doe", contact: 8167238327}, {player: "Jane Doe", contact: 8163723827}]
player_manager(nil) returns []
player_manager("") returns []
player_manager("John Doe, 8167238327, Jane Doe, 8163723827") returns [{"player": "John Doe", "contact": 8167238327}, {"player": "Jane Doe", "contact": 8163723827}]
player_manager(None) returns []
player_manager("")   returns []
playerManager("John Doe, 8167238327, Jane Doe, 8163723827") returns [{player: "John Doe", contact: 8167238327}, {player: "Jane Doe", contact: 8163723827}]
playerManager(null) returns []
playerManager("")   returns []

Have at thee!

Arrays

Stats:

CreatedJun 12, 2018
PublishedJun 12, 2018
Warriors Trained1610
Total Skips13
Total Code Submissions5465
Total Times Completed961
Ruby Completions95
Python Completions394
JavaScript Completions500
Total Stars20
% of votes with a positive feedback rating91% of 265
Total "Very Satisfied" Votes221
Total "Somewhat Satisfied" Votes39
Total "Not Satisfied" Votes5
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • IanEarley Avatar
  • anter69 Avatar
  • FArekkusu Avatar
Ad