Digital and Interactive Games 2015 - Week 3, Session 2
#include
#include
...
svc_install
P@$$w0rd
Initialization List
type fName(_ _ _ _ _ _ _ _ _ _)
C++ Primer Ch 6.
New Project Initialiser List
#include
using std::initializer_list;
void Messager (initializer_list m) {
for (auto beg = m.begin(); beg != m.end(); ++beg) {
...
...
.begin() - returns an iterator.
cout << *beg << std::endl;
In main
std::initializer_list, myList {"List 1", "List 2", "List 3"};
card game
52 cards
...
...
Two properties for each card.
The suite and the value
int suitRank;
int valueRank;
string suiteDisplay;
string valueDisplay;
1 Create Card
2 Create vector
3 Initialise the vector to a full pack of cards.
4 Print them in the order.
function for each card.
Create card by vector
vector card1;
vector card1 = { "1", "1", "Clubs", "Ace" }:
beg = m.begin() (1) (2) (3) (4) (Type)