-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
37 lines (29 loc) · 790 Bytes
/
main.cpp
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
//
// main.cpp
// Bulls and Cows, c++ game - https://en.wikipedia.org/wiki/Bulls_and_Cows
//
// Created by Pierre-Henry Soria on 06/08/2016.
// Copyright © 2016 Pierre-Henry Soria. All rights reserved.
// Email: pierrehenrysoria+github@gmail.com
// My Github: https://github.com/pH-7
//
#include <iostream>
#include <string>
#include "BullsCowsWord.hpp"
using namespace std;
int main() {
BullsCowsWord* BCW(0);
BCW = new BullsCowsWord;
// Show game intro
cout << BCW->showIntro();
do {
// Run the game
BCW->play();
// Game is over. Ask to replay
BCW->askReplay();
}
while (BCW->isReplay());
delete BCW; // Deallocates the memory
BCW = 0; // Set to 0 it the pointer doesn't point to anything
return 0;
}