TDT4102-Ovinger/Oving5/Oving 5/main.cpp

57 lines
961 B
C++
Raw Normal View History

2019-02-06 21:40:10 +01:00
#include "std_lib_facilities.h"
2019-02-07 13:20:06 +01:00
#include "CardDeck.h"
2019-02-13 11:07:11 +01:00
#include "Blackjack.h"
2019-02-06 21:40:10 +01:00
int main(){
#pragma region Task 1
// a - d
// Testing functions and mapping
2019-02-13 11:07:11 +01:00
//cout << suitToString(Suit::diamonds) << endl;
//cout << rankToString(Rank::ace) << endl;
2019-02-06 21:40:10 +01:00
// e
/*
Det er lurt <EFBFBD> bruke symboler fordi
- Mindre sansynlighet for misforst<EFBFBD>else
- Lettere <EFBFBD> lese koden til senere
*/
#pragma endregion
#pragma region Task 2
2019-02-13 11:07:11 +01:00
/*
2019-02-06 21:40:10 +01:00
CardStruct card1 = { Suit::spades, Rank::ace };
CardStruct card2 = { Suit::diamonds, Rank::ten };
cout << toString(card1) << endl;
cout << toStringShort(card2) << endl;
2019-02-13 11:07:11 +01:00
*/
2019-02-06 21:40:10 +01:00
#pragma endregion
2019-02-13 11:07:11 +01:00
2019-02-06 21:40:10 +01:00
Card c = Card(Suit::clubs, Rank::two);
cout << c.toString() << endl;
2019-02-13 11:07:11 +01:00
2019-02-07 13:20:06 +01:00
CardDeck cD = CardDeck();
cD.print();
cD.shuffle();
cD.printShort();
for (int i = 0; i < 52; i++)
{
Card c = cD.drawCard();
cout << c.toString() << endl;
}
2019-02-13 11:07:11 +01:00
Blackjack bJack = Blackjack();
bJack.printCards();
2019-02-06 21:40:10 +01:00
2019-02-07 13:20:06 +01:00
keep_window_open();
2019-02-06 21:40:10 +01:00
return 0;
}