Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Macros | Functions | Variables
queens.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for queens.c:

Macros

#define MAXQUEENS   20 /* Maximum number of queens */
 
#define MAXRANKS   MAXQUEENS /* Maximum number of ranks (rows) */
 
#define MAXFILES   MAXQUEENS /* Maximum number of files (columns) */
 
#define MAXDIAGS   (MAXRANKS+MAXFILES-1) /* Maximum number of diagonals */
 
#define EMPTY   (MAXQUEENS+1) /* Marks unoccupied file or diagonal */
 

Functions

void find (int level)
 
void pboard (void)
 
int main (int argc, char **argv)
 
void find (register int level)
 

Variables

int queens
 
int ranks
 
int files
 
int printing = 0
 
int findall = 0
 
unsigned long solutions = 0
 
int queen [MAXRANKS]
 
int file [MAXFILES]
 
int fordiag [MAXDIAGS]
 
int bakdiag [MAXDIAGS]
 

Macro Definition Documentation

#define EMPTY   (MAXQUEENS+1) /* Marks unoccupied file or diagonal */

Referenced by find(), and main().

#define MAXDIAGS   (MAXRANKS+MAXFILES-1) /* Maximum number of diagonals */

Referenced by main().

#define MAXFILES   MAXQUEENS /* Maximum number of files (columns) */

Referenced by main().

#define MAXQUEENS   20 /* Maximum number of queens */

Referenced by main().

#define MAXRANKS   MAXQUEENS /* Maximum number of ranks (rows) */

Function Documentation

void find ( int  level)
void find ( register int  level)

References EMPTY, exit, core.waf.cmake::f(), find(), fp, pboard(), and solutions.

Here is the call graph for this function:

int main ( int  argc,
char **  argv 
)

References EMPTY, find(), i, MAXDIAGS, MAXFILES, MAXQUEENS, queens, and solutions.

Here is the call graph for this function:

void pboard ( void  )

References files, i, ranks, and solutions.

Referenced by find().

Variable Documentation

int bakdiag[MAXDIAGS]
int file[MAXFILES]
int files
int findall = 0
int fordiag[MAXDIAGS]
int printing = 0
int queen[MAXRANKS]
int queens
int ranks
unsigned long solutions = 0