import Control.Monad
import Text.Printf
-- [オニキス, ゴールド, ランブルコイン, パスポイント, クリスタル]
勝利報酬 = [0,5000,200,0,0] :: [Double]
リザの宿題3回プレイ = [400,5000,0,0,30]
ランブルミッション3勝 = [200,3000,300,0,0]
ランブルミッション5勝 = [400,5000,300,0,0]
ランブルミッション10勝 = [600,10000,300,0,0]
ランブルミッション20勝 = [1200,10000,300,0,0]
ランブルミッションUNKNOWN1勝 = [600,5000,300,0,0]
ランブルミッションUNKNOWN2勝 = [1200,10000,300,0,0]
ランブルミッションUNKNOWN3勝 = [1800,15000,300,0,0]
デビルパスミッション3回プレイ = [0,0,0,21,0]
デビルパスミッション3勝 = [0,0,0,24,0]
デビルパスミッション5勝 = [0,0,0,24,0]
デビルパスミッション10勝 = [0,0,0,24,0]
デビルパスミッション20勝 = [0,0,0,24,0]
デビルパスミッションUNKNOWN1勝 = [0,0,0,24,0]
デビルパスミッションUNKNOWN2勝 = [0,0,0,24,0]
デビルパスミッションUNKNOWN3勝 = [0,0,0,24,0]
nul = [0,0,0,0,0]
合計3勝 =
zipWith (+) (liftM (3 *) 勝利報酬) $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
nul
合計5勝 =
zipWith (+) (liftM (5 *) 勝利報酬) $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
nul
合計10勝 =
zipWith (+) (liftM (10 *) 勝利報酬) $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) ランブルミッション10勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
zipWith (+) デビルパスミッション10勝 $
nul
合計20勝 =
zipWith (+) (liftM (20 *) 勝利報酬) $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) ランブルミッション10勝 $
zipWith (+) ランブルミッション20勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
zipWith (+) デビルパスミッション10勝 $
zipWith (+) デビルパスミッション20勝 $
nul
合計UNKNOWN1勝 =
zipWith (+) 勝利報酬 $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
nul
合計UNKNOWN2勝 =
zipWith (+) (liftM (2 *) 勝利報酬) $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) ランブルミッションUNKNOWN2勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN2勝 $
nul
合計UNKNOWN3勝 =
zipWith (+) (liftM (3 *) 勝利報酬) $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) ランブルミッションUNKNOWN2勝 $
zipWith (+) ランブルミッションUNKNOWN3勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN2勝 $
zipWith (+) デビルパスミッションUNKNOWN3勝 $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
nul
合計UNKNOWN3勝2勝 =
zipWith (+) (liftM (5 *) 勝利報酬) $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) ランブルミッションUNKNOWN2勝 $
zipWith (+) ランブルミッションUNKNOWN3勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN2勝 $
zipWith (+) デビルパスミッションUNKNOWN3勝 $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
nul
合計UNKNOWN3勝7勝 =
zipWith (+) (liftM (10 *) 勝利報酬) $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) ランブルミッションUNKNOWN2勝 $
zipWith (+) ランブルミッションUNKNOWN3勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN2勝 $
zipWith (+) デビルパスミッションUNKNOWN3勝 $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) ランブルミッション10勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
zipWith (+) デビルパスミッション10勝 $
nul
合計UNKNOWN3勝17勝 =
zipWith (+) (liftM (20 *) 勝利報酬) $
zipWith (+) ランブルミッションUNKNOWN1勝 $
zipWith (+) ランブルミッションUNKNOWN2勝 $
zipWith (+) ランブルミッションUNKNOWN3勝 $
zipWith (+) デビルパスミッションUNKNOWN1勝 $
zipWith (+) デビルパスミッションUNKNOWN2勝 $
zipWith (+) デビルパスミッションUNKNOWN3勝 $
zipWith (+) リザの宿題3回プレイ $
zipWith (+) ランブルミッション3勝 $
zipWith (+) ランブルミッション5勝 $
zipWith (+) ランブルミッション10勝 $
zipWith (+) ランブルミッション20勝 $
zipWith (+) デビルパスミッション3回プレイ $
zipWith (+) デビルパスミッション3勝 $
zipWith (+) デビルパスミッション5勝 $
zipWith (+) デビルパスミッション10勝 $
zipWith (+) デビルパスミッション20勝 $
nul
xs = [合計3勝, 合計5勝, 合計10勝, 合計20勝, nul, 合計UNKNOWN1勝, 合計UNKNOWN2勝, 合計UNKNOWN3勝, 合計UNKNOWN3勝2勝, 合計UNKNOWN3勝7勝, 合計UNKNOWN3勝17勝]
ys = [3, 5, 10, 20, 0, 1, 2, 3, 5, 10, 20]
xs' = nul:xs
ys' = 0:ys
----------------------------------------------------------------
合計 = xs
一勝あたり = [ liftM (flip (/) $ ys!!i) $ xs!!i | i <- [0..10] ]
差分 = [ liftM (flip (/) $ (ys'!!(i+1)) - (ys'!!i)) $ zipWith (-) (xs'!!(i+1)) (xs'!!i) | i <- [0..10] ]
割合 = [ zipWith (/) (xs!!i) 合計UNKNOWN3勝17勝 | i <- [0..10] ]
----------------------------------------------------------------
print1 x
| floor x == ceiling x = printf "%.0f" x
| x >= 100 = printf "%.0f" x
| x >= 10 = printf "%.1f" x
| x >= 1 = printf "%.2f" x
| x >= 0.1 = printf "%.3f" x
| otherwise = printf "%.0f" x
listToCSV xss = mapM f xss
where
f xs = mapM (\x -> print1 x >> putStr ", ") xs >> putStrLn ""
listToCSV' xss = mapM f xss
where
f xs = mapM (\x -> return (100 * x) >>= print1 >> putStr "%, ") xs >> putStrLn ""
-- listToCSV 合計
-- listToCSV 一勝あたり
-- listToCSV 差分
-- listToCSV' 割合
Comments
Post a Comment