Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Functions
Input.h File Reference

Header for input functions. More...

#include "Defines.h"
#include "Structs.h"

Go to the source code of this file.

Functions

bool ReadUnsigned (UINT &n, Parity parity, UINT lo)
 Read a UINT from stdin. More...
 
bool ReadBoardSize (UINT &n, const CTourneyDesc &t)
 Read board size from stdin. More...
 
bool ReadGeneratorType (GeneratorType &t)
 Read the generator type from stdin. More...
 
bool ReadCycleType (CycleType &t)
 Read the cycle type from stdin. More...
 
bool ReadObfuscate (bool &obfuscate)
 Read obfuscate status from stdin. More...
 
bool ReadTask (Task &t)
 Read the task from stdin. More...
 

Function Documentation

◆ ReadBoardSize()

bool ReadBoardSize ( UINT n,
const CTourneyDesc t 
)

Read the board size (width and height) for a tourney. ReadUnsigned(UINT&, Parity, UINT) is called to read from the user until they enter a large enough unsigned integer of the correct parity, or the letter 'q' to quit.

Parameters
n[out] The board size typed by the user.
tTourney descriptor.
Returns
true If the user wants to quit instead.

Definition at line 91 of file Input.cpp.

◆ ReadCycleType()

bool ReadCycleType ( CycleType t)

Read a character from stdin and decode it into a cycle type.

Parameters
t[out] The type of tour that the user wants.
Returns
true If the user wants to restart instead.

Definition at line 216 of file Input.cpp.

◆ ReadGeneratorType()

bool ReadGeneratorType ( GeneratorType t)

Read a character from stdin and decode it into a generator type.

Parameters
t[out] The type of generator that the user wants.
Returns
true If the user wants to restart instead.

Definition at line 152 of file Input.cpp.

◆ ReadObfuscate()

bool ReadObfuscate ( bool &  obfuscate)

Read a character from stdin and decode it into obfuscate status.

Parameters
obfuscate[out] true if the user requests blurring.
Returns
true If the user wants to restart instead.

Definition at line 262 of file Input.cpp.

◆ ReadTask()

bool ReadTask ( Task t)

Read a character from stdin and decode it into a task.

Parameters
t[out] The task that the user wants.
Returns
true If the user wants to quit instead.

Definition at line 293 of file Input.cpp.

◆ ReadUnsigned()

bool ReadUnsigned ( UINT n,
Parity  parity,
UINT  lo 
)

Read from the user until they enter a large enough unsigned integer of the correct parity, or the letter 'q' to quit.

Parameters
n[out] The unsigned integer typed by the user.
parityThe parity of the unsigned integer to be read.
loLower bound for the unsigned integer to be read.
Returns
true If the user wants to quit instead.

Definition at line 36 of file Input.cpp.