Digital and Interactive
Games 2015 - Week 3, Session 2
#include <iostream>
#include <string>
...
svc_install
P@$$w0rd
Initialization List
type fName(_ _ _ _ _ _ _ _ _ _)
C++ Primer Ch 6.
New Project Initialiser List
#include <initializer_list>
using std::initializer_list;
void Messager (initializer_list<string> m) {
for (auto beg = m.begin(); beg != m.end(); ++beg) {
...
...
.begin() - returns an iterator.
cout << *beg << std::endl;
In main
std::initializer_list<string>, 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 <card>
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 <string> card1;
vector <string> card1 = { "1", "1", "Clubs", "Ace" }:
beg = m.begin() (1) (2) (3) (4) (Type) <T>
#cplusplus #gamedesign #gameprogramming #progamming #tafe
#include <iostream>
#include <string>
...
svc_install
P@$$w0rd
Initialization List
type fName(_ _ _ _ _ _ _ _ _ _)
C++ Primer Ch 6.
New Project Initialiser List
#include <initializer_list>
using std::initializer_list;
void Messager (initializer_list<string> m) {
for (auto beg = m.begin(); beg != m.end(); ++beg) {
...
...
.begin() - returns an iterator.
cout << *beg << std::endl;
In main
std::initializer_list<string>, 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 <card>
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 <string> card1;
vector <string> card1 = { "1", "1", "Clubs", "Ace" }:
beg = m.begin() (1) (2) (3) (4) (Type) <T>
#cplusplus #gamedesign #gameprogramming #progamming #tafe
No comments:
Post a Comment