Season 9 reactions and reviews so far
The Magician's Apprentice Live Reactions (Spoilers): https://plus.google.com/115245633245722817719/posts/3NHf671B434
The Magician's Apprentice review: http://brenorenz.deviantart.com/journal/The-Magician-s-Apprentice-review-561978942
The Witch's Familiar Live Reactions: http://fardell24b.tumblr.com/post/129977875860/the-witchs-familiar-live-reactions
The Witch's Familiar review: http://fardell24b.tumblr.com/post/130122498955/the-witchs-familiar-review
The Magicians Apprentice/The Witch's Apprentice review: http://brenorenz.deviantart.com/journal/The-Magician-s-Apprentice-Witch-s-Familiar-review-563372729
Wednesday, 30 September 2015
The Magician's Apprentice/The Witch's Familiar review
The Magician's
Apprentice/The Witch's Familiar
The
opening double episode to Series Nine. Taken together, the episodes
are still interesting, yet disjointed. How Clara has become important
at UNIT hasn't been answered, nor has the question of why Colony
Ssarf has come to serve Davros. It's clear why Davros wants him
there, but what does Colony Ssarf (or the constituent snakes) get out
of it? However, the addition of the second episode has cleared some
things up, such as what the Doctor was up to, and the source of his
shame.
And
the follow up to Young Davros' encounter was well done. 7.25/10.
Tuesday, 29 September 2015
Season Nine reactions and reviews so far:
Season 9 live reactions and reviews so far
The Magician's Apprentice Live Reactions (Spoilers): https://plus.google.com/115245633245722817719/posts/3NHf671B434
The Magician's Apprentice review: http://brenorenz.deviantart.com/journal/The-Magician-s-Apprentice-review-561978942
The Witch's Familiar Live Reactions: http://fardell24b.tumblr.com/post/129977875860/the-witchs-familiar-live-reactions
The Witch's Familiar review: http://fardell24b.tumblr.com/post/130122498955/the-witchs-familiar-review
The Magician's Apprentice Live Reactions (Spoilers): https://plus.google.com/115245633245722817719/posts/3NHf671B434
The Magician's Apprentice review: http://brenorenz.deviantart.com/journal/The-Magician-s-Apprentice-review-561978942
The Witch's Familiar Live Reactions: http://fardell24b.tumblr.com/post/129977875860/the-witchs-familiar-live-reactions
The Witch's Familiar review: http://fardell24b.tumblr.com/post/130122498955/the-witchs-familiar-review
The Witch's Familiar review
The Witch's
Familiar
The
follow up episode to The Magician's Apprentice.
(Reviewing on it's own merits. The review of the two parter as such
will be next.) This wasn't as disjointed as the previous outing (by
virtue of it being set entirely on Skaro). There are a few
interesting interactions, although why Clara is showing so much
naivity towards Missy is not well understood. However, the
interactions between the Doctor and Davros make up for that, with
some very good discussions about compassion (particularly that of the
Doctor and the lack of it in the Daleks) and respect (the way Davros
dismisses it as a design flaw).
A
question, though, how does the Doctor produce regeneration energy on
a whim, as it were? (It has happened before, but that was Romana, not
the Doctor.) A good conclusion to the two-parter. 7.5/10.
Saturday, 26 September 2015
Taronga Western Plains Zoo Observations (07/08/15)
7th August 2015
Lemur catta
Ring-tailed Lemurs
Three males on exhibit
Others are in a breeding complex near the Siamang exhibit
One Lemur visible – resting
Purple Swamphens feeding on their island
Lemur is moving, tail is up in the air. Another lemur is approaching
Second lemur has sat down. He is heading back into the night-hut (or not), walking around it.
Madagascar
Stink fights
Photo 1
[URL=http://s483.photobucket.com/user/Brenorenz/media/Lemur%20001_zps3szi0jul.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Lemur%20001_zps3szi0jul.png[/IMG][/URL]
Lemur is grooming.
Photo 2
More grooming (Two grooming each other)
[URL=http://s483.photobucket.com/user/Brenorenz/media/Lemur%20002_zpss9mc3vc6.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Lemur%20002_zpss9mc3vc6.png[/IMG][/URL]
Photo 3
Water rat!
[URL=http://s483.photobucket.com/user/Brenorenz/media/Water%20Rat_zpsenuaixj2.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Water%20Rat_zpsenuaixj2.png[/IMG][/URL]
Atles geoffrii
[URL=http://s483.photobucket.com/user/Brenorenz/media/Spider%20Monkey%20001_zpsu8ddjrl2.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Spider%20Monkey%20001_zpsu8ddjrl2.png[/IMG][/URL]
Lycaon pictus
[URL=http://s483.photobucket.com/user/Brenorenz/media/African%20Wild%20Dogs%20001_zpsiseqd88r.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/African%20Wild%20Dogs%20001_zpsiseqd88r.png[/IMG][/URL]
King Julian and the Wild Dogs
It was shortly after the Penguins took the reconstructed plane to Monte Carlo.
Diceros bicornis
[URL=http://s483.photobucket.com/user/Brenorenz/media/Black%20Rhinoceros%20001_zpsurssglqc.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Black%20Rhinoceros%20001_zpsurssglqc.png[/IMG][/URL]
King Julian and the Rhinos
Lemur catta
Ring-tailed Lemurs
Three males on exhibit
Others are in a breeding complex near the Siamang exhibit
One Lemur visible – resting
Purple Swamphens feeding on their island
Lemur is moving, tail is up in the air. Another lemur is approaching
Second lemur has sat down. He is heading back into the night-hut (or not), walking around it.
Madagascar
Stink fights
Photo 1
[URL=http://s483.photobucket.com/user/Brenorenz/media/Lemur%20001_zps3szi0jul.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Lemur%20001_zps3szi0jul.png[/IMG][/URL]
Lemur is grooming.
Photo 2
More grooming (Two grooming each other)
[URL=http://s483.photobucket.com/user/Brenorenz/media/Lemur%20002_zpss9mc3vc6.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Lemur%20002_zpss9mc3vc6.png[/IMG][/URL]
Photo 3
Water rat!
[URL=http://s483.photobucket.com/user/Brenorenz/media/Water%20Rat_zpsenuaixj2.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Water%20Rat_zpsenuaixj2.png[/IMG][/URL]
Atles geoffrii
[URL=http://s483.photobucket.com/user/Brenorenz/media/Spider%20Monkey%20001_zpsu8ddjrl2.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Spider%20Monkey%20001_zpsu8ddjrl2.png[/IMG][/URL]
Lycaon pictus
[URL=http://s483.photobucket.com/user/Brenorenz/media/African%20Wild%20Dogs%20001_zpsiseqd88r.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/African%20Wild%20Dogs%20001_zpsiseqd88r.png[/IMG][/URL]
King Julian and the Wild Dogs
It was shortly after the Penguins took the reconstructed plane to Monte Carlo.
Diceros bicornis
[URL=http://s483.photobucket.com/user/Brenorenz/media/Black%20Rhinoceros%20001_zpsurssglqc.png.html][IMG]http://i483.photobucket.com/albums/rr193/Brenorenz/Black%20Rhinoceros%20001_zpsurssglqc.png[/IMG][/URL]
King Julian and the Rhinos
Tuesday, 22 September 2015
The Magician's Apprentice review
The
Magician's Apprentice
Stephen
Moffat starts the new series, with an interesting, yet disjointed
outing. Some interesting hints are dropped but without immediate
follow up. (Would it be followed up later in the series? We will have
to wait and see.)
Clara's
role is the same, as is the Doctor's shame. (How and why Clara has
become so important at UNIT? And how did Colony Ssarf come to be in
service of Davros? It is clear why the Doctor is ashamed at his
interaction with young Davros.) Missy's involvement doesn't clear
things up either. It is an exciting episode, but it is missing
something. (An actual plot?)
However,
I would recommend it to others. 7/10.
Sunday, 20 September 2015
Church notes (8th March 2015)
Psalm 96
Joshua 14:6 - 15
No matter how famous a person becomes, eventually they will be forgottten. (c.f. Kanye West fans not knowing who Paul McCartney is)
Enduring Faith
Even after 45 years, Caleb's faith was as strong as ever.
Courageous Devotion
Caleb was Courageously Devoted to God.
It can be lonely
It is a difficult, dangerous faith. The World is against it.
Enduring Faith
- Complete Dependence
Caleb's faith was not based on his own strength.
Feelings should not dictate our faith. They will waver.
God's Word should dictate our faith. They will not waver.
Continuing Determination.
Most of Israel failed to drive out the Canaanites, due to not having the faith they needed.
Sin - is like head lice. It spreads. If one part remains, it spreads again.,
Caleb doesn't let age get in the way of God's promise.
He had God's favour.
We has His favour too, due to the Cross.
Do we have enduring faith? Or do we let sin entangle us?
Hebrews 12:1, 2
Joshua 14:6 - 15
No matter how famous a person becomes, eventually they will be forgottten. (c.f. Kanye West fans not knowing who Paul McCartney is)
Enduring Faith
Even after 45 years, Caleb's faith was as strong as ever.
Courageous Devotion
Caleb was Courageously Devoted to God.
It can be lonely
It is a difficult, dangerous faith. The World is against it.
Enduring Faith
- Complete Dependence
Caleb's faith was not based on his own strength.
Feelings should not dictate our faith. They will waver.
God's Word should dictate our faith. They will not waver.
Continuing Determination.
Most of Israel failed to drive out the Canaanites, due to not having the faith they needed.
Sin - is like head lice. It spreads. If one part remains, it spreads again.,
Caleb doesn't let age get in the way of God's promise.
He had God's favour.
We has His favour too, due to the Cross.
Do we have enduring faith? Or do we let sin entangle us?
Hebrews 12:1, 2
Church notes (5th August 2012)
Church notes (5th August 2012)
On LiveJournal: http://fardell24.livejournal.com/77843.html
On Dreamwidth: http://fardell24.dreamwidth.org/11175.html
On LiveJournal: http://fardell24.livejournal.com/77843.html
On Dreamwidth: http://fardell24.dreamwidth.org/11175.html
Sunday, 13 September 2015
Cars 2 review
31 Cars 2
A Pixar movie. The second Cars movie. While Lightning McQueen
races on the World Grand Prix, Mater finds himself drawn into the
world of international espionage. An interesting follow up on the
original Cars, with more action than the original. British
secret agent Finn McMissile is on a mission tracking a conspiracy
that has to do with a new alternative fuel. A series of errors during
a party in Japan just before the first race, causes him and fellow
agent Holly Shiftwell, to think that Mater is an American agent.
However, the group of antagonists aren't that well realised, although
their reasons for being antagonistic are reasonable within the
context of the Cars world. But the way that the secret agents
and Mater react to them are well realised. In any case, the climax is
a good way to improve upon the characterisation of Mater, showing
that he isn't as dimwitted as he appears. The formula one racer who
is Lightnings main competitor is not as well realised as the secret
agents, being based on the main competitor from the first film.
The climax itself is interesting, but it doesn't compare to the
climax in the previous Pixar film. However it is better than I
expected given all the negative press about it. It may not be up to
the usual Pixar standard but it is still a good film. 7/10.
Saturday, 5 September 2015
Digital and Interactive Games 2015 - Week 2, Session 2
Digital and Interactive Games 2015 – Week 2, Session 2
void Infantry
putItem (slotNumber, GameObject) {
Inventory myInventory;
myInventory.putItem(1, anAxe);
myInventory.putItem(2, myFood);
void Inventory::putItem(slotNumber, GameItem) {
switch(slotNumber) {
case 1:
slot1 = theItem;
break;
case 2:
slot2 = theItem;
break;
etc
}
}
put Item (slotNumber, GameObject) {
switch (slotNumber) {
case 1:
break
}
}
GameItem Inventory::takeItem (int, slotNumber) {
return;
}
GameItem takeItem(int slotNumber)
return slot1;
GameItem Inventory::takeItem (int slotNumber)
if (slotNumber == 1)
return slot1;
}
How to check if the slot is taken.
…
Inventory.h
public:
Inventory();
~Inventory();
void putItem (int, gameItem);
GameItem takeItem(int);
bool isEmptySlot;
Inventory.cpp
bool Inventory::isEmptySlot (int, slotNumber) {
if (slotNumber == 1) {
slot1
return;
}
}
GameItem.h
class GameItem
string itemType;
int itemAmount;
bool bIsEmpty { true };
public:
GameItem();
~GameItem();
void setItemType(int);
string getItemType();
bool isEmpty();
};
…
GameItem myWeapon;
– myWeapon.setItemType(2);
…
GameItem.cppp
bIsEmpty = false;
switch (ItemTypeNumber) {
string GameItem::getItemType() {
return ItemType;
bool GameItem::isEmpty() {
return bIsEmpty;
}
Inventory.cpp
bool Inventory::isEmptySlot (int slotNumber) {
bool bEmpty { false };
if (slotNumber == 1) {
bEmpty = slot1, isEmpty())
}
return bEmpty;
}
C++ Primer – Chapter 3
New Project – stringExperiment
int main() {
string firstString;
return 0;
}
string from C++ Standard Library
– not the string from C
using std::string
using std::cout
int main() {
string firstString; // default initialisation
cout << firstString
system(“pause”)
return 0;
}
String can be seen as characters
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
cout << firstString << endl;
system(“pause”);
return 0;
}
</code>
a while loop
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
}
Basis for the main loop of the text version of the game.
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
}
system(“pause”);
return 0;
}
</code>
Place Commands in the loop
cout << “Command: “;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
beneath break point”
if (!firstString.empty()) {
cout << firstString << endl;
cout << “Command ”;
}
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
Text comparison is case sensitive
Manipulating strings
beneath cout << firstString << endl;
for (auto c: firstString )
cout << c << “ ” << endl;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
for (auto c: firstString )
cout << c << “ ” << endl;
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
In for loop, comment out existing line and add block.
c = toupper(c);
cout << c;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
for (auto c: firstString ) {
// cout << c << “ ” << endl;
c = toupper(c);
cout << c;
}
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
Size of string
(below for loop)
cout << endl;
cout << firstString.size() << endl;
Vector
New Project – Vector experiment
Not a type.
– It's a class template.
#include <iostream>
#include <vector>
using std::vector;
int main () {
return 0;
}
Not a type
We need to supply a type.
Int main () {
vector <int> first vector:
return 0;
}
firstVector → Nothing, it's pointing to nothing.
Vector <int> firstVector;
firstVector.push_back(10);
The integer is pushed to the back of the vector
firstVector.push_back(10);
firstVector.push_back(5);
using std::vector
using std::cout
using std::endl;
int main() {
vector <int> firstVector;
firstVector.push_back(10)
firstVector.push_back(5);
cout << firstVector[0] << endl;
return 0;
}
cout << firstVector[0] << endl;
for (auto anInt; firstVector) {
cout << anInt << endl;
}
Vector – one of the most efficient tools in C++
(for loop)
vector <int> slotAmount { 0, 0, 0, 0, 0, 0, 0, 0 };
More ways to initialise vector
vector <int> slotAmount { 0, 0, 0, 0, 0 , 0, 0, 0 }'
vector <int> slotAmount2 (8, 0);
cout << slotAmount, size() << endl;
…
Reopen GameItem
Inventory.h
#define INVENTORY_H
#include <vector>
#include “GameItem.h”
class Inventory() {
std::vector <GameItem> slotItem;
}
Inventory.cpp
Inventory::Inventory()
{
GameItem anItem;
slotItem.push_back(anItem);
}
…
for loop
GameItem anItem;
for (auto i = 0; i != 0; i++)
slot.push_back(anItem);
…
// put an item into a slot
// slot number from 1 – 7
void Inventory::putItem(int slotNumber, GameItem) {
slotItem[slotNumber] = theItem;
}
bool Inventory::isEmptySlot(int slotNumber) {
return slotItem[slotNumber].isEmpty();
}
main.cpp
#include “hero.h”
#include “Inventory.h”
int main() {
Inventory myInventory();
return 0;
}
myInventory.putItem(0, anItem);
Inventory.cpp
#include <iostream>
voidInventory::putItem(int slotNumber, GameItem) {
std::cout << “putting ”;
std::cout << theItem.getItemType();
std::cout << “ into slot ”;
std::cout << slotNumber”
std::cout << std::endl;
slotItem[slotNumber] = theItem;
Should be commented out in production version.
Main.cpp
anItem.getItemType(2);
myInventory.putItem(1, anItem);
void Infantry
putItem (slotNumber, GameObject) {
Inventory myInventory;
myInventory.putItem(1, anAxe);
myInventory.putItem(2, myFood);
void Inventory::putItem(slotNumber, GameItem) {
switch(slotNumber) {
case 1:
slot1 = theItem;
break;
case 2:
slot2 = theItem;
break;
etc
}
}
put Item (slotNumber, GameObject) {
switch (slotNumber) {
case 1:
break
}
}
GameItem Inventory::takeItem (int, slotNumber) {
return;
}
GameItem takeItem(int slotNumber)
return slot1;
GameItem Inventory::takeItem (int slotNumber)
if (slotNumber == 1)
return slot1;
}
How to check if the slot is taken.
…
Inventory.h
public:
Inventory();
~Inventory();
void putItem (int, gameItem);
GameItem takeItem(int);
bool isEmptySlot;
Inventory.cpp
bool Inventory::isEmptySlot (int, slotNumber) {
if (slotNumber == 1) {
slot1
return;
}
}
GameItem.h
class GameItem
string itemType;
int itemAmount;
bool bIsEmpty { true };
public:
GameItem();
~GameItem();
void setItemType(int);
string getItemType();
bool isEmpty();
};
…
GameItem myWeapon;
– myWeapon.setItemType(2);
…
GameItem.cppp
bIsEmpty = false;
switch (ItemTypeNumber) {
string GameItem::getItemType() {
return ItemType;
bool GameItem::isEmpty() {
return bIsEmpty;
}
Inventory.cpp
bool Inventory::isEmptySlot (int slotNumber) {
bool bEmpty { false };
if (slotNumber == 1) {
bEmpty = slot1, isEmpty())
}
return bEmpty;
}
C++ Primer – Chapter 3
New Project – stringExperiment
int main() {
string firstString;
return 0;
}
string from C++ Standard Library
– not the string from C
using std::string
using std::cout
int main() {
string firstString; // default initialisation
cout << firstString
system(“pause”)
return 0;
}
String can be seen as characters
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
cout << firstString << endl;
system(“pause”);
return 0;
}
</code>
a while loop
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
}
Basis for the main loop of the text version of the game.
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
}
system(“pause”);
return 0;
}
</code>
Place Commands in the loop
cout << “Command: “;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
beneath break point”
if (!firstString.empty()) {
cout << firstString << endl;
cout << “Command ”;
}
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
Text comparison is case sensitive
Manipulating strings
beneath cout << firstString << endl;
for (auto c: firstString )
cout << c << “ ” << endl;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
for (auto c: firstString )
cout << c << “ ” << endl;
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
In for loop, comment out existing line and add block.
c = toupper(c);
cout << c;
Complete code here:
<code>
#include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout;
using std::endl;
int main() {
string firstString; // default initialisation
string secondString { “This is a string” };
string thirdString [10, '#'];
cout << firstString << endl;
cout << secondString << endl;
cout << thirdString << endl;
cin >> firstString;
while (std::getline(cin, firstString)) {
if (firstString = “exit”) break;
if (!firstString.empty()) {
cout << firstString << endl;
for (auto c: firstString ) {
// cout << c << “ ” << endl;
c = toupper(c);
cout << c;
}
cout << “Command ”;
}
cout << firstString << endl;
cout << “Command: “;
}
system(“pause”);
return 0;
}
</code>
Size of string
(below for loop)
cout << endl;
cout << firstString.size() << endl;
Vector
New Project – Vector experiment
Not a type.
– It's a class template.
#include <iostream>
#include <vector>
using std::vector;
int main () {
return 0;
}
Not a type
We need to supply a type.
Int main () {
vector <int> first vector:
return 0;
}
firstVector → Nothing, it's pointing to nothing.
Vector <int> firstVector;
firstVector.push_back(10);
The integer is pushed to the back of the vector
firstVector.push_back(10);
firstVector.push_back(5);
using std::vector
using std::cout
using std::endl;
int main() {
vector <int> firstVector;
firstVector.push_back(10)
firstVector.push_back(5);
cout << firstVector[0] << endl;
return 0;
}
cout << firstVector[0] << endl;
for (auto anInt; firstVector) {
cout << anInt << endl;
}
Vector – one of the most efficient tools in C++
(for loop)
vector <int> slotAmount { 0, 0, 0, 0, 0, 0, 0, 0 };
More ways to initialise vector
vector <int> slotAmount { 0, 0, 0, 0, 0 , 0, 0, 0 }'
vector <int> slotAmount2 (8, 0);
cout << slotAmount, size() << endl;
…
Reopen GameItem
Inventory.h
#define INVENTORY_H
#include <vector>
#include “GameItem.h”
class Inventory() {
std::vector <GameItem> slotItem;
}
Inventory.cpp
Inventory::Inventory()
{
GameItem anItem;
slotItem.push_back(anItem);
}
…
for loop
GameItem anItem;
for (auto i = 0; i != 0; i++)
slot.push_back(anItem);
…
// put an item into a slot
// slot number from 1 – 7
void Inventory::putItem(int slotNumber, GameItem) {
slotItem[slotNumber] = theItem;
}
bool Inventory::isEmptySlot(int slotNumber) {
return slotItem[slotNumber].isEmpty();
}
main.cpp
#include “hero.h”
#include “Inventory.h”
int main() {
Inventory myInventory();
return 0;
}
myInventory.putItem(0, anItem);
Inventory.cpp
#include <iostream>
voidInventory::putItem(int slotNumber, GameItem) {
std::cout << “putting ”;
std::cout << theItem.getItemType();
std::cout << “ into slot ”;
std::cout << slotNumber”
std::cout << std::endl;
slotItem[slotNumber] = theItem;
Should be commented out in production version.
Main.cpp
anItem.getItemType(2);
myInventory.putItem(1, anItem);
Subscribe to:
Posts (Atom)