00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include <iostream>
00037 #include <gvars3/instances.h>
00038
00039
00040 using namespace std;
00041 using namespace GVars3;
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 inline bool is_corner(const char* str, int num_for_corner, char type)
00053 {
00054 int num_consecutive=0;
00055 int first_cons=0;
00056
00057 for(int i=0; i<16; i++)
00058 {
00059 if(str[i] == type)
00060 {
00061 num_consecutive++;
00062
00063 if(num_consecutive == num_for_corner)
00064 return 1;
00065 }
00066 else
00067 {
00068 if(num_consecutive == i)
00069 first_cons=i;
00070
00071 num_consecutive=0;
00072 }
00073 }
00074
00075 if(first_cons+num_consecutive >=num_for_corner)
00076 return 1;
00077 else
00078 return 0;
00079 }
00080
00081
00082
00083
00084
00085
00086 int main(int argc, char ** argv)
00087 {
00088 GUI.parseArguments(argc, argv);
00089
00090 char types[]="bsd.";
00091 char F[17]="................";
00092
00093 int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
00094 cout << 16 << endl;
00095 cout << "[0 3] [1 3] [2 2] [3 1] [3 0] [3 -1] [2 -2] [1 -3] [0 -3] [-1 -3] [-2 -2] [-3 -1] [-3 0] [-3 1] [-2 2] [-1 3]" << endl;
00096
00097 int N = GV3::get<int>("N", 9, 1);
00098
00099 for(a = 0, F[ 0]='b'; a < 3; a++, F[ 0]=types[a])
00100 for(b = 0, F[ 1]='b'; b < 3; b++, F[ 1]=types[b])
00101 for(c = 0, F[ 2]='b'; c < 3; c++, F[ 2]=types[c])
00102 for(d = 0, F[ 3]='b'; d < 3; d++, F[ 3]=types[d])
00103 for(e = 0, F[ 4]='b'; e < 3; e++, F[ 4]=types[e])
00104 for(f = 0, F[ 5]='b'; f < 3; f++, F[ 5]=types[f])
00105 for(g = 0, F[ 6]='b'; g < 3; g++, F[ 6]=types[g])
00106 for(h = 0, F[ 7]='b'; h < 3; h++, F[ 7]=types[h])
00107 for(i = 0, F[ 8]='b'; i < 3; i++, F[ 8]=types[i])
00108 for(j = 0, F[ 9]='b'; j < 3; j++, F[ 9]=types[j])
00109 for(k = 0, F[10]='b'; k < 3; k++, F[10]=types[k])
00110 for(l = 0, F[11]='b'; l < 3; l++, F[11]=types[l])
00111 for(m = 0, F[12]='b'; m < 3; m++, F[12]=types[m])
00112 for(n = 0, F[13]='b'; n < 3; n++, F[13]=types[n])
00113 for(o = 0, F[14]='b'; o < 3; o++, F[14]=types[o])
00114 for(p = 0, F[15]='b'; p < 3; p++, F[15]=types[p])
00115 cout << F << " 1 " << (is_corner(F, N, 'b') || is_corner(F, N, 'd')) << endl;
00116 }