Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in pizza slices test #811

Open
rhoot opened this issue Dec 25, 2024 · 2 comments
Open

Error in pizza slices test #811

rhoot opened this issue Dec 25, 2024 · 2 comments

Comments

@rhoot
Copy link

rhoot commented Dec 25, 2024

The tests in the pizza-slices exercise has:

let biggest = biggestSlice(diameterA: "0", slicesA: "8", diameterB: "16 inches", slicesB: "8")
XCTAssertEqual(biggest, "Slice A is bigger")

First of all, I would have assumed that a pizza with a diameter of 0 is no pizza. But even if we consider that such a pizza might exist: A pizza with a diameter of 0 couldn't possibly have a larger per-slice area than a slice of a pizza with a diameter of 16", regardless of how many slices you cut the second pizza into.

@meatball133
Copy link
Member

The idea here is that "16 inches" is a faulty input, meaning that pizza is an error. Even a pizza with a size of 0 is bigger than a pizza with an error. It is a bit confusing, I am currently doing quite a big update to the track currently. I might rewatch this exercise, or might just remove that test case. We will see.

@BNAndras
Copy link
Member

If the pizza is less than an inch in diameter, it might be appropriate to round down and say it’s zero inches. In that case, that pizza is still valid. The instructions should still make this clear to the student though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants