Command-line flag to make the output random
This commit is contained in:
parent
e0cd78f64e
commit
ac9ce4d959
10
app/Main.hs
10
app/Main.hs
@ -1,6 +1,7 @@
|
||||
module Main (main) where
|
||||
|
||||
import System.Random
|
||||
import System.Environment
|
||||
|
||||
ordinals :: [ String ]
|
||||
ordinals = [
|
||||
@ -33,7 +34,7 @@ signatures = [
|
||||
]
|
||||
|
||||
offsets :: [ Int ]
|
||||
offsets = [ 0, 1, 1, 5, 8, 5, 20, 10, 23, 3, 3 ]
|
||||
offsets = reverse [ 0, 1, 1, 5, 8, 5, 20, 10, 23, 3, 3 ]
|
||||
|
||||
cardinals :: [ String ]
|
||||
cardinals = [
|
||||
@ -136,8 +137,7 @@ main :: IO ()
|
||||
main = do
|
||||
gen <- newStdGen
|
||||
let roffsets = randomOffsets gen allGifts
|
||||
print roffsets
|
||||
print (selectGifts roffsets)
|
||||
print (selectGifts $ reverse offsets)
|
||||
let tuples = zip ordinals $ selectGifts roffsets
|
||||
args <- getArgs
|
||||
let os = if (length args) > 0 then roffsets else offsets
|
||||
let tuples = zip ordinals $ selectGifts os
|
||||
putStrLn $ foldr (\a b -> a ++ "\n\n" ++ b) "" $ reverse $ recurseVerse tuples
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user