src/puzzle.cpp
/* added here routines preliminary in Bitfields
   images
   */
added here routines preliminary in Bitfields
images
added here routines preliminary in Bitfields images
void PUZZLE::ImagePoints(BF81 & zz) const {
	char s0[5], s1[5];
	int  mode = 0;
	for(int i = 0; i < 81; i++) {
		if(zz.On(i)) {
			strcpy_s(s1, 5, cellsFixedData[i].pt);
			switch (mode) {
				case 0:
					mode = 1;
					break;
				case 1: 
					if(s0[1]==s1[1]) {  
						EE.E(s0);
						EE.E(s1[3]);
						mode = 2;
					}
					else if(s0[3] == s1[3]) { 
						EE.E(s0[0]);
						EE.E(s0[1]);
						EE.E(s1[1]);
						mode = 3;
					}
					else
						EE.E(s0);
					break;
				case 2:
					if(s0[1]==s1[1])EE.E(s1[3]);  
					else mode = 1;  break;
				case 3:
					if(s0[3]==s1[3]) EE.E(s1[1]);
					else {mode = 1; EE.E(&s0[2]);}
					break;
			}  
			strcpy_s(s0, 5, s1);
		}  
	}
	switch (mode) { 
		case 1:
			EE.E(s0);
			break;
		case 3:
			EE.E(&s0[2]);
			break;
	} 
}
void PUZZLE :: ImagePoints ( BF81 & zz ) const { char s0 [ 5 ] , s1 [ 5 ] ; int mode = 0 ; for ( int i = 0 ; i < 81 ; i ++ ) { if ( zz . On ( i ) ) { strcpy_s ( s1 , 5 , cellsFixedData [ i ] . pt ) ; switch ( mode ) { case 0 : mode = 1 ; break ; case 1 : if ( s0 [ 1 ] == s1 [ 1 ] ) { EE . E ( s0 ) ; EE . E ( s1 [ 3 ] ) ; mode = 2 ; } else if ( s0 [ 3 ] == s1 [ 3 ] ) { EE . E ( s0 [ 0 ] ) ; EE . E ( s0 [ 1 ] ) ; EE . E ( s1 [ 1 ] ) ; mode = 3 ; } else EE . E ( s0 ) ; break ; case 2 : if ( s0 [ 1 ] == s1 [ 1 ] ) EE . E ( s1 [ 3 ] ) ; else mode = 1 ; break ; case 3 : if ( s0 [ 3 ] == s1 [ 3 ] ) EE . E ( s1 [ 1 ] ) ; else { mode = 1 ; EE . E ( & s0 [ 2 ] ) ; } break ; } strcpy_s ( s0 , 5 , s1 ) ; } } switch ( mode ) { case 1 : EE . E ( s0 ) ; break ; case 3 : EE . E ( & s0 [ 2 ] ) ; break ; } }
added here routines preliminary in Bitfields
images
added here routines preliminary in Bitfields images
// ligne r1c12 on empile colonnes // colonne r12c1 //suite ligne //suite colonne  insertion ligne // end switch // end if(On(i)) // finir le traitement // end switch