From 8a06e1a271d91653fd063a0c27757ac0f8518dcf Mon Sep 17 00:00:00 2001 From: BradleySmall <bradley_small@hotmail.com> Date: Mon, 26 Jan 2015 11:17:34 -0500 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 35cc595..6eebdb9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ codeseries ========== +Lock Combination Generator +A lock combination manufacturer needs to maintain a database of all +possible combinations for their locks. You are tasked with writing a +program that generates all possible legal combinations within the rules +set by the manufacturer. + +Rules +- Values for a position: A,B,C,D,E +- Number of positions: 6 +- Adjacent positions cannot differ by more than 2 (AC and BD are +valid adjacent positions; AD is not) +- No more than 3 contiguous positions can have the same value (AAA is +OK, AAAA is not) +- No more than 4 of the same value can be in a combination (AABBAA is +OK, AAABAA is not) + +The manufacturer wants to allow for future expansion, so the number and +values of positions must be configurable. (So, your program should be +able to handle values up to A-Z, and it should be able to handle 8 +positions, or 10, or even more.) The manufacturer will assign a lookup +code (starting with 1 and incrementing) to each combination. However, +the collection of combinations needs to be randomly shuffled before +assigning the lookup codes to them. The output should look something +like this: + +1: ABABAC +2: CDCDCA +3: ABCDEA +... + +When writing your code, be sure to utilize proper object-oriented +techniques and design. Show appropriate use of class construction. -- GitLab