Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- 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}};
- char compat[27][27];
- char base[3],count[27];
- char names[27][21]={
- "825 Strategist",
- "826 Rescuer",
- "827 Free Spirit",
- "835 Solution Master",
- "836 Justice Fighter",
- "837 Mover Shaker",
- "845 Scholar",
- "846 Truth Teller",
- "847 Messenger",
- "925 Problem Solver",
- "926 Good Samaritan",
- "927 Peacemaker",
- "935 Thinker",
- "936 Mediator",
- "937 Ambassador",
- "945 Contemplative",
- "946 Seeker",
- "947 Gentle Spirit",
- "125 Mentor",
- "126 Supporter",
- "127 Teacher",
- "135 Technical Expert",
- "136 Taskmaster",
- "137 Systems Builder",
- "145 Researcher",
- "146 Philosopher",
- "147 Visionary"};
- char show,x,y,z,w,othercount;
- for(x=0;x<27;x+=1)
- {
- base[0]=tritypes[x][0];
- base[1]=tritypes[x][1];
- base[2]=tritypes[x][2];
- count[x]=0;
- for(y=0;y<27;y+=1){compat[x][y]=0;}
- for(y=0;y<27;y+=1)
- {
- show=0;
- if(tritypes[y][0]==base[0]){show=1;}
- if(tritypes[y][1]==base[1]){show=1;}
- if(tritypes[y][2]==base[2]){show=1;}
- if(tritypes[y][1]==2&&base[1]==3)
- {
- show=1;
- if(tritypes[y][0]==9&&base[0]!=9)
- {
- show=0;
- }
- if(tritypes[y][2]==7&&base[2]!=7)
- {
- show=0;
- }
- }
- if(tritypes[y][1]==3&&base[1]==2)
- {
- show=1;
- if(tritypes[y][0]!=9&&base[0]==9)
- {
- show=0;
- }
- if(tritypes[y][2]!=7&&base[2]==7)
- {
- show=0;
- }
- }
- if(tritypes[y][2]==6&&base[2]==7)
- {
- show=0;
- if(tritypes[y][0]==base[0])
- {
- if(tritypes[y][1]==base[1])
- {
- show=1;
- }
- }
- }
- if(tritypes[y][2]==7&&base[2]==6)
- {
- show=0;
- if(tritypes[y][0]==base[0])
- {
- if(tritypes[y][1]==base[1])
- {
- show=1;
- }
- }
- }
- if(base[0]==8&&base[1]==2&&base[2]==5)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==8&&base[1]==3&&base[2]==7)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==9&&base[1]==3&&base[2]==6)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==9&&base[1]==4&&base[2]==5)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==1&&base[1]==2&&base[2]==6)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==1&&base[1]==4&&base[2]==7)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==4&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==3&&tritypes[y][2]==5)
- {
- show=0;
- }
- }
- if(base[0]==8&&base[1]==4&&base[2]==6)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
- {
- show=0;
- }
- }
- if(base[0]==9&&base[1]==2&&base[2]==7)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
- {
- show=0;
- }
- }
- if(base[0]==1&&base[1]==3&&base[2]==5)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==8&&tritypes[y][1]==3&&tritypes[y][2]==7)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==3&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==4&&tritypes[y][2]==5)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==2&&tritypes[y][2]==6)
- {
- show=0;
- }
- if(tritypes[y][0]==1&&tritypes[y][1]==4&&tritypes[y][2]==7)
- {
- show=0;
- }
- }
- if(base[0]==9||base[1]==2||base[2]==7)
- {
- if(tritypes[y][0]==8&&tritypes[y][1]==2&&tritypes[y][2]==6)
- {
- show=1;
- }
- if(tritypes[y][0]==9&&tritypes[y][1]==2&&tritypes[y][2]==6)
- {
- show=1;
- }
- }
- if(tritypes[y][0]==9||tritypes[y][1]==2||tritypes[y][2]==7)
- {
- if(base[0]==8&&base[1]==2&&base[2]==6)
- {
- show=1;
- }
- if(base[0]==9&&base[1]==2&&base[2]==6)
- {
- show=1;
- }
- }
- if(tritypes[y][0]==base[0]&&tritypes[y][1]==base[1]&&tritypes[y][2]==base[2])
- {
- show=0;
- }
- if(show==1)
- {
- compat[x][y]=1;
- count[x]+=1;
- }
- }
- }
- for(x=18;x<27;x+=1)
- {
- othercount=0;
- printf("%s\n",names[x]);
- for(w=0;w<3;w+=1)
- {
- for(z=0;z<9;z+=1)
- {
- switch(w)
- {
- case 0:
- show=18;
- break;
- case 1:
- show=0;
- break;
- case 2:
- show=9;
- break;
- }
- if(compat[x][z+show]==1)
- {
- othercount+=1;
- if(othercount<count[x])
- {
- printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- else
- {
- printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- }
- }
- }
- printf("\n\n");
- }
- for(x=0;x<9;x+=1)
- {
- othercount=0;
- printf("%s\n",names[x]);
- for(w=0;w<3;w+=1)
- {
- for(z=0;z<9;z+=1)
- {
- switch(w)
- {
- case 0:
- show=0;
- break;
- case 1:
- show=18;
- break;
- case 2:
- show=9;
- break;
- }
- if(compat[x][z+show]==1)
- {
- othercount+=1;
- if(othercount<count[x])
- {
- printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- else
- {
- printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- }
- }
- }
- printf("\n\n");
- }
- for(x=9;x<18;x+=1)
- {
- othercount=0;
- printf("%s\n",names[x]);
- for(w=0;w<3;w+=1)
- {
- for(z=0;z<9;z+=1)
- {
- switch(w)
- {
- case 0:
- show=9;
- break;
- case 1:
- show=18;
- break;
- case 2:
- show=0;
- break;
- }
- if(compat[x][z+show]==1)
- {
- othercount+=1;
- if(othercount<count[x])
- {
- printf("%d%d%d, ",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- else
- {
- printf("%d%d%d",tritypes[z+show][0],tritypes[z+show][1],tritypes[z+show][2]);
- }
- }
- }
- }
- printf("\n\n");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement