feature-random #1
10
app/Main.hs
10
app/Main.hs
@ -1,6 +1,7 @@
|
|||||||
module Main (main) where
|
module Main (main) where
|
||||||
|
|
||||||
import System.Random
|
import System.Random
|
||||||
|
import System.Environment
|
||||||
|
|
||||||
ordinals :: [ String ]
|
ordinals :: [ String ]
|
||||||
ordinals = [
|
ordinals = [
|
||||||
@ -33,7 +34,7 @@ signatures = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
offsets :: [ Int ]
|
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 :: [ String ]
|
||||||
cardinals = [
|
cardinals = [
|
||||||
@ -136,8 +137,7 @@ main :: IO ()
|
|||||||
main = do
|
main = do
|
||||||
gen <- newStdGen
|
gen <- newStdGen
|
||||||
let roffsets = randomOffsets gen allGifts
|
let roffsets = randomOffsets gen allGifts
|
||||||
print roffsets
|
args <- getArgs
|
||||||
print (selectGifts roffsets)
|
let os = if (length args) > 0 then roffsets else offsets
|
||||||
print (selectGifts $ reverse offsets)
|
let tuples = zip ordinals $ selectGifts os
|
||||||
let tuples = zip ordinals $ selectGifts roffsets
|
|
||||||
putStrLn $ foldr (\a b -> a ++ "\n\n" ++ b) "" $ reverse $ recurseVerse tuples
|
putStrLn $ foldr (\a b -> a ++ "\n\n" ++ b) "" $ reverse $ recurseVerse tuples
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user