#Pacman C++ Task 4 :white_check_mark:
15 messages · Page 1 of 1 (latest)
- Please share code using codeblocks, not screenshots.
- If
has_eaten_all_dotsis true, line 50 will return true. That means you'll never even reach theelse ifon line 52 if all dots are eaten.
- how do i use codeblocks?
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";
Increase your chance of getting help and look like a pro by sharing codeblocks not images. For example, you can type the following. Note, the ``` must be on their own line.
```
for number in range(10):
total += number;
```
Discord will render that as so:
for number in range(10):
total += number;
Click here to learn more about codeblocks: https://exercism.org/docs/community/being-a-good-community-member/writing-support-requests
Pacman C++ Task 4 :white_check_mark:
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;
}
the same test here does not work
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: