#Pacman C++ Task 4 :white_check_mark:

15 messages · Page 1 of 1 (latest)

kindred girder
#

Hello! What is wrong with Test 12? Is there something wrong with my if statement lines 52-54?

naive zodiac
#
  1. Please share code using codeblocks, not screenshots.
  2. If has_eaten_all_dots is true, line 50 will return true. That means you'll never even reach the else if on line 52 if all dots are eaten.
kindred girder
#
  1. how do i use codeblocks?
naive zodiac
#

Unfortunately, I can't trigger the bot that explains it, but you place your code in between pairs of triple-backticks (```), like this:
```
std::cout << "Hi there!\n";
```
Which makes this:

std::cout << "Hi there!\n";
modern remnantBOT
kindred girder
#

Pacman C++ Task 4 :white_check_mark:

kindred girder
#

Pacman C++ Task 4

#

Not completed, I changed my code a bit

#

I changed my code and I'm still stuck on task 4, one of the tests (test 12) doesn't work

#
bool won(bool has_eaten_all_dots, bool power_pellet_active,
         bool touching_ghost) {
    // TODO: Please implement the won function

    return has_eaten_all_dots;
    
    return has_eaten_all_dots && power_pellet_active && touching_ghost;

    return has_eaten_all_dots && !power_pellet_active && touching_ghost;

    return has_eaten_all_dots && !power_pellet_active && !touching_ghost;
                
    return false;
}
kindred girder
#

nevermind...i got it

#

this was my result for the tasks to all pass

#
 return has_eaten_all_dots && !lost(power_pellet_active, touching_ghost);
    
    return has_eaten_all_dots && power_pellet_active && touching_ghost;

    return has_eaten_all_dots && !power_pellet_active && !touching_ghost;
                
    return false;
#

Pacman C++ Task 4 :white_check_mark: