#ifndef version__no3il_incl
#define version__no3il_incl  "2026-04-09_12:22"
#define OLDPOS  "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#define NEWPOS  "#$%&@?!()[]<>{}=*+|-/~^_:;,."    // 28 more characters
// there are 4 unused ASCII-characters > SPACE and < DEL by CHA2U(zei):  " ' \ `
#define IGN   '\''  // ignore sign in coding, if there are less than 2 chars
#define COM   '"'   // comment start sign (end of line ends it)
#define ESC   '\\'  // escape sign, e.g.  to ignore end of line
//  ` is the only unused character in encoded data(files) of all printable chars
#define reverse_map  "xbx^_`axcdlmvowp !\"#$%&'()tugkhxx*+,-./0123456789:;<=>?@ABCexfrsxDEFGHIJKLMNOPQRSTUVWXYZ[\\]injq"
#define xX  (sizeof(OLDPOS NEWPOS)-1)   // currently 62+28=90
#define MAX_N  (10+26+26+28)   //  #define  MAX_N  xX
#define Topos(zei)  ( (zei) - ( (zei)< 'A'-1 ? '0' : 'A'-1-10 ))
#define TOPOS(zei)  ( (zei) - ( (zei)>='0'&&(zei)<='9' ? '0' : \
                      ( (zei)>='A'&&(zei)<='Z' ? 'A'-10 : \
                        ( (zei)>='a'&&(zei)<='z' ? 'a'-36 : (zei)+1 ) ) ) )
#define SYMM  ".:/-ox+*c?"     // c is for rct4 and ? matches unknown symmetry
#define NO_SYM  (sizeof(SYMM)-1)  // 8 + 2 characters
#define SYMMETRY_ABBREV  "iden","rot2","dia1","ort1","rot4","dia2","ort2",\
                         "full","rct4","????"
#define   VERT  (1<<7)
#define   HORI  (1<<6)
#define   ROTA  (1<<5)
#define   LEFT  (1<<4)
#define   RIGH  (1<<3)
#define   ANTI  (1<<2)
#define   MAIN  (1<<1)
#define   IDEN   1
#define INPUT_SYMMETRY  "0 = .   1 = :   2 = /   3 = -   4 = o   5 = x   "\
                        "6 = +   7 = *   8 = c   9 = ?" // 4 and 5 are exchanged
typedef struct {int i; int j;} abs_coord;
#define  MAX_LEX  (MAX_N*MAX_N)
static  abs_coord lexicon[MAX_LEX];
static  unsigned  next_coord_index,  coord_indices= 0, lexicon_n;
static  char *display_str[16]= { "solution:","symmetry:","n=","defect=",
              "assymmetric","reflection in main-diagonal",
              "reflection in horizontal", "half rotation",
              "reflection in anti-diagonal","reflection in both long diagonals",
              "nearly quarter rotation","quarter rotation",
              "reflection in vertical","reflection in both mid-perpendiculars",
              "full symmetric","Internal Error" };

int   char2val(const unsigned char z),
      normalize(unsigned n, unsigned x[2*MAX_N], unsigned y[2*MAX_N]),
      decode(const char buffer[2*MAX_N+4], unsigned x[2*MAX_N],
             unsigned y[2*MAX_N], unsigned *leadin),
      encode(unsigned n, const unsigned x[2*MAX_N], const unsigned y[2*MAX_N],
             char buffer[2*MAX_N+4], unsigned lz),
      check_validity(unsigned n, const unsigned x[2*MAX_N],
                     const unsigned y[2*MAX_N]),
      check_code_plausible(const char buffer[2*MAX_N+4]);
const unsigned  symmetries(unsigned n, const unsigned grid[MAX_N][MAX_N]),
                symmetry_index(unsigned n, const unsigned x[2*MAX_N],
                               const unsigned y[2*MAX_N], char *str);
const char  *version(), *alphabet(), *symclass(const unsigned i);
const unsigned  get_next_coded_config(FILE *fp,char buffer[2*MAX_N+4]);
int  print_config(unsigned anz, const char buffer[2*MAX_N+4], unsigned no,
                  char free, char mark, FILE *fp);
int  print_grid(unsigned n, const unsigned x[2*MAX_N], const unsigned
                y[2*MAX_N], unsigned no, char free, char mark, FILE *fp);
int  read_grid(FILE *fp, unsigned x[2*MAX_N], unsigned y[2*MAX_N],
               char free, char mark);
int  set_displaystring(char *string, unsigned no);
int  set_lexi_order(unsigned n, const int i[MAX_LEX], const int j[MAX_LEX]);
int  get_lexi_order(unsigned *n, int i[MAX_LEX], int j[MAX_LEX]);
int  std_lexi_order(unsigned n, unsigned no);
void  reset_coord(unsigned n);
int   next_coord(int *i, int *j);
#endif
