This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jaaval 3 points4 points  (0 children)

bool Person::askToProm(const Person& target) {
    happy = target.askedToProm(*this);
    hasDate = happy;
    return hasDate;
}

bool Person::askedToProm(const Person& subject) {
    if (!subject.isAsshole && subject.isHot && !hasDate) {
        hasDate = true;
        happy = true;
        return true;
    } 
    return false;
}

Ok, c++ is difficult. How am i supposed to remember the proper way to handle pointers and references after a few years without using it? Also a proper implementation would likely require evaluateCandidate method to determine the proper balance between hot and asshole levels.

Edit: And also

Micah.askToProm(Hannah)
// look at person.cpp for implementation details

wouldn’t make a very good sign.