É super efetivo!


42

É super efetivo!

Em Pokémon existem 18 tipos:

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

Um Pokémon pode ter digitação simples ou dupla. Por exemplo, Pikachu é Electrice Tyranitar é Rock/Dark. A ordem dos tipos não importa. Um Pokémon não pode ter o mesmo tipo duas vezes. Uma jogada de ataque tem exatamente um dos 18 tipos acima.

  • Alguns tipos de Pokémon são fracos para um certo tipo de ataque. Por exemplo, um FirePokémon é fraco contra Waterataques. Isso dá um multiplicador de dano de 2.

  • Alguns tipos de Pokémon são resistentes a um certo tipo de ataque. Por exemplo, um RockPokémon é resistente a um Normalataque. Isso fornece um multiplicador de dano de 0,5.

  • Alguns tipos de Pokémon são imunes a um certo tipo de ataque. Por exemplo, um FlyingPokémon é imune a um Groundataque. Isso dá um multiplicador de dano de 0.

Um pokemon pode ser duplamente fraco, duplamente resistente ou qualquer outra combinação contra um tipo de ataque. Multiplique os multiplicadores para obter uma eficácia total.

Escreva um programa ou função que, devido ao tipo de movimento e à digitação de um Pokémon, produz o multiplicador de dano total do ataque. Uma digitação Pokémon é sempre escrita como Aou A/B, onde Ae Bsão tipos distintos da lista acima. Você deve aceitar o Pokémon digitando neste formato. Além desta restrição, você pode receber sugestões de qualquer maneira razoável. Um exemplo de formato de entrada aceitável é:

"Ice", "Dragon/Flying"

Mas isso é inaceitável:

["Ice", ["Dragon", "Flying"]]

Sua saída deve ser exatamente uma das seguintes seqüências de caracteres, seguida por uma nova linha à direita opcional:

0x    0.25x    0.5x    1x    2x    4x

Exemplos

Ground, Fire -> 2x
Normal, Rock/Dragon -> 0.5x
Fighting, Ghost/Steel -> 0x
Steel, Water/Steel -> 0.25x
Ice, Dragon/Flying -> 4x
Water, Ground/Water -> 1x
Ghost, Ghost -> 2x

Efetividade do tipo

Para um gráfico de tipos voltado para o ser humano, eu gostaria de encaminhá-lo para a Gamepedia . Para tornar o processo de golfe um pouco mais rápido, darei a você uma matriz de eficácia compacta e amigável ao computador. Divida cada número por dois para obter o multiplicador verdadeiro (1 -> 0,5, 4 -> 2):

              Defending type
               (same order)

   Normal   222221201222222222
   Fighting 421124104222214241
A  Flying   242221421224122222
t  Poison   222111210224222224
t  Ground   220424124421422222
a  Rock     214212421422224222
c  Bug      211122211124242241
k  Ghost    022222242222242212
i  Steel    222224221112124224
n  Fire     222221424114224122
g  Water    222244222411222122
   Grass    221144121141222122
T  Electric 224202222241122122
y  Psychic  242422221222212202
p  Ice      224242221114221422
e  Dragon   222222221222222420
   Dark     212222242222242211
   Fairy    242122221122222442

O menor código em bytes vence.


4
Adoro desafios baseados em videogame!
Kirbyfan64sos # 1/15

7
Prefiro fingir que o tipo Fairy não existe. Pokemon só está piorando quanto mais eles adicionam.
Mbomb007

34
O PPCG usou o CJam! É super efetivo! O PPCG usou Java! Não é muito eficaz ...
Fatalize

10
Não ouça o significado de mbomb007, pequeno Togekiss. Todo mundo sabe que você é melhor com a digitação de fadas.
Geobits 01/09/2015

4
Alguém deve escrever uma resposta em Pikalang ! (Boa sorte.)
mbomb007

Respostas:


16

Pyth - 246 245 188 bytes

Codifica a matriz com compactação de base, provavelmente usará indexação / hash modular para os índices da matriz, mas no momento não fiz nada de especial com eles.

Lxc"NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai"3<b3.F"{:g}x"*Fm@@c19cR2KXjC"
©ªªå´ê۩涪©Y+ªº;oªnz®©Z»­*«ªºj«¥fëª×­ª¯«Z¥ö]©ªâªÖ»ªj*î¥zzªªj«ªº«¥¹ªZ«ë¥ª¾"4]3]4yzydcw\/

Conjunto de Teste .


10
Tem certeza de que é um programa e não um ruído de linha?
Mark

17

Java, 663 639 582 bytes

String f(String...a){float d=1;for(String B:a[1].split("/"))d*=("222221201222222222421124104222214241242221421224122222222111210224222224220424124421422222214212421422224222211122211124242241022222242222242212222224221112124224222221424114224122222244222411222122221144121141222122224202222241122122242422221222212202224242221114221422222222221222222420212222242222242211242122221122222442".charAt(g(a[0])*18+g(B))-48)*.5;return(d+"x").replace(".0","");}int g(String a){int i=0;for(;i<18;i++)if(a.contains("N,gh,ly,oi,ou,ck,B,ho,S,re,W,G,E,P,I,g,k,y".split(",")[i]))break;return i;}

Há uma tabela de pesquisa simples que ocupa grande parte da sala. Ele apenas encontra os tipos corretos e os multiplica. Chame assim:

f("Water","Ground/Fire")

Com algumas quebras de linha, fica assim:

String f(String...a){
    float d=1;
    for(String B:a[1].split("/"))
        d*=("222221201222222222421124104222214241242221421224122222222111210224222224220424124421422222214212421422224222211122211124242241022222242222242212222224221112124224222221424114224122222244222411222122221144121141222122224202222241122122242422221222212202224242221114221422222222221222222420212222242222242211242122221122222442"
                .charAt(g(a[0])*18+g(B))-48)*.5;
    return(d+"x").replace(".0","");
}

int g(String a){
    int i=0;
    for(;i<18;i++)
        if(a.contains("N,gh,ly,oi,ou,ck,B,ho,S,re,W,G,E,P,I,g,k,y".split(",")[i]))
            break;
    return i;
}

1
Você pode raspar alguns bytes usandoc="222...442".split(",");
Ypnypn

Direita. Não sei por que fiz isso para um e não para o outro: /
Geobits

Você quer explicar isso para nós? Estou muito interessado, mas não entendo o que está acontecendo lol :)
duxfox--

2
Você poderia raspar bytes usando for(String B:b)fazer seu movimento loop for 24-15, poupando 9, e fazer o seu [b[i++]]em Bpara mais 7 poupança. Total de 16 economias!
CorsiKa

1
@ Luminoso Eu não tenho certeza sobre isso. Desde que eu volto i, preciso subtrair um mais tarde ou iniciá-lo -1, um dos quais negaria esse byte salvo.
Geobits

9

JavaScript (ES6), 287

Eu não vi uma boa compactação dos tipos, então aqui está uma.

(a,b)=>b.split('/').reduce((j,p)=>j*[0,.5,1,2][parseInt("kjwhcgnj2xd6elihtlneemw82duxijsazl3sh4iz5akjmlmsqds06xf1sbb8d0rl1nu7a2kjwi3mykjwlbpmk1up4mzl1iuenedor0bdmkjwmpk6rhcg4h3en3pew5".substr((g=x=>[..."BWSEIRNulkcDPotyeG"].findIndex(c=>x.match(c)))(a)*7,7),36).toString(4)[g(p)]],1)+'x'

Ungolfed:

(a,b)=>{
  // keys is a list of letters found in the types of attacks/defenses
  keys = [..."BWSEIRNulkcDPotyeG"]; 

  // getIndex is a single case statement.
  // it checks each of keys, one-by-one, falling through until we've found the proper index
  getIndex=x=>keys.findIndex(c=>x.match(c));

  // encodedValues is a list, indexed by `keys`, where each value is 7-characters.
  encodedValues = "kjwhcgnj2xd6elihtlneemw82duxijsazl3sh4iz5akjmlmsqds06xf1sbb8d0rl1nu7a2kjwi3mykjwlbpmk1up4mzl1iuenedor0bdmkjwmpk6rhcg4h3en3pew5";

  // the 7-character value (e.g., B=0="kjwhcgn", W=1="j2xd6el") were created by 
  // turning base4 values into base36, so let's turn this back into a string the same way
  valuesForAttack = parseInt(encodedValues.substr(getIndex(a)*7,7),36).toString(4);

  // valuesForAttack is indexed by defenseType.  The value will be 0..3, depending on the multiplier

  // let's get an array of the multipliers and reduce...
  multiplier = b.split('/').reduce((oldMultiplier,defenseType)=>oldMultiplier * [0,.5,1,2][valuesForAttack[getIndex(defenseType)]],1);

  return multiplier+'x';
}

Ah, e aqui está o meu gráfico (lembre-se de que ele foi solicitado para que uma letra não corresponda a nenhuma das palavras listadas abaixo):

"Bug" => "B",
"Water" => "W",
"Steel" => "S",
"Electric" => "E",
"Ice" => "I",
"Rock" => "R",
"Normal" => "N",
"Ground" => "u",
"Flying" => "l",
"Dark" => "k",
"Psychic" => "c",
"Dragon" => "D",
"Poison" => "P",
"Ghost" => "o",
"Fighting" => "t",
"Fairy" => "y",
"Fire" => "e",
"Grass" => "G"

Bom trabalho! Eu tive uma ideia parecida, mas você conseguiu primeiro!
MayorMonty

1
Se você codificar sua cadeia de valores já codificada atob, poderá salvar 26 bytes usando btoaisso. Ao codificá-lo, certifique-se de adicionar um caractere extra, pois este "...pew5"se "...peww=="deve ao alinhamento de bytes.
SLuck49

@ SLuck49 Obrigado. Eu tentei e parece que há menos caracteres, mas mais bytes. Estou fazendo algo errado?
Não que Charles

Atire, você está certo, eu estava olhando para a contagem de caracteres em vez da contagem de bytes ... estúpidos caracteres UTF-8 de vários bytes.
SLuck49

@ SLuck49 É provável que exista uma maneira melhor de codificar os multiplicadores. Há muito espaço desperdiçado com todos os 2's.
Não que Charles seja

9

Pontos, 868068 bytes

Foi uma idéia boa demais para ser ignorada. ( Obrigado, mbomb007. )

É basicamente uma tabela de pesquisa abaixo do ideal. Eu primeiro codifico cada tipo como

((first_char + second_char * 2 + third_char * 3) mod 256) - 0x3c

Isso resulta em representações exclusivas para cada tipo. O tipo vazio (quando o pokemon defensor tem apenas um único tipo) é codificado como 0x00.

Depois disso, apenas uso uma bagunça de if-elseequivalentes para verificar todas as ~ 5800 combinações.

Código

O Stack Exchange não me permitiu publicar o código como um todo, então aqui está o gzip + base64'd.

H4sICBA56FUAC3N1cGVyZWZmZWN0aXZlLWdvbGZlZC5wb2tlYmFsbADt2MGOHcdyreG5Ab+DXu3AEws90cTvb1utRrEOuzf3bmZV/mvFD+jyHotkxReRkclF/fXn27/++vOPv/78+4d//vfbv/74v3/++vO//vt//vj7X7z//Pv/+eDX/PjLfv7nx9/x/r+/+uf8mb//xd9VH/+u99/wYx/Qnt47+aexj//j/ad+4Pzqc49//op/DvE/P/zE/jiGj//34y8+T/b99x+/+3QOq8/tR95B/7mF0wb98RP4/NM/9vtT6d9ekMdfPX/7i5/++jd+9c+j37bkX29W3VU+9Gs/7tyeH//9zTj98Mm6//Xnv92fr3/L17/u03/z1b+kTOqH9/+zPwoe/vFwvByf//+v/Mnz6+KPfsVPP/c14dcffe1TPw7TOf7K6bRemdajOX7xuD3/w/vX/jmIz7LCmjLPIvIhTb0IKYdQXRiIrpvqOVkh97jezv8BxeT5xG/46WeWnpfLLETILAimF11ChAi5E2JANaBmb7AQrmssBNO4riiXc1hWDzNKIS+5TKQm0rSFHguxXunB6ip3YSCbXc5ByDP1jKXGUuii8iG6RtbjQ6guDETXyHpCWPVMn4z0eZxK+8ZtvNpUFwaSvy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1hXBdYyFjGxeyu16cawGkqZcyyEOXsdRYWrPpYyHWKz1YIULqXBgI1TUWcq5nNjWbpm0wH6JrZD0hu+vxIR6IEAZkbz2DZ0LwPM6sfR83XnyqCwPJXxTMKANnlwlprxfnaj+QvfWMcwlx7vWzHXRh+RCqS8huiI1PaxwDaa8nZHe9JyFG0OgIehwmZqO+BYHeDiGDIZjGnQPb1QRp6kXIHRATpAlyxqZfDxnbeJxLiJAYyGZXez0h6RAz7KYMexwDZheECBHCg2Aadw5CslxCUlxniLF0UyxdfZjXb9TdG4y5MboQ9aguzByECNElZCTEIGuQnbHp10Pa68W5MBCqCwOhusZCbHxa43zIQ5dBNjrIfnm21H3zQgoRIsR60w5WSB6E6jpDzLDRGfY4TF9fr/h4yNjGhQgRQq8n5JsQU6optXS1B0Ha6wkRIoReDwPBNK5rocuoalSt2XQhQnRlQ9rrCdld70pIUy9XQIybxs3S1RYCgugSImSGCwOhuoTshpzr/Xvd4xf9/w/v9d85//kf/wsHs6nq5j4NAA==

Exemplo

Aparentemente, o intérprete oficial do Pikalang ainda não está pronto, mas como é uma substituição trivial do Brainfuck, testei-o usando um intérprete do Brainfuck.

$ base64 -d supereff.pokeball.gz.b64 > supereff.pokeball.gz
$ gunzip supereff.pokeball.gz
$ pikalang supereff.pokeball
Normal
Rock/Dragon
0.5x

A entrada é separada por nova linha e requer uma nova linha à direita adicional.

O programa usa o local da memória -1, portanto, se o seu intérprete não permitir sair do lado esquerdo da fita, acrescente o código com a pipiou a >(para Pikalang e Brainfuck, respectivamente).

Brainfuck, 193708

Aqui está o mesmo programa no Brainfuck (também compactado com gzip + base64'd).

H4sICGI+6FUAC3N1cGVyZWZmZWN0aXZlLWdvbGZlZC5iZgDtXQt2GzkOPJDjOYEeL6Ln+19jbHmsyKNPgwSqUCDpfTuTqBokgC4WAEab/dP+nN9Pb2/t4/vfn794u/x8/u79+vP54fnP399+tD9Gs/Z+bu+n043t+d3yc27t7XQ6v398fLR2Pr21t4/Tx4NNPx9p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eH5hCTz4mn98EAgo+uSIsli1xNi8VPVby+in6ieS587N/sL9rrUNgviqYi8Vil8em0K286E81ryUmTyBASreK71cefhxSNK7pK5lnDbkNLdp6gaqstyR6QmZgo1pce+4slI8VyRbO6AEAOVF08xFpwRVEdKbNQ5tAo9I0nsXqGKugIFGyseCh1ZU2QZMNR5+PcCT5lELMEsQjR/sgKWiG4vOWka1zASt5b+iqNoCwnxLDdLdSVSjl3UdkBMXduuuxhQwAWJbVdjF2RlJeHrXHTrVgAYWkzkwDzjhe48HDiPZfzLDu5ZzeDUEzrx+1D7pjzuULNQhTE3+6upfT4z4ldMCLhCbVNqUyClJ9LTPdkFRFVJ03AOi7RRV5BIsYTrghmETPHcWIzVxAtSRQDrKhE6BJ9Dve42Tx9gXJslG4sPE7e46oyIC1wJrNJHLVEqY6JVOd9K4Go1Ml8oaoHUcaQHX4RdTtCL55O+x2jrVQjoxRV9FgvowrdPpJ3/aR//ArQnatCs9AIA

O programa contém quatro partes:

  1. A entrada. Lendo os tipos e calculando seus identificadores.
  2. A geração de texto. Gerando cadeias para cada uma das saídas possíveis.
  3. A tabela de pesquisa. Esta parte foi gerada por computador (veja abaixo). Move o ponteiro para o resultado correto.
  4. A saída. Apenas imprimindo o resultado.

Estrutura principal do programa

,>,[-<++>],[-<+++>] read first type id
++++++[-<---------->] subtract 3c
+[,----------] skip until newline
>,>,[-<++>],[-<+++>] read second type id
++++++[-<---------->] subtract 3c
>- set @LOOPFLAG@ to get into loop
[
 >-< set @CHARFLAG@
 <,---------- get character; newline is 00 slash is 25
 [ was not newline
  ------------------------------------- slash is now 00
  [ was not slash
   >>+<< reset @CHARFLAG@
   [-] clear character
  ]
 ]
 >>[ was newline or slash (@CHARFLAG@ set)
  <+>+ reset @LOOPFLAG@ and @CHARFLAG@
 ]<
]
,>,[-<++>],[-<+++>] read third type id
<[->+>+<<]>[-<+>] copy third to @CHARFLAG@
>[ if @CHARFLAG@ is set
 [-] clear @CHARFLAG@
 <++++++[-<---------->]> subtract 3c from third
]<
++++++++[- do 8 times
 >++++++ put a 0 here
 >+++++++++++++++ put an x here
 >>++++++ put a 0 here
 >++++++ put a 0 here
 >++++++ put a 0 here
 >+++++++ put a 8 here
 >+++++++++++++++ put an x here
 >>++++++ put a 0 here
 >++++++ put a 0 here
 >+++++++ put a 8 here
 >+++++++++++++++ put an x here
 >>++++++ put a 0 here
 >+++++++++++++++ put an x here
 >>++++++ put a 0 here
 >+++++++++++++++ put an x here
 >>++++++ put a 0 here
 >+++++++++++++++ put an x here
 <<<<<<<<<<<<<<<<<<<<<< go back
]
>>>>>-- change 0 to dot
>++ change 0 to 2
>--- change 8 to 5
>>>>-- change 0 to dot
>--- change 8 to 5
>>>+ change 0 to 1
>>>++ change 0 to 2
>>>++++ change 0 to 4
<<<<<<<<<<<<<<<<<<<<<< go back
(lookup table here)
>[.>] print result

Aqui está o script que gera a tabela de pesquisa:

typemap = [[int(value, 16), name] for value, name in [
    ["00", "(Nothing)"],
    ["02", "Ice"],
    ["07", "Fairy"],
    ["0f", "Dragon"],
    ["10", "Electric"],
    ["11", "Fighting"],
    ["12", "Grass"],
    ["1d", "Rock"],
    ["20", "Dark"],
    ["25", "Bug"],
    ["28", "Ghost"],
    ["2d", "Poison"],
    ["2e", "Steel"],
    ["32", "Fire"],
    ["39", "Water"],
    ["3c", "Ground"],
    ["46", "Normal"],
    ["4d", "Flying"],
    ["65", "Psychic"]
]]
multipliers = {
    0: 5,
    0.25: 8,
    0.5: 14,
    1: 19,
    2: 22,
    4: 25
}
types = [
    "Normal", "Fighting", "Flying", "Poison", "Ground", "Rock", "Bug", "Ghost", "Steel",
    "Fire", "Water", "Grass", "Electric", "Psychic", "Ice", "Dragon", "Dark", "Fairy"
]
results = [
    [2, 2, 2, 2, 2, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2],
    [4, 2, 1, 1, 2, 4, 1, 0, 4, 2, 2, 2, 2, 1, 4, 2, 4, 1],
    [2, 4, 2, 2, 2, 1, 4, 2, 1, 2, 2, 4, 1, 2, 2, 2, 2, 2],
    [2, 2, 2, 1, 1, 1, 2, 1, 0, 2, 2, 4, 2, 2, 2, 2, 2, 4],
    [2, 2, 0, 4, 2, 4, 1, 2, 4, 4, 2, 1, 4, 2, 2, 2, 2, 2],
    [2, 1, 4, 2, 1, 2, 4, 2, 1, 4, 2, 2, 2, 2, 4, 2, 2, 2],
    [2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 4, 2, 4, 2, 2, 4, 1],
    [0, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 2, 1, 2],
    [2, 2, 2, 2, 2, 4, 2, 2, 1, 1, 1, 2, 1, 2, 4, 2, 2, 4],
    [2, 2, 2, 2, 2, 1, 4, 2, 4, 1, 1, 4, 2, 2, 4, 1, 2, 2],
    [2, 2, 2, 2, 4, 4, 2, 2, 2, 4, 1, 1, 2, 2, 2, 1, 2, 2],
    [2, 2, 1, 1, 4, 4, 1, 2, 1, 1, 4, 1, 2, 2, 2, 1, 2, 2],
    [2, 2, 4, 2, 0, 2, 2, 2, 2, 2, 4, 1, 1, 2, 2, 1, 2, 2],
    [2, 4, 2, 4, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 0, 2],
    [2, 2, 4, 2, 4, 2, 2, 2, 1, 1, 1, 4, 2, 2, 1, 4, 2, 2],
    [2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 4, 2, 0],
    [2, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 2, 1, 1],
    [2, 4, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 4, 4, 2]
]
def getMultiplier(first, second, third):
    id1 = types.index(first)
    id2 = types.index(second)
    if third in types:
        id3 = types.index(third)
        return results[id1][id2] * results[id1][id3] / 4;
    else:
        return results[id1][id2] / 2

def genFirstType(second, third, remain, removed):
    mul = getMultiplier(remain[0][1], second, third)
    if len(remain) == 1:
        result = "[ first is not " + removed[1] + "\n"
        result += "thus first must be " + remain[0][1] + "\n"
        result += ">" * (multipliers[mul] - 1) + "[-]-> " + str(mul).replace(".", "").rstrip("0") + "x multiplier\n"
        result += "]\n"
        return result
    elif not removed:
        result = "<<" + "-" * remain[0][0] + " " + remain[0][1] + " is now 00\n"
        result += genFirstType(second, third, remain[1:], remain[0])
        result += "<+[ first is " + remain[0][1] + "\n"
        result += ">" * multipliers[mul] + "[-] " + str(mul).replace(".", "").rstrip("0") + "x multiplier\n"
        result += "]->\n"
        return result
    else:
        result = "[ first is not " + removed[1] + "\n"
        result += "-" * (remain[0][0] - removed[0]) + " " + remain[0][1] + " is now 00\n"
        result += genFirstType(second, third, remain[1:], remain[0])
        result += "<+[ first is " + remain[0][1] + "\n"
        result += ">" * multipliers[mul] + "[-] " + str(mul).replace(".", "").rstrip("0") + "x multiplier\n"
        result += "]->\n"
        result += "]\n"
        return result
def genSecondType(third, remain, removed):
    if len(remain) == 1:
        result = "[ second is not " + removed[1] + "\n"
        result += "thus second must be " + remain[0][1] + "\n"
        result += genFirstType(remain[0][1], third, typemap[1:], False)
        result += "]\n"
        return result
    elif not removed:
        result = "<<" + "-" * remain[0][0] + " " + remain[0][1] + " is now 00\n"
        result += genSecondType(third, remain[1:], remain[0])
        result += "<+[-> second is " + remain[0][1] + "\n"
        result += genFirstType(remain[0][1], third, typemap[1:], False)
        result += "<+]->\n"
        return result
    else:
        result = "[ second is not " + removed[1] + "\n"
        result += "-" * (remain[0][0] - removed[0]) + " " + remain[0][1] + " is now 00\n"
        result += genSecondType(third, remain[1:], remain[0])
        result += "<+[-> second is " + remain[0][1] + "\n"
        result += genFirstType(remain[0][1], third, typemap[1:], False)
        result += "<+]->\n"
        result += "]\n"
        return result
def genThirdType(remain, removed):
    if len(remain) == 1:
        result = "[ third is not " + removed[1] + "\n"
        result += "thus third must be " + remain[0][1] + "\n"
        result += genSecondType(remain[0][1], [item for item in typemap[1:] if item[1] != remain[0][1]], False)
        result += "]\n"
        return result
    elif not removed:
        result = "-" * remain[0][0] + " " + remain[0][1] + " is now 00\n"
        result += genThirdType(remain[1:], remain[0])
        result += "<+[-> third is " + remain[0][1] + "\n"
        result += genSecondType(remain[0][1], [item for item in typemap[1:] if item[1] != remain[0][1]], False)
        result += "<+]->\n"
        return result
    else:
        result = "[ third is not " + removed[1] + "\n"
        result += "-" * (remain[0][0] - removed[0]) + " " + remain[0][1] + " is now 00\n"
        result += genThirdType(remain[1:], remain[0])
        result += "<+[-> third is " + remain[0][1] + "\n"
        result += genSecondType(remain[0][1], [item for item in typemap[1:] if item[1] != remain[0][1]], False)
        result += "<+]->\n"
        result += "]\n"
        return result
def genLookup():
    return genThirdType(typemap, False)

def compact(code):
    import re
    return re.sub(r"[^+\-<>\[\],.]", "", code)
def golfStep(code):
    return code.replace("><", "").replace("<>", "").replace("+-", "").replace("-+", "")
def golf(code):
    previous = golfStep(code)
    while previous != code:
        previous, code = code, golfStep(code)
    return code

if __name__ == "__main__":
    import sys
    result = genLookup()
    if "-g" in sys.argv:
        print(golf(compact(result)))
    elif "-c" in sys.argv:
        print(compact(result))
    else:
        print(result)

BTW, esta resposta leva 29817 bytes. :)


Realmente, o intérprete não está pronto? E aqui ?
mbomb007

@ mbomb007 Bem, pelo menos o que você vinculou anteriormente não era. Não tenho certeza sobre esse (BFC), ele não lista o Pikalang na primeira página e também não tenho certeza se ele funciona (depende da análise correta dos espaços, PIPIpode ser interpretado como >ou ++). Aparentemente, o BFC aparentemente exigiria uma classificação superior do código.
PurkkaKoodari

Obrigado @ Pietu1998 por fazer a versão pikalang. Hilário! Agora, se eu pudesse encontrar tempo para terminar esse idioma, como eu quero, em vez da maneira rápida e suja. Obrigado novamente
groteworld 08/08

5

C ++ 14, 420 416

#include<iostream>
#include<string>
std::string m,t,n="NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai";int i;int main(){std::cin>>m>>t;auto k=[](auto y){return(i=6*n.find(m.substr(0,3))+n.find(y.substr(0,3))/3,i="J:2JJJ;YQJV>N:;ZIJJ5&ZJZ*[Y;KJVF;KZJ6I6YN>HJNJNFJZ:EYZJ:[UZIJ^J7JI:]9=JIZBJ>IINK:JFBZN:U:KJJ:JJ+FJNJN6NI:IJO"[i/3]-32>>i%3*2&3,i+i/3)/2.;};std::cout<<k(t)*((i=t.find(47)+1)?k(t.substr(i)):1)<<"x";}

A entrada deve ser stdin e estar no formato Normal, Rock/Dragon

Versão ao vivo .

Com algum espaço em branco:

#include<iostream>
#include<string>
std::string m, t, n = "NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai";
int i;
int main(){
    std::cin >> m >> t;
    auto k = [](auto y){
        return(i = 6 * n.find(m.substr(0, 3)) + n.find(y.substr(0, 3)) / 3
            , i = "J:2JJJ;YQJV>N:;ZIJJ5&ZJZ*[Y;KJVF;KZJ6I6YN>HJNJNFJZ:EYZJ:[UZI"
            "J^J7JI:]9=JIZBJ>IINK:JFBZN:U:KJJ:JJ+FJNJN6NI:IJO"[i / 3] - 32 >> i % 3 * 2 & 3
            , i + i / 3) / 2.;
    }; 
    std::cout << k(t)*((i = t.find(47) + 1) ? k(t.substr(i)) : 1) << "x";
}

3

Tcl, 382

proc p a\ d [zlib i ...361 bytes...]

O script contém dados compactados, incluindo bytes não UTF-8. Aqui está o script exato codificado na base 64:

cHJvYyBwIGFcIGQgW3psaWIgaSDFU7FugzAQ/ZU3pEuGlljqwlilibpUUVw7dEBc
Zo7jghUHI9uREiH+vUDA2NCqY2SJXDt87969XDvb5dkaXCTfSp+oxUN2QWKZjOPm
L1dlHC9RLetEnmiJPRJTSmGxOOApRSVFceAXVNVcbsOKHp/bb28nq0ZFeswtTm4+
SJBPhkiDX7nYEBmYSVijw6489l5Jx3/Dj0pIj47GWp0lXh2fN6w9R5FcdHasP1dE
HH7oMVxupkRmfpfn+lx298NOHXOADmbqKXcT9NDE1Se/dDFiRybiT7rb+Sunm1xb
0J1fwceOM/JcIoEfBaz+HVx0XHt0XjCROa/T587wvxPx7+dU4TS/wdQ1Emk41SxH
9d4+NomNyHIrilxmG3ltzU5cdKNcbmy1OhcHfCh2xMs5wzZXxuLTct6maI4varlu
YNQYvErOrBZcZlw7c2V5Y98Yx1rTrCFaU1x9xIZcblx9rbGg6Z0F7NM6TdMfXQ== 

Usa o zlibcomando para compactação.


Isso não é realmente um script tcl válido agora, é?
slebetman 02/09/2015

1
@slebetman É o script tcl codificado em base64.
orlp 2/09/2015

2
quer explicar o que faz?
Não que Charles,

3

Lua, 758 661 633 bytes

m={"222221201222222222","421124104222214241","242221421224122222","222111210224222224","220424124421422222","214212421422224222","211122211124242241","022222242222242212","222224221112124224","222221424114224122","222244222411222122","221144121141222122","224202222241122122","242422221222212202","224242221114221422","222222221222222420","212222242222242211","242122221122222442"}s="NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai"function f(a,d)z=string.sub n=tonumber _,r=s:find(z(a,1,3))r=r/3g,_,c=0,s:find(z(d,1,3))c=c/3p=d:find("/")or 0 e=m[r]_,g=s:find(z(d,p+1,p+3))g=g/3r=n(z(e,c,c))/2r=r*n(z(e,g,g))/2print(r.."x")end

Ungolfed:

m={"222221201222222222","421124104222214241","242221421224122222","222111210224222224","220424124421422222","214212421422224222","211122211124242241","022222242222242212","222224221112124224","222221424114224122","222244222411222122","221144121141222122","224202222241122122","242422221222212202","224242221114221422","222222221222222420","212222242222242211","242122221122222442"}
s="NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai"
function f(a,d)
    z=string.sub
    n=tonumber
    _,r=s:find(z(a,1,3))
    r=r/3
    g,_,c=0,s:find(z(d,1,3))
    c=c/3
    p=d:find("/") or 0
    e=m[r]
    _,g=s:find(z(d,p+1,p+3))
    g=g/3
    r=n(z(e,c,c))/2
    r=r*n(z(e,g,g))/2
    print(r.."x")
end

Ligue com f("Grass","Water/Flying")


Eu acho que você poderia melhorar usando o valor de mdiretamente, pois ele é referenciado apenas uma vez.
Ivo Beckers

A menos que eu esteja entendendo mal você, salvar o acesso de ma eé mais barato, porque eé usado algumas vezes.
Nikolai97

Não . Quero dizer não usar m. Remova a linha 'm =' e substitua 'e = m [r]' por colar a tabela inteira no lugar de m
Ivo Beckers

Ah, tudo bem, acho que entendi. Você quer dizer algo como isto e={...}[r]:? Porque eu tentei isso e não é legal: /
Nikolai97 2/15/15

Sim, eu quis dizer isso. Acho que estou enganado então. Pensei que seria legal
Ivo Beckers

2

Python 3-362

k,*l=['rm gh yi is ou ck g os ee re te as ec yc e ag rk ir'.split().index(x[2:4])for x in input().replace('/',' ').split()]
s=[[0,0.5,1,2][[(ord(m)-40)//4**q%4 for m in'RB:RRRCaYR^FVBCbQRR=.bRb2caCSR^NCSbR>Q>aVFPRVRVNRbBMabRBc]bQRfR?RQBeAERQbJRFQQVSBRNJbVB]BSRRBRR3NRVRV>VQBQRW'for q in(0,1,2)][k*18+z]]for z in l]
v=s[0]*(s[1:]or[1])[0]
print(str(v//1+v%1)+'x')

O formato de entrada é o tipo de movimentação e o tipo Pokemon, separados por espaços. Por exemplo Fire Grass, ou Water Steel/Electric.

A tabela é armazenada é uma sequência em que o índice de cada caractere está no intervalo de 40 a 103 e representa 3 combinações de tipos. A lista de tipos é armazenada como o 3º e o 4º (se existir) caracteres de cada tipo, que são comparados aos 3º e 4º caracteres de cada tipo digitado.


Eu acho que você pode raspar alguns personagens off usando 'rmghyiis...'.find(x[2:4])//2em vez de"rm gh yi is ...".split().index(x[2:4])
Blckknght

Oh, isso não funcionar para o nu ee gpersonagens .... talvez poderia ser usado três prefixos letras e você ainda tem algumas economias de .find(...)//3contra.split().index(...)
Blckknght

3
Legal, mas acho que não segue as regras de entrada? As regras parecem bastante específicas sobre a exigência de /dois tipos de Pokémons de dois tipos, por exemplo Steel/Electric.
mattnewport

Ah, eu senti falta disso. Agora ele aceita o formato de entrada apropriado.
faubi 4/09/15

1

PHP, 426

eval('f('.fgets(STDIN).');');
function f($a,$d){
    $x=1;$r=array_fill_keys(explode('/',$d),$a);
    while(list($d,$a)=each($r)) {
        $x*=substr(gmp_strval(gmp_init('26gXl6oUL8Ekoey31DRp2k1Jq85b0G3f1PsFPfEnL1P6Bxh4vSloX8zWWa4XPBAGavHMKLgaGhPp2JPA3qQI3L9kkQ4kSHvu2vm76aLpJmu6TV8qcPTO0hchrLRh6G9',62),5),n($a)*18+n($d),1)/2;
    }
    echo$x.'x';
}
function n($p){return strpos('NorFigFlyPoiGroRocBugGhoSteFirWatGraElePsyIceDraDarFai',substr($p,0,3))/3;}

Entrada de amostra:

"Ground", "Fire"
"Normal", "Rock/Dragon"
"Fighting", "Ghost/Steel"
"Steel", "Water/Steel"
"Ice", "Dragon/Flying"
"Water", "Ground/Water"
"Ghost", "Ghost"

Saída de amostra:

2x
0.5x
0x
0.25x
4x
1x
2x
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.