Advertisement
Twili

tritypes.c

Sep 27th, 2022
1,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 12.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char tritypes[27][3]={{8,2,5},{8,2,6},{8,2,7},{8,3,5},{8,3,6},{8,3,7},{8,4,5},{8,4,6},{8,4,7},{9,2,5},{9,2,6},{9,2,7},{9,3,5},{9,3,6},{9,3,7},{9,4,5},{9,4,6},{9,4,7},{1,2,5},{1,2,6},{1,2,7},{1,3,5},{1,3,6},{1,3,7},{1,4,5},{1,4,6},{1,4,7}};
  6.     char compat[27][27];
  7.     char base[3],count[27];
  8.     char names[27][21]={
  9.     "825 Strategist",
  10.     "826 Rescuer",
  11.     "827 Free Spirit",
  12.     "835 Solution Master",
  13.     "836 Justice Fighter",
  14.     "837 Mover Shaker",
  15.     "845 Scholar",
  16.     "846 Truth Teller",
  17.     "847 Messenger",
  18.     "925 Problem Solver",
  19.     "926 Good Samaritan",
  20.     "927 Peacemaker",
  21.     "935 Thinker",
  22.     "936 Mediator",
  23.     "937 Ambassador",
  24.     "945 Contemplative",
  25.     "946 Seeker",
  26.     "947 Gentle Spirit",
  27.     "125 Mentor",
  28.     "126 Supporter",
  29.     "127 Teacher",
  30.     "135 Technical Expert",
  31.     "136 Taskmaster",
  32.     "137 Systems Builder",
  33.     "145 Researcher",
  34.     "146 Philosopher",
  35.     "147 Visionary"};
  36.     char show,x,y,z,w,othercount;
  37.     for(x=0;x<27;x+=1)
  38.     {
  39.         base[0]=tritypes[x][0];
  40.         base[1]=tritypes[x][1];
  41.         base[2]=tritypes[x][2];
  42.         count[x]=0;
  43.         for(y=0;y<27;y+=1){compat[x][y]=0;}
  44.         for(y=0;y<27;y+=1)
  45.         {
  46.             show=0;
  47.             if(tritypes[y][0]==base[0]){show=1;}
  48.             if(tritypes[y][1]==base[1]){show=1;}
  49.             if(tritypes[y][2]==base[2]){show=1;}
  50.             if(tritypes[y][1]==2&&base[1]==3)
  51.             {
  52.                 show=1;
  53.                 if(tritypes[y][0]==9&&base[0]!=9)
  54.                 {
  55.                     show=0;
  56.                 }
  57.                 if(tritypes[y][2]==7&&base[2]!=7)
  58.                 {
  59.                     show=0;
  60.                 }
  61.             }
  62.             if(tritypes[y][1]==3&&base[1]==2)
  63.             {
  64.                 show=1;
  65.                 if(tritypes[y][0]!=9&&base[0]==9)
  66.                 {
  67.                     show=0;
  68.                 }
  69.                 if(tritypes[y][2]!=7&&base[2]==7)
  70.                 {
  71.                     show=0;
  72.                 }
  73.             }
  74.             if(tritypes[y][2]==6&&base[2]==7)
  75.             {
  76.                 show=0;
  77.                 if(tritypes[y][0]==base[0])
  78.                 {
  79.                     if(tritypes[y][1]==base[1])
  80.                     {
  81.                         show=1;
  82.                     }
  83.                 }
  84.             }
  85.             if(tritypes[y][2]==7&&base[2]==6)
  86.             {
  87.                 show=0;
  88.                 if(tritypes[y][0]==base[0])
  89.                 {
  90.                     if(tritypes[y][1]==base[1])
  91.                     {
  92.                         show=1;
  93.                     }
  94.                 }
  95.             }
  96.             if(base[0]==8&&base[1]==2&&base[2]==5)
  97.             {
  98.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  99.                 {
  100.                     show=0;
  101.                 }
  102.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  103.                 {
  104.                     show=0;
  105.                 }
  106.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  107.                 {
  108.                     show=0;
  109.                 }
  110.             }
  111.             if(base[0]==8&&base[1]==3&&base[2]==7)
  112.             {
  113.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  114.                 {
  115.                     show=0;
  116.                 }
  117.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  118.                 {
  119.                     show=0;
  120.                 }
  121.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  122.                 {
  123.                     show=0;
  124.                 }
  125.             }
  126.             if(base[0]==9&&base[1]==3&&base[2]==6)
  127.             {
  128.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  129.                 {
  130.                     show=0;
  131.                 }
  132.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  133.                 {
  134.                     show=0;
  135.                 }
  136.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  137.                 {
  138.                     show=0;
  139.                 }
  140.             }
  141.             if(base[0]==9&&base[1]==4&&base[2]==5)
  142.             {
  143.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  144.                 {
  145.                     show=0;
  146.                 }
  147.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  148.                 {
  149.                     show=0;
  150.                 }
  151.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  152.                 {
  153.                     show=0;
  154.                 }
  155.             }
  156.             if(base[0]==1&&base[1]==2&&base[2]==6)
  157.             {
  158.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  159.                 {
  160.                     show=0;
  161.                 }
  162.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  163.                 {
  164.                     show=0;
  165.                 }
  166.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  167.                 {
  168.                     show=0;
  169.                 }
  170.             }
  171.             if(base[0]==1&&base[1]==4&&base[2]==7)
  172.             {
  173.                 if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
  174.                 {
  175.                     show=0;
  176.                 }
  177.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
  178.                 {
  179.                     show=0;
  180.                 }
  181.                 if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
  182.                 {
  183.                     show=0;
  184.                 }
  185.             }
  186.             if(base[0]==8&&base[1]==4&&base[2]==6)
  187.             {
  188.                 if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
  189.                 {
  190.                     show=0;
  191.                 }
  192.                 if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
  193.                 {
  194.                     show=0;
  195.                 }
  196.                 if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
  197.                 {
  198.                     show=0;
  199.                 }
  200.                 if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
  201.                 {
  202.                     show=0;
  203.                 }
  204.                 if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
  205.                 {
  206.                     show=0;
  207.                 }
  208.                 if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
  209.                 {
  210.                     show=0;
  211.                 }
  212.             }
  213.             if(base[0]==9&&base[1]==2&&base[2]==7)
  214.             {
  215.                 if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
  216.                 {
  217.                     show=0;
  218.                 }
  219.                 if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
  220.                 {
  221.                     show=0;
  222.                 }
  223.                 if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
  224.                 {
  225.                     show=0;
  226.                 }
  227.                 if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
  228.                 {
  229.                     show=0;
  230.                 }
  231.                 if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
  232.                 {
  233.                     show=0;
  234.                 }
  235.                 if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
  236.                 {
  237.                     show=0;
  238.                 }
  239.             }
  240.             if(base[0]==1&&base[1]==3&&base[2]==5)
  241.             {
  242.                 if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
  243.                 {
  244.                     show=0;
  245.                 }
  246.                 if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
  247.                 {
  248.                     show=0;
  249.                 }
  250.                 if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
  251.                 {
  252.                     show=0;
  253.                 }
  254.                 if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
  255.                 {
  256.                     show=0;
  257.                 }
  258.                 if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
  259.                 {
  260.                     show=0;
  261.                 }
  262.                 if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
  263.                 {
  264.                     show=0;
  265.                 }
  266.             }
  267.             if(base[0]==9||base[1]==2||base[2]==7)
  268.             {
  269.                 if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==6)
  270.                 {
  271.                     show=1;
  272.                 }
  273.                 if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==6)
  274.                 {
  275.                     show=1;
  276.                 }
  277.             }
  278.             if(tritypes[y][0]==9||tritypes[y][1]==2||tritypes[y][2]==7)
  279.             {
  280.                 if(base[0]==8&&base[1]==2&&base[2]==6)
  281.                 {
  282.                     show=1;
  283.                 }
  284.                 if(base[0]==9&&base[1]==2&&base[2]==6)
  285.                 {
  286.                     show=1;
  287.                 }
  288.             }
  289.             if(tritypes[y][0]==base[0]&&tritypes[y][1]==base[1]&&tritypes[y][2]==base[2])
  290.             {
  291.                 show=0;
  292.             }
  293.             if(show==1)
  294.             {
  295.                 compat[x][y]=1;
  296.                 count[x]+=1;
  297.             }
  298.         }
  299.     }
  300.     for(x=18;x<27;x+=1)
  301.     {
  302.         othercount=0;
  303.         printf("%s\n",names[x]);
  304.         for(w=0;w<3;w+=1)
  305.         {
  306.         for(z=0;z<9;z+=1)
  307.         {
  308.             switch(w)
  309.             {
  310.                 case 0:
  311.                     show=18;
  312.                     break;
  313.                 case 1:
  314.                     show=0;
  315.                     break;
  316.                 case 2:
  317.                     show=9;
  318.                     break;
  319.             }
  320.             if(compat[x][z+show]==1)
  321.             {
  322.                 othercount+=1;
  323.                 if(othercount<count[x])
  324.                 {
  325.                 printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  326.                 }
  327.                 else
  328.                 {
  329.                 printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  330.                 }
  331.             }
  332.         }
  333.         }
  334.         printf("\n\n");
  335.     }
  336.     for(x=0;x<9;x+=1)
  337.     {
  338.         othercount=0;
  339.         printf("%s\n",names[x]);
  340.         for(w=0;w<3;w+=1)
  341.         {
  342.         for(z=0;z<9;z+=1)
  343.         {
  344.             switch(w)
  345.             {
  346.                 case 0:
  347.                     show=0;
  348.                     break;
  349.                 case 1:
  350.                     show=18;
  351.                     break;
  352.                 case 2:
  353.                     show=9;
  354.                     break;
  355.             }
  356.             if(compat[x][z+show]==1)
  357.             {
  358.                 othercount+=1;
  359.                 if(othercount<count[x])
  360.                 {
  361.                 printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  362.                 }
  363.                 else
  364.                 {
  365.                 printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  366.                 }
  367.             }
  368.         }
  369.         }
  370.         printf("\n\n");
  371.     }
  372.     for(x=9;x<18;x+=1)
  373.     {
  374.         othercount=0;
  375.         printf("%s\n",names[x]);
  376.         for(w=0;w<3;w+=1)
  377.         {
  378.         for(z=0;z<9;z+=1)
  379.         {
  380.             switch(w)
  381.             {
  382.                 case 0:
  383.                     show=9;
  384.                     break;
  385.                 case 1:
  386.                     show=18;
  387.                     break;
  388.                 case 2:
  389.                     show=0;
  390.                     break;
  391.             }
  392.             if(compat[x][z+show]==1)
  393.             {
  394.                 othercount+=1;
  395.                 if(othercount<count[x])
  396.                 {
  397.                 printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  398.                 }
  399.                 else
  400.                 {
  401.                 printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
  402.                 }
  403.             }
  404.         }
  405.         }
  406.         printf("\n\n");
  407.     }
  408.     system("pause");
  409.     return 0;
  410. }
  411.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement