added my name
This commit is contained in:
parent
049a40aaa0
commit
88ea1e8453
7 changed files with 53 additions and 29 deletions
31
toh_board.h
31
toh_board.h
|
|
@ -1,9 +1,9 @@
|
|||
/*----------------------------------------------------------
|
||||
* HTBLA-Leonding / Class: <your class>
|
||||
* HTBLA-Leonding / Class: 2IHIF
|
||||
* ---------------------------------------------------------
|
||||
* Exercise Number: 09
|
||||
* Title: Tower of Hanoi Board / Game
|
||||
* Author: */<your name>/*
|
||||
* Author: Marc Tismonar
|
||||
* ----------------------------------------------------------
|
||||
* Description:
|
||||
* The declaration of an Abstract Data Type representing
|
||||
|
|
@ -14,11 +14,22 @@
|
|||
*/
|
||||
|
||||
/* == !Include guard and required includes need to be added */
|
||||
|
||||
#ifndef ___TOH_BOARD_H
|
||||
#define ___TOH_BOARD_H
|
||||
#include "toh_disk.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/** The enumeration of available rods: LEFT, MIDDLE, RIGHT. */
|
||||
typedef enum {
|
||||
LEFT,
|
||||
MIDDLE,
|
||||
RIGHT
|
||||
} Rod;
|
||||
|
||||
/** Declares type for the 'Tower of Hanoi' board */
|
||||
typedef struct TohBoardData* TohBoard;
|
||||
|
||||
/**
|
||||
* Provides the instance of the 'Tower of Hanoi' board.
|
||||
|
|
@ -26,14 +37,14 @@
|
|||
*
|
||||
* @return TohBoard The board instance.
|
||||
*/
|
||||
<type> tb_get_board();
|
||||
TohBoard tb_get_board();
|
||||
|
||||
/**
|
||||
* Removes all disks from any rod of the given board.
|
||||
*
|
||||
* @param board The board instance in focus.
|
||||
*/
|
||||
<type> tb_clear_board(<params>);
|
||||
void tb_clear_board(TohBoard board);
|
||||
|
||||
/**
|
||||
* Determines whether or not the given board is valid.
|
||||
|
|
@ -42,7 +53,7 @@
|
|||
* @param board The board to evaluate.
|
||||
* @return If the given board is valid, false otherwise.
|
||||
*/
|
||||
<type> tb_is_valid(<params>);
|
||||
bool tb_is_valid(TohBoard board);
|
||||
|
||||
/**
|
||||
* Provides the top-most disk of the given rod and removes it from this rod.
|
||||
|
|
@ -51,7 +62,7 @@
|
|||
* @param rodName The rod from which the disk shall be taken and removed.
|
||||
* @return The removed disk or 0, if no disk was on the rod.
|
||||
*/
|
||||
<type> tb_pop_disk(<params>);
|
||||
TohBoard tb_pop_disk(TohBoard board, Rod rodName);
|
||||
|
||||
/**
|
||||
* Applies the given disk to the given rod, if this
|
||||
|
|
@ -63,7 +74,7 @@
|
|||
* @return True if the disk could be legally placed on the rod
|
||||
* (move is allowed and disk is valid), false otherwise.
|
||||
*/
|
||||
<type> tb_push_disk(<params>);
|
||||
bool tb_push_disk(TohBoard board, Rod rodName, TohDisk disk);
|
||||
|
||||
/**
|
||||
* Provides the disk from the named rod at the given position.
|
||||
|
|
@ -75,4 +86,6 @@
|
|||
* @return The addressed disk or 0, if not disk is located on the
|
||||
* index position of the named rod.
|
||||
*/
|
||||
<type> tb_get_disk(<params>);
|
||||
TohDisk tb_get_disk(TohBoard board, Rod rodName, unsigned short idx);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue