[text] Vincent

Viewer

  1.  for (int i=0; i<tabdejeu.length;i++){
  2.             int x=0,y=0;
  3.             if (i<=5){
  4.                 x=0;
  5.                 y=i+5;
  6.             }
  7.             else if (i<16){
  8.                 x=i-5;
  9.                 y=10;
  10.             }
  11.             else if (i<26){
  12.                 x=10;
  13.                 y=25-i;
  14.             }
  15.             else if (i<36){
  16.                 x=35-i;
  17.                 y=0;
  18.             }
  19.             else if (i<40){
  20.                 x=0;
  21.                 y=i-35;
  22.             }
  23.             else if (i==40){
  24.                 x=1;
  25.                 y=5;
  26.             }
  27.             else if (i==44){
  28.                 x=2;
  29.                 y=5;
  30.             }
  31.             else if (i==48){
  32.                 x=3;
  33.                 y=5;
  34.             }
  35.             else if (i==52){
  36.                 x=4;
  37.                 y=5;
  38.             }
  39.             else if (i==56){
  40.                 x=5;
  41.                 y=5;
  42.             }
  43.             else if (i==41){
  44.                 x=5;
  45.                 y=9;
  46.             }else if (i==45){
  47.                 x=5;
  48.                 y=8;
  49.             }
  50.             else if (i==49){
  51.                 x=5;
  52.                 y=7;
  53.             }
  54.             else if (i==53){
  55.                 x=5;
  56.                 y=6;  
  57.             }
  58.               else if (i==42){
  59.                 x=9;
  60.                 y=5;
  61.             }else if (i==46){
  62.                 x=8;
  63.                 y=5;
  64.             }
  65.             else if (i==50){
  66.                 x=7;
  67.                 y=5;
  68.             }
  69.             else if (i==54){
  70.                 x=6;
  71.                 y=5;  
  72.             }  else if (i==43){
  73.                 x=5;
  74.                 y=1;
  75.             }else if (i==47){
  76.                 x=5;
  77.                 y=2;
  78.             }
  79.             else if (i==51){
  80.                 x=5;
  81.                 y=3;
  82.             }
  83.             else if (i==55){
  84.                 x=5;
  85.                 y=4;  
  86.             }
  87.             switch (tabdejeu[i]){
  88.                 case 1 :
  89.                     tabLab[x][y].setIcon(iconDepart);
  90.                     break;
  91.                 case 2 :
  92.                     tabLab[x][y].setIcon(IconAdule);
  93.                     break;
  94.                 case 3 :
  95.                     tabLab[x][y].setIcon(IconArmure);
  96.                     break;
  97.                 case 4 :
  98.                     tabLab[x][y].setIcon(IconOR);
  99.                     break;
  100.                 case 5 :
  101.                     tabLab[x][y].setIcon(IconBourse);
  102.                     break;
  103.                 case 6 :
  104.                     tabLab[x][y].setIcon(IconRouille);
  105.                     break;
  106.                 case 7 :
  107.                     tabLab[x][y].setIcon(IconMystere);
  108.                     break;
  109.                 case 8 :
  110.                     tabLab[x][y].setIcon(IconQuête);
  111.                     break;
  112.                 case 9 :
  113.                     tabLab[x][y].setIcon(iconVictoire);
  114.                     break;
  115.                  case 10 :
  116.                     tabLab[x][y].setIcon(IconSeul);
  117.                     break;    
  118.             }
  119.         }
  120.          int x=0,y=0;
  121.             if (pos1<=5){
  122.                 x=0;
  123.                 y=pos1+5;
  124.             }
  125.             else if (pos1<16){
  126.                 x=pos1-5;
  127.                 y=10;
  128.             }
  129.             else if (pos1<26){
  130.                 x=10;
  131.                 y=25-pos1;
  132.             }
  133.             else if (pos1<36){
  134.                 x=35-pos1;
  135.                 y=0;
  136.             }
  137.             else if (pos1<40){
  138.                 x=0;
  139.                 y=pos1-35;
  140.             }
  141.            else if (pos1==40){
  142.                  x=1;
  143.                  y=5;
  144.             }
  145.             else if (pos1==41){
  146.                  x=5;
  147.                  y=9;
  148.             }
  149.             else if (pos1==42){
  150.                  x=9;
  151.                  y=5;
  152.             }
  153.             else if (pos1==43){
  154.                  x=5;
  155.                  y=1;
  156.             }
  157.             else if (pos1==44){
  158.                  x=2;
  159.                  y=5;
  160.             }
  161.             else if (pos1==45){
  162.                  x=5;
  163.                  y=8;
  164.             }
  165.             else if (pos1==46){
  166.                  x=8;
  167.                  y=5;
  168.             }
  169.              else if (pos1==47){
  170.                  x=5;
  171.                  y=2;
  172.             }
  173.              else if (pos1==48){
  174.                  x=3;
  175.                  y=5;
  176.             }
  177.              else if (pos1==49){
  178.                 x=7;
  179.                 y=5;
  180.             }
  181.              else if (pos1==50){
  182.                 x=7;
  183.                  y=5;
  184.             }
  185.              else if (pos1==51){
  186.                 x=5;
  187.                  y=3;
  188.             }
  189.              else if (pos1==52){
  190.                  x=4;
  191.                  y=5;
  192.             }
  193.              else if (pos1==53){
  194.                  x=6;
  195.                  y=5;
  196.             }
  197.              else if (pos1==54){
  198.                x=6;
  199.                  y=5;
  200.             }
  201.              else if (pos1==55){
  202.                x=5;
  203.                  y=4;
  204.             }
  205.              else if (pos1==56){
  206.                  x=5;
  207.                  y=5;
  208.             }
  209.             
  210.             tabLab[x][y].setIcon(iconChevalier1);
  211.             
  212.                
  213.             if (pos2<=5){
  214.                 x=0;
  215.                 y=pos2+5;
  216.             }
  217.             else if (pos2<16){
  218.                 x=pos2-5;
  219.                 y=10;
  220.             }
  221.             else if (pos2<26){
  222.                 x=10;
  223.                 y=25-pos2;
  224.             }
  225.             else if (pos2<36){
  226.                 x=35-pos2;
  227.                 y=0;
  228.             }
  229.             else if (pos2<40){
  230.                 x=0;
  231.                 y=pos2-35;
  232.             }
  233.            else if (pos2==40){
  234.                  x=1;
  235.                  y=5;
  236.             }
  237.             else if (pos2==41){
  238.                  x=5;
  239.                  y=9;
  240.             }
  241.             else if (pos2==42){
  242.                  x=9;
  243.                  y=5;
  244.             }
  245.             else if (pos2==43){
  246.                  x=5;
  247.                  y=1;
  248.             }
  249.             else if (pos2==44){
  250.                  x=2;
  251.                  y=5;
  252.             }
  253.             else if (pos2==45){
  254.                  x=5;
  255.                  y=8;
  256.             }
  257.             else if (pos2==46){
  258.                  x=8;
  259.                  y=5;
  260.             }
  261.              else if (pos2==47){
  262.                  x=5;
  263.                  y=2;
  264.             }
  265.              else if (pos2==48){
  266.                  x=3;
  267.                  y=5;
  268.             }
  269.              else if (pos2==49){
  270.                 x=7;
  271.                 y=5;
  272.             }
  273.              else if (pos2==50){
  274.                 x=7;
  275.                  y=5;
  276.             }
  277.              else if (pos2==51){
  278.                 x=5;
  279.                  y=3;
  280.             }
  281.              else if (pos2==52){
  282.                  x=4;
  283.                  y=5;
  284.             }
  285.              else if (pos2==53){
  286.                  x=6;
  287.                  y=5;
  288.             }
  289.              else if (pos2==54){
  290.                x=6;
  291.                  y=5;
  292.             }
  293.              else if (pos2==55){
  294.                x=5;
  295.                  y=4;
  296.             }
  297.              else if (pos2==56){
  298.                  x=5;
  299.                  y=5;
  300.             }
  301.             tabLab[x][y].setIcon(iconChevalier2);
  302.         }            

Editor

You can edit this paste and save as new:


File Description
  • Vincent
  • Paste Code
  • 25 Feb-2021
  • 7.31 Kb
You can Share it: