import Data.Ratio import Data.List data Type = Normal | Fighting | Flying | Poison | Ground | Rock | Bug | Ghost | Steel | Fire | Water | Grass | Electric | Psychic | Ice | Dragon | Dark | Fairy everyType :: [Type] everyType = enumFrom Normal everyTypeCombo :: [[Type]] where rawPairs = liftM2 makePair everyType everyType makePair t1 t2 | t1 == t2 = [t1] | t1 < t2 = [t1, t2] multiTypeEff attack defendList = foldr effMul 1 defendList where effMul ty r = typeEff attack ty * r typeDefRank ts = rankList everyType where rankList ots = -- This determines how resistances and weaknesses are weighted. typeEffRank r | r == 0 = 3.3 | r == 1 = 0.0 -- Weighting of attacking types. Use this to specify what you're -- defending from. offensiveTypeRank Normal = 40.0 offensiveTypeRank Fighting = 30.0 offensiveTypeRank Flying = 80.0 offensiveTypeRank Poison = 0.0 offensiveTypeRank Ground = 20.0 offensiveTypeRank Rock = 0.0 offensiveTypeRank Bug = 10.0 offensiveTypeRank Ghost = 0.0 offensiveTypeRank Steel = 0.0 offensiveTypeRank Fire = 40.0 offensiveTypeRank Water = 0.0 offensiveTypeRank Grass = 0.0 offensiveTypeRank Electric = 0.0 offensiveTypeRank Psychic = 0.0 offensiveTypeRank Ice = 0.0 offensiveTypeRank Dragon = 0.0 offensiveTypeRank Dark = 0.0 offensiveTypeRank Fairy = 0.0 typeEff Normal Rock = 1 % 2 typeEff Normal Steel = 1 % 2 typeEff Normal Ghost = 0 typeEff Fighting Normal = 2 typeEff Fighting Rock = 2 typeEff Fighting Steel = 2 typeEff Fighting Ice = 2 typeEff Fighting Dark = 2 typeEff Fighting Flying = 1 % 2 typeEff Fighting Poison = 1 % 2 typeEff Fighting Bug = 1 % 2 typeEff Fighting Psychic = 1 % 2 typeEff Fighting Fairy = 1 % 2 typeEff Fighting Ghost = 0 typeEff Flying Fighting = 2 typeEff Flying Bug = 2 typeEff Flying Grass = 2 typeEff Flying Rock = 1 % 2 typeEff Flying Steel = 1 % 2 typeEff Flying Electric = 1 % 2 typeEff Poison Grass = 2 typeEff Poison Fairy = 2 typeEff Poison Poison = 1 % 2 typeEff Poison Ground = 1 % 2 typeEff Poison Rock = 1 % 2 typeEff Poison Ghost = 1 % 2 typeEff Poison Steel = 0 typeEff Ground Poison = 2 typeEff Ground Rock = 2 typeEff Ground Steel = 2 typeEff Ground Fire = 2 typeEff Ground Electric = 2 typeEff Ground Bug = 1 % 2 typeEff Ground Grass = 1 % 2 typeEff Ground Flying = 0 typeEff Rock Flying = 2 typeEff Rock Bug = 2 typeEff Rock Fire = 2 typeEff Rock Ice = 2 typeEff Rock Fighting = 1 % 2 typeEff Rock Ground = 1 % 2 typeEff Rock Steel = 1 % 2 typeEff Bug Grass = 2 typeEff Bug Psychic = 2 typeEff Bug Dark = 2 typeEff Bug Fighting = 1 % 2 typeEff Bug Flying = 1 % 2 typeEff Bug Poison = 1 % 2 typeEff Bug Ghost = 1 % 2 typeEff Bug Steel = 1 % 2 typeEff Bug Fire = 1 % 2 typeEff Bug Fairy = 1 % 2 typeEff Ghost Ghost = 2 typeEff Ghost Psychic = 2 typeEff Ghost Dark = 1 % 2 typeEff Ghost Normal = 0 typeEff Steel Rock = 2 typeEff Steel Ice = 2 typeEff Steel Fairy = 2 typeEff Steel Steel = 1 % 2 typeEff Steel Fire = 1 % 2 typeEff Steel Water = 1 % 2 typeEff Steel Electric = 1 % 2 typeEff Fire Bug = 2 typeEff Fire Steel = 2 typeEff Fire Grass = 2 typeEff Fire Ice = 2 typeEff Fire Rock = 1 % 2 typeEff Fire Fire = 1 % 2 typeEff Fire Water = 1 % 2 typeEff Fire Dragon = 1 % 2 typeEff Water Ground = 2 typeEff Water Rock = 2 typeEff Water Fire = 2 typeEff Water Water = 1 % 2 typeEff Water Grass = 1 % 2 typeEff Water Dragon = 1 % 2 typeEff Grass Ground = 2 typeEff Grass Rock = 2 typeEff Grass Water = 2 typeEff Grass Flying = 1 % 2 typeEff Grass Poison = 1 % 2 typeEff Grass Bug = 1 % 2 typeEff Grass Steel = 1 % 2 typeEff Grass Fire = 1 % 2 typeEff Grass Grass = 1 % 2 typeEff Grass Dragon = 1 % 2 typeEff Electric Flying = 2 typeEff Electric Water = 2 typeEff Electric Grass = 1 % 2 typeEff Electric Electric = 1 % 2 typeEff Electric Dragon = 1 % 2 typeEff Electric Ground = 0 typeEff Psychic Fighting = 2 typeEff Psychic Poison = 2 typeEff Psychic Steel = 1 % 2 typeEff Psychic Psychic = 1 % 2 typeEff Psychic Dark = 0 typeEff Ice Flying = 2 typeEff Ice Ground = 2 typeEff Ice Grass = 2 typeEff Ice Dragon = 2 typeEff Ice Steel = 1 % 2 typeEff Ice Fire = 1 % 2 typeEff Ice Water = 1 % 2 typeEff Ice Ice = 1 % 2 typeEff Dragon Dragon = 2 typeEff Dragon Steel = 1 % 2 typeEff Dragon Fairy = 0 typeEff Dark Ghost = 2 typeEff Dark Psychic = 2 typeEff Dark Fighting = 1 % 2 typeEff Dark Dark = 1 % 2 typeEff Dark Fairy = 1 % 2 typeEff Fairy Fighting = 2 typeEff Fairy Dragon = 2 typeEff Fairy Dark = 2 typeEff Fairy Poison = 1 % 2 typeEff Fairy Steel = 1 % 2 typeEff Fairy Fire = 1 % 2 typeEff _ _ = 1
Standard input is empty
(401.75,[Rock,Ghost]) (345.75,[Ghost,Electric]) (337.25,[Ghost,Steel]) (325.0,[Flying,Ghost]) (304.0,[Flying,Rock]) (303.75,[Ghost,Fire]) (301.0,[Ghost,Water]) (301.0,[Ghost,Dragon]) (287.875,[Rock,Electric]) (271.875,[Rock,Steel]) (259.0,[Ghost,Fairy]) (251.875,[Rock,Water]) (251.875,[Rock,Dragon]) (247.75,[Poison,Ghost]) (245.875,[Rock,Fire]) (245.0,[Normal,Ghost]) (245.0,[Ground,Ghost]) (245.0,[Ghost]) (239.5,[Flying,Steel]) (234.0,[Flying,Electric]) (231.0,[Ghost,Psychic]) (231.0,[Ghost,Dark]) (226.75,[Rock,Fairy]) (223.375,[Steel,Electric]) (222.5,[Ghost,Ice]) (214.0,[Fighting,Ghost]) (207.125,[Rock,Psychic]) (206.75,[Poison,Rock]) (205.5,[Bug,Ghost]) (195.875,[Ground,Rock]) (195.875,[Rock]) (192.0,[Flying,Fire]) (191.5,[Ghost,Grass]) (178.0,[Flying,Poison]) (178.0,[Flying,Water]) (178.0,[Flying,Dragon]) (178.0,[Flying,Fairy]) (165.875,[Normal,Rock]) (162.25,[Steel,Fairy]) (160.25,[Rock,Dark]) (156.75,[Water,Electric]) (156.75,[Electric,Dragon]) (156.75,[Electric,Fairy]) (153.875,[Steel,Water]) (153.875,[Steel,Dragon]) (150.75,[Fire,Electric]) (150.0,[Flying,Psychic]) (147.875,[Steel,Fire]) (142.25,[Poison,Steel]) (137.125,[Electric,Psychic]) (136.75,[Poison,Electric]) (134.25,[Steel,Psychic]) (131.375,[Ground,Steel]) (131.375,[Steel]) (122.0,[Flying]) (122.0,[Flying,Ground]) (114.75,[Fire,Water]) (114.75,[Fire,Dragon]) (114.75,[Fire,Fairy]) (112.0,[Water,Dragon]) (112.0,[Water,Fairy]) (112.0,[Dragon,Fairy]) (109.875,[Rock,Ice]) (101.375,[Normal,Steel]) (100.75,[Poison,Water]) (100.75,[Poison,Dragon]) (100.75,[Poison,Fairy]) (100.75,[Ground,Electric]) (100.75,[Electric]) (97.875,[Fighting,Rock]) (96.5,[Flying,Bug]) (94.75,[Poison,Fire]) (92.375,[Water,Psychic]) (92.375,[Psychic,Dragon]) (91.0,[Fighting,Flying]) (87.375,[Steel,Dark]) (86.75,[Fire,Psychic]) (84.0,[Psychic,Fairy]) (83.875,[Normal,Electric]) (80.0,[Normal,Flying]) (78.25,[Electric,Dark]) (72.75,[Poison,Psychic]) (66.0,[Flying,Dark]) (61.375,[Steel,Ice]) (61.375,[Electric,Ice]) (58.75,[Ground,Fire]) (58.75,[Fire]) (58.5,[Bug,Fairy]) (57.5,[Flying,Ice]) (56.0,[Ground,Water]) (56.0,[Ground,Dragon]) (56.0,[Ground,Fairy]) (56.0,[Rock,Bug]) (56.0,[Water]) (56.0,[Dragon]) (56.0,[Fairy]) (44.75,[Poison]) (44.75,[Poison,Ground]) (41.875,[Normal,Fire]) (40.5,[Flying,Grass]) (39.125,[Normal,Water]) (39.125,[Normal,Dragon]) (38.875,[Bug,Psychic]) (36.375,[Ground,Psychic]) (36.375,[Psychic]) (33.5,[Rock,Grass]) (33.5,[Water,Dark]) (33.5,[Dragon,Dark]) (33.375,[Fighting,Steel]) (30.5,[Poison,Bug]) (27.875,[Fire,Dark]) (27.75,[Fighting,Fire]) (25.0,[Fighting,Water]) (25.0,[Fighting,Dragon]) (25.0,[Fighting,Fairy]) (25.0,[Bug,Water]) (25.0,[Bug,Dragon]) (19.5,[Bug,Electric]) (14.0,[Normal,Fairy]) (13.75,[Fighting,Poison]) (11.0,[Bug,Fire]) (7.5,[Bug,Steel]) (2.75,[Normal,Poison]) (2.75,[Fighting,Electric]) (2.5,[Ground,Bug]) (2.5,[Bug]) (2.5,[Grass,Fairy]) (0.0,[Ground]) (0.0,[Dark,Fairy]) (-3.0,[Fighting,Psychic]) (-5.625,[Normal,Psychic]) (-8.5,[Ice,Fairy]) (-11.25,[Poison,Dark]) (-13.125,[Grass,Psychic]) (-14.125,[Fire,Ice]) (-15.625,[Psychic,Dark]) (-16.875,[Normal]) (-16.875,[Normal,Ground]) (-16.875,[Water,Ice]) (-16.875,[Ice,Dragon]) (-19.75,[Poison,Ice]) (-22.5,[Ground,Dark]) (-22.5,[Dark]) (-22.625,[Water,Grass]) (-22.625,[Grass,Dragon]) (-23.375,[Steel,Grass]) (-25.5,[Poison,Grass]) (-28.125,[Grass,Electric]) (-28.125,[Psychic,Ice]) (-31.0,[Fighting]) (-31.0,[Fighting,Ground]) (-39.375,[Ground,Ice]) (-39.375,[Ice]) (-39.5,[Normal,Bug]) (-45.0,[Fire,Grass]) (-45.125,[Ground,Grass]) (-45.125,[Bug,Dark]) (-45.125,[Grass]) (-47.875,[Normal,Fighting]) (-52.5,[Normal,Dark]) (-61.875,[Fighting,Dark]) (-62.0,[Normal,Grass]) (-63.5,[Fighting,Bug]) (-69.375,[Normal,Ice]) (-70.375,[Fighting,Ice]) (-72.0,[Grass,Dark]) (-75.0,[Ice,Dark]) (-79.5,[Bug,Ice]) (-95.125,[Bug,Grass]) (-102.0,[Grass,Ice]) (-119.5,[Fighting,Grass])