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

A solution #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

A solution #8

wants to merge 1 commit into from

Conversation

amichair
Copy link

Not sure why I did this thing in the first place :-) I suppose we all think about elevator algorithms while waiting for one.

I'd say half the challenge is distilling the actual requirements from the text, which is a bit verbose and not entirely clear about everything (and may or may not coincide with a real elevator, as opposed to the writer's assumptions) - or maybe it's just me. I wrote down the short list of actual logical rules I found in the text, but then had to update it with additional ones that were uncovered only by failing tests.

I suspect that if you'd give the well-defined list of rules up front (less than 10 lines) it would be a somewhat different experience. But perhaps that's part of the challenge... it did take longer than I expected, and I guess that's the point.

Anyway... here's a working solution.

@amichair
Copy link
Author

btw it's nice to see the different kinds of solutions people came up with... can you post the original solution too? (perhaps in separate branch)

@mshang
Copy link
Owner

mshang commented Jan 15, 2016

Nice! Thanks for your thoughts. I agree that the requirements could be more clearly communicated. I tried to only give the requirements inline with doctests that illustrated them. Maybe there needs to be a summary upfront like you say.

Others have submitted solutions in pull requests which I have closed, in order to keep the pull request tab clear for changes to the challenge itself. The first one was here: #2

@amichair
Copy link
Author

I found the other solutions, though it took a while - perhaps you can link to them directly in the docs. And I was referring to your own solution that you can add to the bunch :-)

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

Successfully merging this pull request may close these issues.

2 participants