sln_2015_11
Copyright(c) Eric Mertens 2015
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

Synopsis

Documentation

main :: IO () Source #

solutions :: String -> [String] Source #

Compute the list of valid passwords starting from a given one. Note: This process works on reversed passwords with the rules updated to work on reversed strings. This is to make nextPassword easier to write.

isGoodPassword :: String -> Bool Source #

Check that a string satisfies the descending and duplicate letter rules.

hasPairs Source #

Arguments

:: [Char]

pairs seen so far

-> Int

count

-> String 
-> Bool 

Test that a string has at least count non-overlapping double, adjacent letters.

hasDesc :: String -> Bool Source #

Test that a string has a 3-length descending sequence.

isGoodLetter :: Char -> Bool Source #

Test that a character is not in the set of "iol"

startOnGood :: String -> String Source #

Clean out the starting prohibited letters

nextPassword :: String -> String Source #

Increment a string from left to right while skipping the prohibited characters.