48 lines
1.8 KiB
C
48 lines
1.8 KiB
C
/*----------------------------------------------------------
|
|
* HTBLA-Leonding / Class: 2IHIF
|
|
* ---------------------------------------------------------
|
|
* Exercise Number: 09
|
|
* Title: Tower of Hanoi Disk ADT implementation
|
|
* Author: Marc Tismonar
|
|
* ----------------------------------------------------------
|
|
* Description:
|
|
* Implementation of toh_board.h.
|
|
* ----------------------------------------------------------
|
|
*/
|
|
|
|
/* Includes, definitions and instanciations */
|
|
#include "toh_board.h"
|
|
|
|
/* ========================================================= */
|
|
/* Private functions */
|
|
|
|
/**
|
|
* Moves a single disk from the top of the 'source' rod to the 'target' rod.
|
|
* The move shall only be performed if it is allowed.
|
|
*
|
|
* @param source The rod from which the disk shall be moved.
|
|
* @param target The rod to which the disk shall be moved.
|
|
* @return True if the move was successful and according to the rules, false otherwise.
|
|
*/
|
|
static bool ts_move_disk(Rod source, Rod target) {
|
|
|
|
}
|
|
|
|
/**
|
|
* Moves a stack of disks of the given size form the 'source' rod to the 'target' rod
|
|
* using the 'intermediate' rod as intermediate disk buffer.
|
|
* The move shall only be performed if it is valid. The move is valid, if each
|
|
* move of affected disks is allowed.
|
|
*
|
|
* @param size The size of the disk stack to move.
|
|
* @param source The rod from which the disks shall be moved.
|
|
* @param intermediate The rod that serves as intermediate buffer for the disks.
|
|
* @param target The rod to which the disks shall be moved.
|
|
* @return True if the move was successful and according to the rules, false otherwise.
|
|
*/
|
|
static bool ts_move_stack(unsigned short size, Rod source, Rod intermediate, Rod target) {
|
|
|
|
}
|
|
|
|
/* ========================================================= */
|
|
/* Public functions */
|