Page 1 of 1

Chapter 6 drills. Drill #7

Posted: Tue Jan 08, 2019 6:14 pm
by Katy
if ((!person2Age && person1Age) || person1Age > person2Age) {
whoseTurn = 1;

In this section does the does the (!person1Age && person2Age) mean that if person2 is not there person1 is older?

Re: Chapter 6 drills. Drill #7

Posted: Tue Jan 08, 2019 9:34 pm
by JeremyMoritz
The full IF condition means "if there is NO person2Age, AND there IS a person1Age... OR ... if person1Age is GREATER THAN person2Age..."

Re: Chapter 6 drills. Drill #7

Posted: Wed Jan 09, 2019 5:32 pm
by Katy
I understand now. Thanks!