Our Lord and Saviour with Felicia Day (for source, see References below)

Code Snippet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env stack
{- stack
   --resolver lts-12.0
   --install-ghc
   script
   --ghc-options -Werror
   --ghc-options -Wall
   --package random
   --
-}

--------------------------------------------------------------------------------

module RNGesus (main) where

--------------------------------------------------------------------------------

import           System.Random
    ( newStdGen
    , randomRs
    )

--------------------------------------------------------------------------------

ppbool
  :: Bool
  -> Char

split
  :: Int
  -> [a]
  -> [[a]]

ppsplit
  :: Foldable t
  => t String
  -> IO ()

roll
  :: Int
  -> Int
  -> IO [ Bool ]

loop
  :: Int
  -> Int
  -> Int
  -> IO [String]

main
  :: IO ()

--------------------------------------------------------------------------------

ppbool True  = '■'
ppbool False = '□'

split _ [] = [              ]
split n xs = y : (split n ys)
  where
    (y,ys) = splitAt n xs

ppsplit xs =
  do
    putStr $ replicate 2 ' '
    mapM_ (putStr . (++ " ")) xs
    putStrLn ""

roll s n =
  -- `randomRs` is left-closed and right-closed
  newStdGen >>= pure . (map (< s)) . take n . randomRs (0,99)

loop =
  aux []
  where
    aux acc 0 _ _ = pure acc
    aux acc n s r =
      roll s r >>= \v -> aux (map ppbool v:acc) (n - 1) s r

main =
  do
    putStrLn "# FTK Hunter starts with 78 awareness and a Hunting Bow (3 roll)"
    putStrLn "256 rolls with 3 dices and 78 awareness:"
    putStrLn "```"
    loop 256 78 3 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "# We aim to max out awareness and use a Royal Bow (3 roll)"
    putStrLn "256 rolls with 3 dices and 95 awareness:"
    putStrLn "```"
    loop 256 95 3 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "As we can see, there are misses. What happens if we use 1 focus"
    putStrLn ""

    putStrLn "# FTK Hunter init: 78 awareness and a Hunting Bow"
    putStrLn "256 rolls with 2 dices and 78 awareness:"
    putStrLn "```"
    loop 256 78 2 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "# FTK Hunter end-game: 95 awareness and a Royal Bow"
    putStrLn "256 rolls with 2 dices and 95 awareness:"
    putStrLn "```"
    loop 256 95 2 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "As we can see, there are misses. What happens if we use 2 focus"
    putStrLn ""

    putStrLn "# FTK Hunter init: 78 awareness and a Hunting Bow"
    putStrLn "256 rolls with 1 dice and 78 awareness:"
    putStrLn "```"
    loop 256 78 1 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "# FTK Hunter end-game: 95 awareness and a Royal Bow"
    putStrLn "256 rolls with 1 dice and 95 awareness:"
    putStrLn "```"
    loop 256 95 1 >>= \ xs -> mapM_ ppsplit (split 16 xs)
    putStrLn "```"
    putStrLn ""

    putStrLn "And again we see misses. For more info, lookup `Probability` at:"
    putStrLn "- https://en.wikipedia.org/wiki/Probability"
    putStrLn ""

Code Output:

# FTK Hunter starts with 78 awareness and a Hunting Bow (3 roll)
256 rolls with 3 dices and 78 awareness:
```
  ■■■ ■■□ ■■□ ■■■ ■■■ ■■□ ■■■ ■□■ ■■■ ■□■ ■■■ ■■■ □■□ ■■■ ■■□ □□■ 
  ■■■ ■□■ □■□ ■■■ ■□□ ■■□ ■■□ ■□□ □■■ ■■■ ■■■ ■■□ ■■■ ■■■ □■■ ■■■ 
  ■■■ □■■ ■■■ ■■□ ■■□ ■■□ ■■□ ■■■ □■■ ■■■ ■■■ □■■ ■□■ □■■ ■□■ ■■■ 
  ■■■ ■□■ ■■□ ■■□ ■■■ ■■■ □■■ □■■ ■■■ □□■ □■■ ■■■ ■□■ ■□■ ■■□ ■□■ 
  □■■ ■■■ ■■■ ■□□ ■■■ ■■□ ■□□ ■■□ ■□■ □■■ ■■■ □■■ ■■■ ■□■ ■■■ ■■□ 
  □■■ □■■ ■■■ ■■■ ■■■ ■□■ □□■ □■■ ■□■ ■■□ □■■ ■■■ □■□ ■■■ ■□■ ■□■ 
  ■□□ ■■□ ■■■ ■■■ □■■ ■□□ ■□■ □■■ ■■■ □■■ ■■□ ■■□ ■■■ □□■ ■□■ ■■■ 
  ■■□ ■■■ ■□■ ■■□ ■■■ ■■■ ■□■ ■■■ ■□■ ■■■ ■■■ ■■■ □■■ □■■ ■■■ ■■■ 
  □■■ ■■■ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ □□■ ■■□ ■■■ □□■ 
  ■■■ ■■■ ■■■ ■□■ ■■■ ■■□ ■■■ ■■■ ■■■ □■■ □■■ ■■■ ■□□ ■■■ ■□□ □■■ 
  ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■□■ ■□□ □□□ ■■■ ■■■ ■■■ ■■□ 
  □□■ ■■■ ■■□ ■■□ ■■■ ■□■ ■■■ ■■■ □■■ □■□ □□□ ■■■ ■■□ ■■■ ■■■ ■■□ 
  ■□■ □■■ □■■ □■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ □□■ ■■■ ■■□ ■■■ ■□■ ■■■ 
  ■■■ □■□ ■■■ □■■ □■■ □■■ □■□ □□■ ■□□ ■■■ ■□■ ■■■ □■□ □■■ ■■■ ■■■ 
  ■■■ ■■■ □■□ ■■■ ■■■ ■■□ ■■■ ■■■ ■■□ □■■ ■□■ ■■■ ■■■ ■■■ ■■■ □■■ 
  ■□■ ■■■ ■■■ ■□■ □■■ ■■■ ■□■ ■■■ ■■■ ■■■ □■■ ■■■ □■□ □■■ ■■■ ■■■ 
```

# We aim to max out awareness and use a Royal Bow (3 roll)
256 rolls with 3 dices and 95 awareness:
```
  ■■■ ■■■ ■■■ ■■■ ■□■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■□ ■■■ ■■■ ■■■ ■■■ 
  ■■□ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■□ ■■■ □□■ ■□■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■■ ■■■ ■■■ □■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■■ ■■□ ■■■ ■■■ ■■□ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■□ ■■□ ■■■ ■■□ 
  ■■■ ■■□ ■■■ ■□■ ■■■ ■■□ ■■■ ■■■ ■■□ ■■■ ■■■ ■■■ ■■■ ■■□ ■■■ ■■■ 
  ■■■ ■■■ ■■■ ■■■ ■□■ ■■■ ■■□ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■□■ ■■□ ■■■ 
  ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■□ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ 
  ■■□ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■□■ ■■■ ■□■ 
  ■■■ ■■■ ■■■ ■■□ ■■■ □■■ ■■■ ■■■ ■□■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  □■■ ■■□ ■■■ ■■□ ■■■ ■■■ ■■■ ■□■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■□ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■□ 
  □■■ ■■■ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
  ■■■ ■■■ ■□■ ■■■ □■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ ■■■ 
```

As we can see, there are misses. What happens if we use 1 focus

# FTK Hunter init: 78 awareness and a Hunting Bow
256 rolls with 2 dices and 78 awareness:
```
  □■ ■■ □□ □■ □■ ■□ ■■ ■■ ■□ ■■ ■■ ■■ ■□ ■■ □■ □■ 
  □■ ■■ ■■ ■□ ■□ ■■ ■■ ■■ ■□ □■ ■□ ■■ ■■ ■■ ■■ □■ 
  ■■ ■■ ■■ ■□ ■□ ■■ □■ ■■ ■■ ■■ □■ □■ ■□ ■■ ■■ ■□ 
  ■■ ■■ ■■ ■■ ■■ ■■ □□ ■□ ■□ ■□ ■■ ■■ □■ ■■ ■■ ■■ 
  □□ ■■ ■□ ■■ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■■ ■■ 
  ■■ ■■ ■□ □■ ■■ ■■ ■■ ■□ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■■ 
  ■■ □■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ □■ ■■ ■■ ■□ ■■ ■■ 
  ■□ ■■ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■□ □■ □■ ■■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■□ ■■ ■□ ■■ ■■ □■ ■□ □□ ■■ ■■ ■■ ■■ 
  ■□ ■■ ■□ ■■ ■■ ■■ ■□ □□ ■■ ■■ ■■ ■□ ■□ ■■ ■■ ■□ 
  ■■ □□ □■ ■■ ■■ ■■ ■■ ■□ ■■ □■ ■■ ■□ ■■ ■■ ■■ ■■ 
  ■■ ■■ □□ ■■ □□ □■ ■□ □■ ■■ ■■ ■□ ■■ □□ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■□ ■□ ■■ ■■ ■■ □■ ■■ ■□ □■ ■□ ■■ □■ 
  ■■ □□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ ■■ ■□ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■□ ■■ ■□ ■■ ■■ ■■ ■■ □■ ■■ □■ ■■ ■■ ■■ 
  ■■ □■ ■■ □□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ □□ □■ ■□ 
```

# FTK Hunter end-game: 95 awareness and a Royal Bow
256 rolls with 2 dices and 95 awareness:
```
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ 
  ■■ ■□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ □■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■□ 
  ■□ ■■ ■■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ □□ ■□ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■□ ■□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■□ ■■ ■■ ■■ □■ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ □■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■□ ■■ ■■ ■■ 
  ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■□ ■■ ■■ ■■ ■■ 
  □■ ■■ ■■ ■■ □■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ 
  ■■ ■□ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ ■■ 
```

As we can see, there are misses. What happens if we use 2 focus

# FTK Hunter init: 78 awareness and a Hunting Bow
256 rolls with 1 dice and 78 awareness:
```
  ■ □ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ □ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ ■ ■ 
  ■ ■ □ ■ □ ■ ■ ■ □ ■ ■ ■ □ ■ ■ ■ 
  ■ ■ □ □ ■ ■ ■ ■ ■ □ ■ ■ □ ■ ■ ■ 
  ■ ■ □ □ ■ ■ ■ □ □ ■ ■ ■ ■ ■ ■ ■ 
  ■ □ □ ■ ■ ■ □ ■ ■ ■ □ □ ■ ■ ■ ■ 
  ■ □ ■ ■ □ ■ □ ■ ■ ■ ■ ■ □ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ ■ ■ ■ ■ 
  □ ■ ■ ■ ■ ■ □ ■ ■ □ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ □ ■ ■ ■ ■ 
  □ □ ■ □ ■ □ ■ ■ □ ■ □ ■ ■ ■ ■ ■ 
  □ ■ ■ □ □ □ ■ □ ■ □ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ □ □ ■ ■ ■ □ ■ ■ ■ ■ □ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ 
```

# FTK Hunter end-game: 95 awareness and a Royal Bow
256 rolls with 1 dice and 95 awareness:
```
  ■ ■ □ □ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ □ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ □ ■ ■ □ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ □ ■ 
  ■ ■ ■ ■ ■ ■ □ ■ ■ □ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ 
  □ ■ ■ □ ■ ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ 
  ■ ■ ■ ■ ■ □ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ □ ■ ■ ■ ■ ■ ■ ■ ■ 
  □ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ □ ■ ■ ■ □ □ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ □ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
```

And again we see misses. For more info, lookup `Probability` at:
- https://en.wikipedia.org/wiki/Probability

References: