Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Macros | Functions | Variables
queens.c File Reference
#include <stdlib.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)
 
int main (int argc, char **argv)
 
void find (register int level)
 

Variables

int queens
 
int ranks
 
int files
 
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, 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:

Variable Documentation

int bakdiag[MAXDIAGS]
int file[MAXFILES]

Referenced by findPath().

int files

Referenced by pboard().

int findall = 0
int fordiag[MAXDIAGS]
int queen[MAXRANKS]
int queens

Referenced by main().

int ranks

Referenced by pboard().

unsigned long solutions = 0

Referenced by find(), main(), and pboard().