Anonymous user
Lucky and even lucky numbers: Difference between revisions
m
→{{header|Haskell}}: the negation should be done as part of parsing arguments; also, get rid of case and just use multiple function definitions
m (→{{header|REXX}}: changed/added comments and whitespace, changed indentations.) |
m (→{{header|Haskell}}: the negation should be done as part of parsing arguments; also, get rid of case and just use multiple function definitions) |
||
Line 134:
nth :: Int -> Lucky -> Int
nth j l Lucky =
nth j
range :: Int -> Int -> Lucky -> [Int]
range x x2
range x x2 EvenLucky
EvenLucky -> drop (x-1) (take x2 (luckyNumbers evenNumbers))▼
interval :: Int -> Int -> Lucky -> [Int]
interval x x2
lucky :: [String] -> Lucky
Line 184 ⟶ 180:
exitSuccess
else do
print (interval (head numArgs) (- last numArgs) l)
exitSuccess
_ -> do
|