Skip to content

Some sample data you could use to help test your solution to the Phone Numbers code kata, and a script to create it.

License

Notifications You must be signed in to change notification settings

emilybache/Phone-Numbers-Kata

Repository files navigation

Support this and all my katas via Patreon

Phone Numbers Code Kata

This repo contains some sample data you could use to help test your solution to the Phone Numbers code kata. It also contains the python script I used to create the sample data. You can tweak it to create data that suits your needs.

To run the generate_data.py script, you'll need to install Python 3.

The Names.csv file is from "Generating Random Names as Test Data", and that page says it is adapted from US census data. I have just converted his file from excel to csv to make it easier to handle.

Kata description

A description of this Kata is available in my book "The Coding Dojo Handbook". The following description is however taken directly from http://cyber-dojo.com

Given a list of phone numbers, determine if it is consistent. In a consistent phone list no number is a prefix of another. For example:

  • Bob 91 12 54 26
  • Alice 97 625 992
  • Emergency 911

In this case, it is not possible to call Bob because the phone exchange would direct your call to the emergency line as soon as you dialled the first three digits of Bob's phone number. So this list would not be consistent.

About

Some sample data you could use to help test your solution to the Phone Numbers code kata, and a script to create it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages