Created
August 20, 2016 15:03
-
-
Save TakashiHarada/0537c4d2adfa34ed2eb80804794e4895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
makeBitString :: Int -> [String] | |
makeBitString 0 = [] | |
makeBitString 1 = ["0","1"] | |
makeBitString w = map ('0':) (makeBitString (w-1)) ++ map ('1':) (makeBitString (w-1)) | |
makeMaskZeroString :: Int -> [String] | |
makeMaskZeroString w = ((map oneToMask) . makeBitString) w | |
where | |
oneToMask :: String -> String | |
oneToMask = (map (\c -> if c == '1' then '*' else c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment