매우 효과적입니다!


42

매우 효과적입니다!

포켓몬에는 18 가지 유형이 있습니다 :

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

포켓몬은 단일 또는 이중 타이핑을 가질 수 있습니다. 예를 들어 Pikachu는 Electric이고 Tyranitar는 Rock/Dark입니다. 유형의 순서는 중요하지 않습니다. 포켓몬은 같은 유형을 두 번 가질 수 없습니다. 공격 움직임은 정확히 위의 18 가지 유형 중 하나입니다.

  • 일부 포켓몬 유형은 특정 유형의 공격에 약합니다. 예를 들어, Fire포켓몬은 Water공격에 약 합니다. 이것은 2의 피해 승수를 제공합니다.

  • 일부 포켓몬 유형은 특정 유형의 공격에 저항력이 있습니다. 예를 들어, Rock포켓몬은 Normal공격에 저항 합니다. 이로 인해 피해 배율이 0.5가됩니다.

  • 일부 포켓몬 유형은 특정 유형의 공격에 면역입니다. 예를 들어, Flying포켓몬은 Ground공격에 면역 입니다. 이것은 데미지 배율을 0으로합니다.

포켓몬은 이중 약점, 이중 저항력 또는 공격 유형에 대한 다른 조합 일 수 있습니다. 총 효과를 얻으려면 승수를 곱하십시오.

이동 유형과 포켓몬 유형이 지정된 프로그램이나 함수를 작성하면 공격의 총 피해 배수가 출력됩니다. 포케몬 입력 언제나처럼 하나 작성 A하거나 A/B, 경우 AB위의 목록에서 구별 유형이다. 이 형식의 포켓몬 입력을 수락해야합니다. 이 제한 이외에 합당한 방식으로 입력 할 수 있습니다. 허용되는 입력 형식의 예는 다음과 같습니다.

"Ice", "Dragon/Flying"

그러나 이것은 받아 들일 수 없습니다.

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

출력은 다음 문자열 중 하나 여야하며 선택적으로 후행 줄 바꿈이 있어야합니다.

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

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

타입 효과

인간 친화적 인 타입 차트는 Gamepedia 를 참조하고 싶습니다 . 골프 과정을 좀 더 빠르게 만들기 위해 컴퓨터 친화적 인 압축 매트릭스를 제공합니다. 모든 숫자를 2로 나누면 진정한 승수 (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

바이트 단위의 최단 코드가 이깁니다.


4
나는 비디오 게임 기반의 도전을 좋아합니다!
kirbyfan64sos

7
나는 요정 유형이 존재하지 않는 척합니다. 포켓몬은 추가할수록 악화됩니다.
mbomb007

34
PPCG는 CJam을 사용했습니다! 매우 효과적입니다! PPCG는 Java를 사용했습니다! 그다지 효과적이지 않습니다 ...
15:47에

10
m'mbomb007, 리틀 토게 키스의 말을 듣지 마십시오. 페어리 타이핑을 잘하는 사람은 누구나 알고 있습니다.
Geobits

4
누군가 Pikalang 로 답을 써야합니다 ! (행운.)
mbomb007

답변:


16

Pyth - 246 245 188 바이트

기본 압축으로 행렬을 인코딩하고, 아마도 행렬 인덱스에 대해 모듈 식 인덱싱 / 해싱을 사용하지만 지금은 그중에서도 아무것도하지 않았습니다.

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

테스트 스위트 .


10
이것이 라인 노이즈가 아닌 프로그램입니까?
Mark

17

자바, 663639 582 바이트

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;}

공간을 많이 차지하는 간단한 조회 테이블이 있습니다. 올바른 유형을 찾아서 곱합니다. 다음과 같이 호출하십시오.

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

줄 바꿈으로 다음과 같이 보입니다.

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
c="222...442".split(",");
Ypnypn

권리. 내가 다른 사람이 아닌 다른 사람을 위해 왜 그것을했는지 잘 모르겠습니다 : /
Geobits

이것을 우리에게 설명하고 싶습니까? 나는 매우 관심이 있지만 무슨 일이 일어나고 있는지 이해가 안
돼요

2
for(String B:b)for-loop를 24에서 15 [b[i++]]로 만들고 9를 절약 B하고 7을 더 절약 하여 바이트를 줄일 수 있습니까 ? 총 16 절약!
corsiKa

1
@Luminous 확실하지 않습니다. 을 반환하기 때문에 i나중에 빼거나 시작해야합니다 -1. 저장된 바이트를 무효화합니다.
Geobits

9

자바 스크립트 (ES6), 287

나는 유형의 압축이 잘 보이지 않았으므로 여기에 있습니다.

(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'

언 골프 드 :

(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';
}

오, 그리고 여기 내 차트가 있습니다 (문자가 아래에 나열된 단어와 일치하지 않도록 순서를 명심하십시오).

"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"

잘 했어! 나는 비슷한 생각을 가지고 있었지만 당신은 그것을 먼저 얻었습니다!
MayorMonty

1
로 이미 인코딩 된 값 문자열을 인코딩하면이를 사용하여 atob26 바이트를 절약 할 수 있습니다 btoa. 당신은 인코딩 할 때 그냥 이후 추가 문자를 추가 할 수 있는지 확인 "...pew5"하게 "...peww=="바이트 정렬로 인해.
SLuck49

감사합니다. 나는 그것을 시도했고 그것은 더 적은 문자이지만 더 많은 바이트 인 것처럼 보인다. 내가 뭔가 잘못하고 있습니까?
찰스

맞습니다. 바이트 수 대신 문자 수를 보았습니다 ... 바보 같은 UTF-8 멀티 바이트 문자.
SLuck49

@ SLuck49 승수를 인코딩하는 더 좋은 방법이있을 수 있습니다. 2가 모두 낭비되는 공간이 많이 있습니다.
찰스

9

피 칼랑, 868068 바이트

이것은 건너 뛸 생각이 너무 좋았습니다. ( 감사합니다, mbomb007. )

기본적으로 차선책입니다. 먼저 각 유형을 다음과 같이 인코딩합니다.

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

결과적으로 각 유형마다 고유 한 표현이 나타납니다. 빈 유형 (방어 포켓몬에 단일 유형 만있는 경우)은로 인코딩됩니다 0x00.

그 후 나는 if-else~ 5800 조합을 모두 확인하기 위해 동등한 엉망을 사용합니다 .

암호

스택 교환을 통해 코드 전체를 게시 할 수 없었으므로 여기에 gzipped + 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//9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cz9Rr6g1faAykvV4ZU1cKhOrCQDa7nANsDkIeQ0y90an3y7Od+/QIyYPoEmI9IQ0uITDXuZ6BNzrwHod59+J4k7kuDITqEiIkBkJ1YSCbXZg5jIWc6xlpjbRpGyxkdz0+hOoSIgTucg7OIdp1hphwTbilqy0EBAlxhTAxrrsh7fXiXEIugDT18hv1zKffLPvapz5G6hx/d44L9//jewMuvRAhQnTpEjK6cSHLIW/+BQERbJ84yIBtSoA09SJEiNHizh/aD8S5C1npMn2aPms2XYiQSZCmXoSUQ6guISEQo6pRtXS1hXBdYyFjGxeyu16cawGkqZcyyEOXsdRYWrPpYyHWKz1YIULqXBgI1TUWcq5nNjWbpm0wH6JrZD0hu+vxIR6IEAZkbz2DZ0LwPM6sfR83XnyqCwPJXxTMKANnlwlprxfnaj+QvfWMcwlx7vWzHXRh+RCqS8huiI1PaxwDaa8nZHe9JyFG0OgIehwmZqO+BYHeDiGDIZjGnQPb1QRp6kXIHRATpAlyxqZfDxnbeJxLiJAYyGZXez0h6RAz7KYMexwDZheECBHCg2Aadw5CslxCUlxniLF0UyxdfZjXb9TdG4y5MboQ9aguzByECNElZCTEIGuQnbHp10Pa68W5MBCqCwOhusZCbHxa43zIQ5dBNjrIfnm21H3zQgoRIsR60w5WSB6E6jpDzLDRGfY4TF9fr/h4yNjGhQgRQq8n5JsQU6optXS1B0Ha6wkRIoReDwPBNK5rocuoalSt2XQhQnRlQ9rrCdld70pIUy9XQIybxs3S1RYCgugSImSGCwOhuoTshpzr/Xvd4xf9/w/v9d85//kf/wsHs6nq5j4NAA==

분명히 공식 Pikalang 인터프리터는 아직 준비가되지 않았지만 사소한 Brainfuck 대체이므로 Brainfuck 인터프리터를 사용하여 테스트했습니다.

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

입력은 줄 바꿈으로 구분되며 추가 후행 줄 바꿈이 필요합니다.

이 프로그램은 메모리 위치 -1을 사용하므로 통역사가 테이프의 왼쪽 을 벗어나지 못하게 pipi하는 경우 코드 앞에 a 또는 a >(Pikalang 및 Brainfuck)를 ​​추가하십시오.

Brainfuck, 193708

다음은 Brainfuck의 동일한 프로그램입니다 (또한 gzipped + base64'd).

H4sICGI+6FUAC3N1cGVyZWZmZWN0aXZlLWdvbGZlZC5iZgDtXQt2GzkOPJDjOYEeL6Ln+19jbHmsyKNPgwSqUCDpfTuTqBokgC4WAEab/dP+nN9Pb2/t4/vfn794u/x8/u79+vP54fnP399+tD9Gs/Z+bu+n043t+d3yc27t7XQ6v398fLR2Pr21t4/Tx4NNPx9pb1+PfrSvjz43PH8anR778vP5F9K+f9Hefv+035//7ynb00ePDX9+evjzmaDPn/eviNpXnN+/+f7V29d/v//xzPz880quL+b8339+v7Pz3a/Ot1bn91+v9vrx6YRZH7Xuz7/b7c8npd6/2PP70ytmBnuepYBQ4xf4/ec4N+0rv1fklByI4kxRcBFuQVaGUgmwL0fu2yrEivr8GETjbCKOg3Mxy4HzSVYnkpGduKR6Qif+ObNvquBDwGaRYp4hRD+bV+mRXoJ5ehQ0+cVHXaDAKc0xRyRwbRrs9B7xfAEpKlsizpAqG0gkWMLVgRwo6hb2eAqJGKSbAaxb8kohFRQimSsgvX7bgKP8y58tb3HJmREXtWo54TSfu17iAxUaI6TCWahMlk8qGqeUxiB8fnI5QTROA3se34LlBb14KiddzpFBAuH2twsjQKjxC7xTCV1u2lfWmkiLEYs6a4jNU7f43FyCpE/pYsG4HY5DbXIa5c+bfPEwvvOJ7ip+Nk9VJAalIs66bUU+M8XmRrg0w/aQIVz4SUnTlla2ec5936TJa5ZOWZgqD3HSwL5HLG/UihMspGF++AhJhcwrExlVtGq9BEni5nUfatw0tQks6NSXqKiZ8JXVCDUSGHWk9RvDW+5UB5v25NYZnlIZfAJSNHAXPkd2RToi0IoDiyZqpxqPuqMSz7V8cQvA2+RUcoJePIgFXXadK20ZUqKHAYxoaavMjBd+YQn282nJr8nJgXrH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zJXdyynOHAvbjBecL30IrESnPmDLO2u22GuUPZ3U8YdS2CVnkwJmEYk16ESVNjT1PiAMZgiONwRSBN0tV+HGzv1o7w1w5lA+YgX2KPllxxOo31puaJpywRqNKaYcgHsf1N1NSKWE8r9BqC4TuPiVqggRplx3rHj2iP7F3g2Vk6W5z+XphxUf9HXcaNNa5Ga06qbli06t8T0D6+PYcXKbSxUQrNN3FV7s0UVLkUW4u+zajOpNR0oz4IhwKyZd3CSrBc5vwC7VuuAWk1tLfffPi6PFBg8IB4N/P60qlKM0gdxCodYG0K8+vKNCLhzbZMGnFefayKC9EMiCuVJoG8a1kXlCOBJJHBeH5hCTz4mn98EAgo+uSIsli1xNi8VPVby+in6ieS587N/sL9rrUNgviqYi8Vil8em0K286E81ryUmTyBASreK71cefhxSNK7pK5lnDbkNLdp6gaqstyR6QmZgo1pce+4slI8VyRbO6AEAOVF08xFpwRVEdKbNQ5tAo9I0nsXqGKugIFGyseCh1ZU2QZMNR5+PcCT5lELMEsQjR/sgKWiG4vOWka1zASt5b+iqNoCwnxLDdLdSVSjl3UdkBMXduuuxhQwAWJbVdjF2RlJeHrXHTrVgAYWkzkwDzjhe48HDiPZfzLDu5ZzeDUEzrx+1D7pjzuULNQhTE3+6upfT4z4ldMCLhCbVNqUyClJ9LTPdkFRFVJ03AOi7RRV5BIsYTrghmETPHcWIzVxAtSRQDrKhE6BJ9Dve42Tx9gXJslG4sPE7e46oyIC1wJrNJHLVEqY6JVOd9K4Go1Ml8oaoHUcaQHX4RdTtCL55O+x2jrVQjoxRV9FgvowrdPpJ3/aR//ArQnatCs9AIA

이 프로그램은 네 부분으로 구성됩니다.

  1. 입력. 유형을 읽고 식별자를 계산합니다.
  2. 텍스트 생성 가능한 각 출력에 대한 문자열 생성
  3. 조회 테이블. 이 부분은 컴퓨터로 생성되었습니다 (아래 참조). 포인터를 올바른 결과로 이동합니다.
  4. 출력. 결과를 인쇄하기 만하면됩니다.

주요 프로그램 구조

,>,[-<++>],[-<+++>] 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

조회 테이블을 생성하는 스크립트는 다음과 같습니다.

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,이 답변은 29817 바이트가 걸립니다. :)


실제로 통역사가 준비되지 않았습니까? 무엇에 대해 여기 ?
mbomb007

@ mbomb007 글쎄, 적어도 당신이 이전에 연결 한 것은 아니었다. 나는 그 하나 (BFC)에 대해 확실하지 않으며, 첫 페이지에 Pikalang을 나열하지 않으며 그것이 작동하는지 확실하지 않습니다 (공백을 올바르게 구문 분석 하거나 PIPI, >또는 로 해석 할 수 있음 ++). 또한 BFC는 분명히 코드를 대문자로 요구할 것입니다.
PurkkaKoodari 14

pikalang 버전을 제작 해 주셔서 감사합니다. @ Pietu1998. 재밌어요! 이 언어를 끝낼 시간을 찾을 수 있다면 빠르고 더러운 방법 대신에 내가 원하는 방식으로 다시 감사합니다
groteworld

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";}

입력은 stdin이어야하고 형식이어야합니다 Normal, Rock/Dragon

라이브 버전 .

공백이있는 경우 :

#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...]

스크립트는 비 UTF-8 바이트를 포함한 압축 데이터를 포함합니다. 기본 64로 인코딩 된 정확한 스크립트는 다음과 같습니다.

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

zlib압축 명령을 사용합니다 .


그것은 실제로 유효한 tcl 스크립트가 아닙니다.
slebetman

1
@slebetman base64로 인코딩 된 tcl 스크립트입니다.
orlp

2
그것이 무엇을 설명하고 싶습니까?
Charles

3

루아, 758 661 633 바이트

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

언 골프 드 :

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

전화 해 f("Grass","Water/Flying")


m한 번만 참조되므로 직접 값을 사용하면 개선 할 수 있다고 생각합니다 .
Ivo Beckers

내가의 액세스 저장, 당신을 오해하고있어 않는 한 me있기 때문에, 저렴를 e몇 번을 사용한다.
Nikolai97

아니 . 나는 m을 전혀 사용하지 않는 것을 의미합니다. 'm ='줄을 제거하고 'e = m [r]'를 전체 테이블을 m 자리에 붙여 넣으십시오.
Ivo Beckers

아 알았어, 난 이해하는 것 같아 다음과 같은 의미 e={...}[r]입니까? 내가 그것을 시도하고 합법적이지 않기 때문에 : /
Nikolai97

응 그랬어 그때 내가 틀렸다고 생각합니다. 합법적이라고 생각했습니다
Ivo Beckers

2

파이썬 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')

입력 형식은 이동 유형과 포켓몬 유형이며 공백으로 구분됩니다. 예를 들어 Fire Grass또는 Water Steel/Electric.

표는 각 문자의 색인이 40-103 범위 인 문자열이며 3 가지 유형 조합을 나타냅니다. 유형 목록은 각 유형의 3 번째 및 4 번째 문자 (존재하는 경우)로 저장되며 입력 된 각 유형의 3 번째 및 4 번째 문자와 비교됩니다.


난 당신이 사용하여 몇 가지 문자를 면도 할 수 있다고 생각 'rmghyiis...'.find(x[2:4])//2대신에"rm gh yi is ...".split().index(x[2:4])
Blckknght

오, 그것은 문자 eg문자에 대해 작동하지 않습니다 ... 아마 세 글자 접두어를 사용할 수 있으며 당신은 여전히 .find(...)//3대 에서 약간의 비용을 절감 할 수 있습니다.split().index(...)
Blckknght

3
깔끔하지만 입력 규칙을 따르지 않는다고 생각합니까? 이 규칙은 /예를 들어 이중 유형 포켓몬에 대해 두 유형 사이 에 요구하는 것에 대해 매우 구체적으로 보입니다 Steel/Electric.
mattnewport

아, 나는 그것을 놓쳤다. 이제 올바른 입력 형식을 허용합니다.
faubi

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;}

샘플 입력 :

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

샘플 출력 :

2x
0.5x
0x
0.25x
4x
1x
2x
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.