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

Question8_4: If failed, clear filled spots #175

Open
solimant opened this issue Oct 30, 2017 · 0 comments
Open

Question8_4: If failed, clear filled spots #175

solimant opened this issue Oct 30, 2017 · 0 comments

Comments

@solimant
Copy link

private boolean parkStartingAtSpot(int spotNumber, Vehicle vehicle) {

If one or more spots fail, it seems to still decrease the number of available spots, and also doesn't free the spots that succeeded. This should be an "all-or-nothing" kind of transaction. Potentially, if a level fails to park the vehicle, the following level should try, which then starts by clearing the spots on the given vehicle. To make sure we are clearing the correct number of vehicles vs. decreasing the correct number of available spots, a workaround would be to decrease the available spots by the actual number of spots that were filled rather than the vehicle's number of spots needed.

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

1 participant