-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPole.h
More file actions
43 lines (38 loc) · 973 Bytes
/
Pole.h
File metadata and controls
43 lines (38 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//================================================================
// File Name : Pole.h
//
// Purpose : model of a pole for Tower of Hanoi
//
// Author : Abdullah Alharbi
// Date : Oct 16, 2017
//----------------------------------------------------------------
// Revision List
// Version Author Date Changes
// 1.0 AA Oct 16, 2017 New version
// 1.0 AA Oct 23, 2017 emptyDisk
//================================================================
#include<iostream>
#include"Disk.h"
using namespace std;
class Pole
{
public:
Pole();
Pole(int);
~Pole();
void push(Disk*);
Disk* pop();
void print();
private:
string emptyDisk;
void constructEmptyDisk();
struct PolePosition
{
bool isOccupied;
Disk *d;
};
PolePosition *p;
int firstEmptyPosition;
int maximum;
int printIndex; // This is to align all disks of different poles
};