-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhorse.h
65 lines (40 loc) · 858 Bytes
/
horse.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// horse.h
// chessPieces
//
// Created by Miguel Sacristán on 13/1/17.
//
//
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
using namespace std;
#ifndef HORSE_H
#define HORSE_H
class horse {
public:
//Default Constructor
horse();
//Overload Constructor
horse(int, int);
//Destructor
~horse();
//Get Functions
int getPositionX();
int getPositionY();
//Movement
void move(int, int);
//Random Movement
void randomMove();
//Number of moves until come-back
int numberOfMovesToComeBack();
//Print position
void printPosition();
private:
//Member Variables
int position[2];
//Check if movement is legal
bool moveIsLegal(int, int);
};
#endif /* horse_h */