最耐用的口袋妖怪类型


9

背景

这个问题与类似。我已经提供了下面所有需要的信息。如果您熟悉其他挑战,请注意,我们正在对所有防御进行排名,而不是看到单个攻击的有效性。这很重要,因为这意味着这些表是彼此相反的,并且此挑战的目标是没有用户输入。

神奇宝贝中有18种类型:

Normal    Fighting  Flying  Poison  Ground  Rock
Bug       Ghost     Steel   Fire    Water   Grass
Electric  Psychic   Ice     Dragon  Dark    Fairy

宠物小精灵有一个或两个定义它们的独特类型(“类型组合”)。例如,Bulbasaur的类型组合为Grass / Poison(草和毒药两种),Charmander的类型组合为Fire(只有一种)。类型的顺序无关紧要(即草/毒物与毒/草相同)。

这些类型都有优点和缺点:

  • 一个类型可以弱于另一个类型。火对水微弱。这导致火对水具有2倍的乘数。
  • 一种类型可以抵抗另一种类型。水是耐水的。这导致水与水的乘数为0.5倍。
  • 一种类型可以不受另一种类型的影响。飞行不受地面影响。这导致Flying对地面的乘数为0x。

其他任何东西都会收到标准的1倍乘数。法线对法线将导致1倍乘数就是一个例子。这些优势和劣势也可以复合或消除。例如,火对水弱,但是火/水双重类型对水具有1倍的乘数,因为火的弱将抵消水的抵抗力。有关完整表格和更多说明,请参见下文。

目的

这里的目标是输出所有类型组合的列表,按其防御能力的顺序排序,并列出它们的(抵抗力+免疫力)数量,弱点以及它们之间的比率。具体来说,排序顺序如下:(抗性+免疫性)与弱性比率最佳的类型组合首先列出,并且如果存在平局,则具有最高抗性和免疫性的类型组合将赢得平局。您可以通过任何方式生成此列表(一种明显的方法是针对每种类型组合进行类型有效性计算,但是如果这样做会使它更短,则可以在程序中存储预先计算或部分预先计算的输出。)

类型有效性表

有关人类可读的表格,请参阅Pokemon数据库。 注意:此列表的各列是我们正在考虑的内容。但以防万一,这是我在压缩的计算机友好有效性矩阵中考虑的表格。我已经将每个值乘以2,所以我们不必处理讨厌的小数:

           Attacking type
            (same order)
   Nor   222222422222202222
   Fir   214211224221422211 
D  Wat   211441222222222212
e  Ele   222122224122222212
f  Gra   241114241424222222
e  Ice   242221422222422242 
n  Fig   222222222441122124  
d  Poi   222212114241222221
i  Gro   224044212222122222 
n  Fly   222414120221422222  
g  Psy   222222122214242422 
   Bug   242212121422422222 
T  Roc   114242414122222242
y  Gho   022222012221242422
p  Dra   211114222222224224   
e  Dar   222222422204212124
   Ste   142211404111121211  
   Fai   222222142221220142

如果此问题仅要求输出单类型类型组合,则有效输出应如下所示:

Steel -> 11/3 = 3.66
Electric -> 3/1 = 3
Poison -> 5/2 = 2.5
Fire -> 6/3 = 2
Water -> 4/2 = 2
Ghost -> 4/2 = 2
Fairy -> 4/2 = 2
Fly -> 4/3 = 1.333
Dragon -> 4/3 = 1.333
Fighting -> 3/3 = 1
Normal -> 1/1 = 1
Ground -> 3/3 = 1
Psychic -> 2/2 = 1
Bug -> 3/3 = 1
Dark -> 3/3 = 1
Grass -> 4/5 = 0.8
Rock -> 4/5 = 0.8
Ice -> 1/4 = 0.25

但是,您的程序还需要在输出中列出所有双重类型的组合,因此其输出将相当长。

祝你好运!以字节为单位的最短代码获胜。



3
欢迎来到PPCG!:)
Martin Ender

1
我认为这有一个明显的问题,就是答案比解决问题所需的数据要小,因此,成功的解决方案将只是对输出进行硬编码。为了解决该问题,您可能需要更改挑战以在运行时将类型有效性矩阵作为输入。

@ ais523我认为压缩矩阵应该是挑战的核心,原则上我认为没有错(尽管在这种情况下,不幸的是,这个精确的表以前一直是挑战的主题)。
马丁·恩德

2
@MartinEnder不仅相关...如果您翻阅简介,则将其100%复制,然后更改为看起来不像复制。它遵循完全相同的结构,起始类型以相同的顺序,格式相同。这只是公然窃而没有提及并试图隐藏它。
orlp

Answers:


2

Python 2,784字节

i=['Normal','222222422222202222'],['Fire','214211224221422211'],['Water','211441222222222212'],['Electric','222122224122222212'],['Grass','241114241424222222'],['Ice','242221422222422242'],['Fighting','222222222441122124'],['Poison','222212114241222221'],['Ground','224044212222122222'],['Flying','222414120221422222'],['Psychic','222222122214242422'],['Bug','242212121422422222'],['Rock','114242414122222242'],['Ghost','022222012221242422'],['Dragon','211114222222224224'],['Dark','222222422204212124'],['Steel','142211404111121211'],['Fairy','222222142221220142']
L=[]
for x,X in i:
 for y,Y in i[i.index([x,X]):]:
  S=W=0.
  for a,b in zip(X,Y):A=int(a)*int(b);W+=A>4;S+=A<4
  L+=[([x+'/'+y,x][x==y]+' -> %d/%d'%(S,W),S/W)]
for l in sorted(L, key=lambda l:-l[1]):print'%s = %.2f'%l

输出:

Bug/Steel -> 9/1 = 9.00
Steel/Fairy -> 11/2 = 5.50
Normal/Ghost -> 5/1 = 5.00
Water/Ground -> 5/1 = 5.00
Grass/Steel -> 10/2 = 5.00
Poison/Dark -> 5/1 = 5.00
Poison/Steel -> 10/2 = 5.00
Flying/Steel -> 10/2 = 5.00
Dragon/Steel -> 10/2 = 5.00
Normal/Steel -> 12/3 = 4.00
Electric/Poison -> 8/2 = 4.00
Electric/Steel -> 12/3 = 4.00
Ghost/Dark -> 4/1 = 4.00
Water/Steel -> 11/3 = 3.67
Dark/Steel -> 11/3 = 3.67
Steel -> 11/3 = 3.67
Fire/Steel -> 10/3 = 3.33
Fire/Ground -> 6/2 = 3.00
Water/Flying -> 6/2 = 3.00
Electric -> 3/1 = 3.00
Electric/Flying -> 6/2 = 3.00
Electric/Fairy -> 6/2 = 3.00
Ice/Steel -> 9/3 = 3.00
Fighting/Steel -> 9/3 = 3.00
Rock/Steel -> 9/3 = 3.00
Ghost/Steel -> 12/4 = 3.00
Fire/Electric -> 8/3 = 2.67
Water/Poison -> 8/3 = 2.67
Normal/Poison -> 5/2 = 2.50
Water/Electric -> 5/2 = 2.50
Poison -> 5/2 = 2.50
Ground/Flying -> 5/2 = 2.50
Ground/Steel -> 10/4 = 2.50
Psychic/Steel -> 10/4 = 2.50
Fire/Flying -> 7/3 = 2.33
Water/Fairy -> 7/3 = 2.33
Electric/Ghost -> 7/3 = 2.33
Normal/Electric -> 4/2 = 2.00
Normal/Fairy -> 4/2 = 2.00
Fire -> 6/3 = 2.00
Fire/Poison -> 8/4 = 2.00
Fire/Bug -> 6/3 = 2.00
Fire/Fairy -> 8/4 = 2.00
Water -> 4/2 = 2.00
Water/Ghost -> 8/4 = 2.00
Electric/Bug -> 4/2 = 2.00
Fighting/Poison -> 6/3 = 2.00
Poison/Fairy -> 6/3 = 2.00
Psychic/Ghost -> 4/2 = 2.00
Ghost -> 4/2 = 2.00
Ghost/Fairy -> 4/2 = 2.00
Dragon/Fairy -> 8/4 = 2.00
Fairy -> 4/2 = 2.00
Fire/Ghost -> 9/5 = 1.80
Normal/Fire -> 7/4 = 1.75
Fire/Rock -> 7/4 = 1.75
Fire/Dark -> 7/4 = 1.75
Poison/Dragon -> 7/4 = 1.75
Normal/Water -> 5/3 = 1.67
Fire/Water -> 5/3 = 1.67
Fire/Dragon -> 5/3 = 1.67
Water/Bug -> 5/3 = 1.67
Electric/Fighting -> 5/3 = 1.67
Ghost/Dragon -> 8/5 = 1.60
Fire/Fighting -> 6/4 = 1.50
Water/Dragon -> 3/2 = 1.50
Electric/Dragon -> 6/4 = 1.50
Electric/Dark -> 6/4 = 1.50
Poison/Ground -> 6/4 = 1.50
Poison/Flying -> 6/4 = 1.50
Poison/Rock -> 6/4 = 1.50
Poison/Ghost -> 6/4 = 1.50
Ground/Fairy -> 6/4 = 1.50
Flying/Dragon -> 6/4 = 1.50
Rock/Fairy -> 6/4 = 1.50
Fire/Psychic -> 7/5 = 1.40
Water/Fighting -> 7/5 = 1.40
Water/Dark -> 7/5 = 1.40
Grass/Fairy -> 7/5 = 1.40
Fighting/Dragon -> 7/5 = 1.40
Dragon/Dark -> 7/5 = 1.40
Normal/Flying -> 4/3 = 1.33
Fire/Grass -> 4/3 = 1.33
Fighting/Dark -> 4/3 = 1.33
Poison/Psychic -> 4/3 = 1.33
Ground/Dragon -> 4/3 = 1.33
Flying -> 4/3 = 1.33
Dragon -> 4/3 = 1.33
Dark/Fairy -> 4/3 = 1.33
Normal/Dragon -> 5/4 = 1.25
Water/Rock -> 5/4 = 1.25
Electric/Ground -> 5/4 = 1.25
Electric/Psychic -> 5/4 = 1.25
Electric/Rock -> 5/4 = 1.25
Grass/Poison -> 5/4 = 1.25
Fighting/Bug -> 5/4 = 1.25
Fighting/Ghost -> 5/4 = 1.25
Poison/Bug -> 5/4 = 1.25
Flying/Dark -> 5/4 = 1.25
Water/Psychic -> 6/5 = 1.20
Grass/Ghost -> 6/5 = 1.20
Ground/Ghost -> 6/5 = 1.20
Flying/Rock -> 6/5 = 1.20
Flying/Ghost -> 6/5 = 1.20
Flying/Fairy -> 6/5 = 1.20
Bug/Ghost -> 6/5 = 1.20
Bug/Fairy -> 6/5 = 1.20
Normal -> 1/1 = 1.00
Normal/Fighting -> 4/4 = 1.00
Normal/Ground -> 4/4 = 1.00
Normal/Psychic -> 2/2 = 1.00
Normal/Bug -> 3/3 = 1.00
Normal/Rock -> 5/5 = 1.00
Normal/Dark -> 3/3 = 1.00
Fire/Ice -> 4/4 = 1.00
Water/Grass -> 3/3 = 1.00
Electric/Grass -> 4/4 = 1.00
Grass/Fighting -> 6/6 = 1.00
Grass/Dark -> 7/7 = 1.00
Ice/Poison -> 5/5 = 1.00
Ice/Ghost -> 5/5 = 1.00
Ice/Fairy -> 4/4 = 1.00
Fighting -> 3/3 = 1.00
Fighting/Flying -> 5/5 = 1.00
Fighting/Fairy -> 5/5 = 1.00
Ground -> 3/3 = 1.00
Ground/Bug -> 4/4 = 1.00
Ground/Rock -> 6/6 = 1.00
Ground/Dark -> 6/6 = 1.00
Psychic/Dragon -> 6/6 = 1.00
Psychic/Fairy -> 3/3 = 1.00
Bug -> 3/3 = 1.00
Bug/Dragon -> 5/5 = 1.00
Bug/Dark -> 5/5 = 1.00
Rock/Ghost -> 6/6 = 1.00
Rock/Dark -> 7/7 = 1.00
Dark -> 3/3 = 1.00
Grass/Psychic -> 6/7 = 0.86
Fighting/Rock -> 6/7 = 0.86
Normal/Grass -> 5/6 = 0.83
Grass/Bug -> 5/6 = 0.83
Fighting/Ground -> 5/6 = 0.83
Ground/Psychic -> 5/6 = 0.83
Rock/Dragon -> 5/6 = 0.83
Grass -> 4/5 = 0.80
Grass/Flying -> 4/5 = 0.80
Flying/Psychic -> 4/5 = 0.80
Flying/Bug -> 4/5 = 0.80
Rock -> 4/5 = 0.80
Electric/Ice -> 3/4 = 0.75
Grass/Ground -> 3/4 = 0.75
Ice/Flying -> 3/4 = 0.75
Ice/Bug -> 3/4 = 0.75
Psychic/Rock -> 5/7 = 0.71
Grass/Dragon -> 4/6 = 0.67
Ice/Rock -> 4/6 = 0.67
Ice/Dark -> 4/6 = 0.67
Fighting/Psychic -> 2/3 = 0.67
Psychic -> 2/3 = 0.67
Psychic/Bug -> 4/6 = 0.67
Bug/Rock -> 2/3 = 0.67
Ice/Dragon -> 3/5 = 0.60
Grass/Ice -> 4/7 = 0.57
Normal/Ice -> 2/4 = 0.50
Water/Ice -> 2/4 = 0.50
Grass/Rock -> 2/4 = 0.50
Ice/Fighting -> 3/6 = 0.50
Psychic/Dark -> 1/2 = 0.50
Ice/Ground -> 2/5 = 0.40
Ice/Psychic -> 2/6 = 0.33
Ice -> 1/4 = 0.25

太棒了 正是我想要的。谢了哥们!
Devin White
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.