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

Solutions to the second round of homework #3

Merged
merged 8 commits into from
Mar 19, 2025
Merged

Conversation

elblasco
Copy link
Contributor

Here are my proposed solutions to the second homework.
I have a question about the second point of homework 2.2, file elblasco_hw_221.py, I only partially understood the second constraint:

  1. The five butterflies were Nick's purchase, the butterfly that sold for $45 the peacock butterfly, the butterfly that sold for $90 and the butterfly that sold for $105.

The peacock butterfly has not been sold for 45$, 90$ or 105$, but I cannot understand the rest of the phrase, so I did not manage to encode it.

Thanks in advance for your feedback.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, well done 🚀

@elblasco
Copy link
Contributor Author

Thanks for the explanation in the third homework. I have also tried to check the proposed model against all the constraints and it looks acceptable (to me).

I have lost access to the online riddle too :-(

Copy link
Owner

@masinag masinag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments, good job!


assertions.append(
Or(
And(wvars["60linda"], Not(linda_bought_grayling)),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably you can just say

Suggested change
And(wvars["60linda"], Not(linda_bought_grayling)),
And(wvars["60linda"], Not(bvars["60grayling"])),

Copy link
Owner

@masinag masinag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me 🚀

@masinag masinag merged commit 982e62b into masinag:main Mar 19, 2025
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