Gekitotsu codes fort + JVP algorithm using C ++ / Python processing code

Gekitotsu fortress the code length is a multiple of 6, wherein each of the six characters representing a unit, the six characters, the first bit represents the type of the unit, the unit comprising the last five values ​​of the angle .X .Y value information.

Then the first one actually represent? A diagram to show it.

img

So in the code to use a dictionary to express, if you use python

name={'v':'骨玉','3':'剑玉','8':'枪玉','a':'剃玉','M':'骑玉','L':'采玉',
      '1':'弓玉','7':'弩玉','2':'铳玉','x':'弹玉','b':'跳玉','z':'忍玉',
      'c':'裂玉','d':'散玉','B':'花玉','D':'押玉','e':'狙玉','O':'射玉',
      '5':'爆玉','9':'炮玉','f':'浮玉','g':'导玉','w':'击玉','N':'核玉',
      'k':'飞玉','l':'战玉','K':'旋玉','H':'坠玉','n':'变玉','J':'暗玉',
      '6':'魔玉','P':'星玉','S':'查玉','R':'贯玉','m':'机玉','Q':'捆玉',
      '4':'盾玉','j':'壁玉','o':'界玉','C':'返玉','E':'迎玉','G':'的玉',
      'I':'箱玉','A':'障玉','F':'赘玉','y':'圣玉','h':'缮玉','i':'愈玉',
      'p':'木要塞壁','q':'石要塞壁','r':'纸要塞壁','s':'钢要塞壁','t':'红加速','u':'蓝加速',
      'T':'近突击','U':'远突击','W':'蓝旋转','V':'紫旋转','X':'狙击壁','Y':'电梯'
      
     }

price={'v':10,'3':30,'8':30,'a':30,'M':150,'L':20,
      '1':30,'7':30,'2':70,'x':60,'b':70,'z':70,
      'c':70,'d':50,'B':70,'D':60,'e':70,'O':100,
      '5':50,'9':70,'f':70,'g':80,'w':70,'N':200,
      'k':150,'l':150,'K':150,'H':150,'n':100,'J':150,
      '6':200,'P':200,'S':200,'R':150,'m':200,'Q':200,
      '4':60,'j':150,'o':90,'C':60,'E':60,'G':50,
      'I':70,'A':60,'F':150,'y':200,'h':100,'i':100,
      'p':15,'q':40,'r':5,'s':100,'t':100,'u':250,
      'T':40,'U':50,'W':80,'V':80,'X':200,'Y':60
      
      }

If you are using C ++

map<string,string>m;
map<string,string>inm;

void init()
{
    m["v"]="骨玉";
    m["3"]="剑玉";
    m["8"]="枪玉";
    m["a"]="剃玉";
    m["M"]="骑玉";
    m["L"]="采玉";
    m["1"]="弓玉";
    m["7"]="弩玉";
    m["2"]="铳玉";
    m["x"]="弹玉";
    m["b"]="跳玉";
    m["z"]="忍玉";
    m["c"]="裂玉";
    m["d"]="散玉";
    m["B"]="花玉";
    m["D"]="押玉";
    m["e"]="狙玉";
    m["O"]="射玉";
    m["5"]="爆玉";
    m["9"]="炮玉";
    m["f"]="浮玉";
    m["g"]="导玉";
    m["w"]="击玉";
    m["N"]="核玉";
    m["k"]="飞玉";
    m["l"]="战玉";
    m["K"]="旋玉";
    m["H"]="坠玉";
    m["n"]="变玉";
    m["J"]="暗玉";
    m["6"]="魔玉";
    m["P"]="星玉";
    m["S"]="查玉";
    m["R"]="贯玉";
    m["m"]="机玉";
    m["Q"]="捆玉";
    m["4"]="盾玉";
    m["j"]="壁玉";
    m["o"]="界玉";
    m["C"]="返玉";
    m["E"]="迎玉";
    m["G"]="的玉";
    m["I"]="箱玉";
    m["A"]="障玉";
    m["F"]="赘玉";
    m["y"]="圣玉";
    m["h"]="缮玉";
    m["i"]="愈玉";
    m["p"]="木要塞壁";
    m["q"]="石要塞壁";
    m["r"]="纸要塞壁";
    m["s"]="钢要塞壁";
    m["t"]="红加速";
    m["u"]="蓝加速";
    m["T"]="近突击";
    m["U"]="远突击";
    m["W"]="蓝旋转";
    m["V"]="紫旋转";
    m["X"]="狙击壁";
    m["Y"]="电梯";
    map<string,string>::iterator it=m.begin();
    while(it!=m.end())
    {
        string key=it->first;
        string ans=it->second;
        inm[ans]=key;
        it++;
    }
}

Well, then it is finished processing the first, followed by the last five, we know XY angle are a three-digit number. So the angle value + X + Y value stitching up on it, such as the angle of 270, X 10 value , Y values ​​280, 270,010,280 is then spliced ​​together, in Gekitotsu fortress code, there are 52 letters (case) and the ten Arabic numerals 0-9, then with 62 denotes look like a band.

demo, Wada this being a cryptography devil, actually used the method 61 hexadecimal Pseudo be said that God is really the Buddha.

In this binary system:

  • 0-9 says 0-9
  • a to z represent 10-35
  • A to Z represent 36-61

For example 000P6R, is \ (. 4 + ^ 0 * 0 * 61 is 61 is 61 is ^ ^. 3 + 2 * P * +. 6-61 is R & lt Disp + \) , was out thanks to a number, it is to take the right-most three values Y, Ci three is the right X value, and the rest is perspective.

Note that this \ (the DISP \) values
\ [DISP = \ begin {cases } \\ 16020 & Jade unit when soldiers or fortress wall \\ \ end {cases} when the unit is 52,058 & fortress \]

We look at a change Gekitotsu an array (C ++) code implemented

while(s.length()!=0)
    {
        string type=s.substr(0,1);
        string info=s.substr(1,5);
        string name;
        int angle;
        int x;
        int y;
        if(isYaosai==1)
        {
            isYaosai=0;
            if(type=="0")name="普通要塞";
            if(type=="1")name="黑魔王";
            angle=0;
            int sum=0;
            each(i,0,4)
            {
                int num=0;
                char ch=info[i];
                //de(ch);
                if(ch>='0'&&ch<='9')num=ch-'0';
                if(ch>='a'&&ch<='z')num=ch-'a'+10;
                if(ch>='A'&&ch<='Z')num=ch-'A'+36;
                each(j,1,4-i)num*=61;
                sum+=num;

            }
            sum-=52058;
            x=sum/1000;
            y=sum%1000;
            fprintf(fp,"单位名称,角度,X,Y\n");
            fprintf(fp,"%s,%d,%d,%d\n",name.c_str(),angle,x,y);
        }
        //是兵玉的场合
        else{
            name=m[type];
            int sum=0;
            each(i,0,4)
            {
                int num=0;
                char ch=info[i];
                //de(ch);
                if(ch>='0'&&ch<='9')num=ch-'0';
                if(ch>='a'&&ch<='z')num=ch-'a'+10;
                if(ch>='A'&&ch<='Z')num=ch-'A'+36;
                each(j,1,4-i)num*=61;
                sum+=num;
            }
            sum-=16020;
            angle=sum/1000000;
            x=(sum%1000000)/1000;
            y=sum%1000;
            fprintf(fp,"%s,%d,%d,%d\n",name.c_str(),angle,x,y);
        }
        s=s.substr(6);
    }

use

Understand these things, you can go to look at the whole array of interesting things such as change control (you can change the dress floating fortress wall and tilt the force effect), random formation Builder AI do even front, but too difficult.

Guess you like

Origin www.cnblogs.com/Tony100K/p/11609221.html
Recommended