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

Code for input functions. More...

#include "Input.h"
#include "Includes.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...
 
char ReadCharacter (std::set< char > &s)
 Read a single character from stdin. More...
 
void PrintGeneratorTypeHelp ()
 Print keyboard mapping for generator.
 
bool ReadGeneratorType (GeneratorType &t)
 Read the generator type from stdin. More...
 
void PrintCycleTypeHelp ()
 Print keyboard mapping for cycle type.
 
bool ReadCycleType (CycleType &t)
 Read the cycle type from stdin. More...
 
bool ReadObfuscate (bool &obfuscate)
 Read obfuscate status from stdin. More...
 
void PrintTaskHelp ()
 Print keyboard mapping for tasks.
 
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.

◆ ReadCharacter()

char ReadCharacter ( std::set< char > &  s)

This function will return only when the user types a character from a particular set.

Parameters
sSet of allowable characters.
Returns
The allowable character that the user typed (eventually).

Definition at line 106 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.