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

powerset scenario #1342

Merged
merged 2 commits into from Jun 25, 2023
Merged

powerset scenario #1342

merged 2 commits into from Jun 25, 2023

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Jun 25, 2023

image

scripts/play.sh --scenario data/scenarios/Challenges/Ranching/powerset.yaml --autoplay

@kostmo kostmo added the G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. label Jun 25, 2023
@kostmo kostmo force-pushed the scenario/powerset branch 5 times, most recently from 051b09b to a60ede0 Compare June 25, 2023 03:35
@kostmo kostmo marked this pull request as ready for review June 25, 2023 03:52
@kostmo kostmo requested a review from byorgey June 25, 2023 03:52
Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

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

Nice! My solution seems like it's a bit different than yours: https://github.com/byorgey/swarm-defs/blob/04b613d2d7be5a0e736c8bd40a3c9db12f89a415/powerset.sw

I just read each fruit combo as a binary number, sum them all, then subtract from the magic value of 8001 to find out the binary number of the missing combo.

I did not end up using any of the string-related devices (Elmer's glue or linotype).

@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label Jun 25, 2023
@kostmo
Copy link
Member Author

kostmo commented Jun 25, 2023

I just read each fruit combo as a binary number, sum them all, then subtract from the magic value of 8001 to find out the binary number of the missing combo.

Works well! Would receive extra points if the derivation of the 8001 constant was in code :)

I did not end up using any of the string-related devices (Elmer's glue or linotype).

Yes, they are not essential. The fruits were previously numbered (fruit0, fruit1, ...), which would avail an alternative solution with these devices. But I still used the devices for debugging (see #1349).

@mergify mergify bot merged commit f1b0b09 into main Jun 25, 2023
9 checks passed
@mergify mergify bot deleted the scenario/powerset branch June 25, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
G-Scenarios An issue having to do with scenario design, the way scenarios are described and loaded, etc. merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants