{"id":17070492,"url":"https://github.com/oakmac/shipping-packages-puzzle","last_synced_at":"2026-03-07T18:01:39.575Z","repository":{"id":66970640,"uuid":"134074028","full_name":"oakmac/shipping-packages-puzzle","owner":"oakmac","description":"Shipping Packages Logic Puzzle (programming exercise)","archived":false,"fork":false,"pushed_at":"2018-10-30T23:20:09.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T08:44:27.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oakmac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-19T15:26:42.000Z","updated_at":"2022-11-02T00:58:18.000Z","dependencies_parsed_at":"2023-05-16T07:00:22.731Z","dependency_job_id":null,"html_url":"https://github.com/oakmac/shipping-packages-puzzle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oakmac/shipping-packages-puzzle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fshipping-packages-puzzle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fshipping-packages-puzzle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fshipping-packages-puzzle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fshipping-packages-puzzle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oakmac","download_url":"https://codeload.github.com/oakmac/shipping-packages-puzzle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fshipping-packages-puzzle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30225410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T11:31:50.147Z","updated_at":"2026-03-07T18:01:39.556Z","avatar_url":"https://github.com/oakmac.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shipping Packages Logic Puzzle\n\n\u003e This is a bonus assignment. Complete it at your own pace.\n\nModel the problem and solve this [Shipping Packages logic puzzle] using\nJavaScript. This puzzle can be solved incrementally with learning value at each\nstep in the solution. If you have not yet learned a concept listed in a step\nbelow, feel free to work on only the steps you understand. We will eventually\nlearn everything you need in order to solve the whole puzzle.\n\nPlease put your solution in a GitHub repo called `shipping-packages-logic-puzzle`.\n\nThis exercise does not require running JavaScript in the browser. You can create\na `main.js` file in the root of your repo and run it on the command line using\n[Node.js]:\n\n```sh\nnode main.js\n# your solution should print here using console.log statements\n```\n\n[Shipping Packages logic puzzle]:http://www.puzzlersparadise.com/onlinelogic/ShippingPackages.htm\n[Node.js]:https://nodejs.org/en/\n\n## Step #1\n\nModel the data used in the puzzle. What are some good variable names for this\ndata? What data type(s) can you use to represent this data? Arrays, Strings,\nBooleans, Objects, etc.\n\nThe possible first names are: Ellen, Heather, Rick, Walter\n\nThe possible last names are: Bartley, DeForest, Fairview, Gray\n\nThe possible states are: Ohio, Montana, Texas, Washington\n\nThe possible events are: anniversary, birthday, house warming, wedding\n\nThe possible relationships are: cousin, father, friend, sister\n\n## Step #2\n\nWhat logical statements can you use to model the six rules of the puzzle? Don't\nworry about whether the variables you use exist or not, just focus on the logic\nof the statements. If you had a magic wand and could create any function that\nyou need, what might the names of those functions be? How would you call them?\n\nFor example:\n```js\n// \"Suzy's street name was not Merry Lane, but she did have a Golden Retriever.\"\nif (streetName !== 'Merry Lane' \u0026\u0026 dogType === 'Golden Retriever') {\n  maybeSuzy = true\n}\n```\n\n## Step #3\n\nConnect your data types with your logical statements in order to solve the\npuzzle. Use `console.log` to print [the solution] as sentences like so:\n\n\u003e Heather Bartley lives in Ohio and is Greg's sister. She had a birthday on Thursday.\n\nThis is the hardest step of the puzzle. Note that you may need to change how you\nmodel the data or your logical statements in order to create the solution. What\ndo you keep the same? What do you change? Why? Is there any temporary /\nintermediate data that you need to create in order to get closer to the\nsolution? How can you tell if you are on \"the right track\" as you are working\ntoward the solution?\n\n[the solution]:http://www.puzzlersparadise.com/onlinelogic/ShippingPackages/ShippingPackagesSol.htm\n\n## Problem Description\n\nYesterday, Greg was very busy packing up some gifts to send out to family and\nfriends. It was a busy month. He had a birthday, an anniversary, a wedding, and\neven a house warming to send gifts out for - and the events all took place in\nthe same week! Because he moved away from his home area when he took his new\njob, he lived across the country from most of his family and friends now. As a\nresult, he always tried to find something locally for each person to make each\ngift more personal and interesting. Determine the full name of each person he\nshipped a gift to, what state each lived in, what each event was, each person’s\nrelationship to Greg, and what day of the week each event was taking place\n(Wednesday through Saturday).\n\n1. Greg’s friend wasn’t Ellen Fairview, who didn’t live in Ohio. The birthday girl didn’t have her party on Friday.\n2. Rick’s last name wasn’t Bartley but his event was on Saturday night.\n3. Greg’s father wasn’t getting married, but his last name was Gray.\n4. The friend having a house warming didn’t live in Ohio.\n5. The wedding was for Greg’s cousin.  Heather, who didn’t live in Texas, was Greg’s sister but her event wasn’t on Wednesday night.\n6. Walter’s event was one day earlier than the person whose last name was DeForest but after the person\n   who lived in Washington. The anniversary was held in Montana.\n\n## Hints\n\nBelow are some hints for solving the puzzle. They are in order of the typical\nprogression of solving the puzzle. I do not recommend looking at more than one\nhint at a time. If you are stuck, take a look at Hint #1, then give it a think\nfor at least a day, then look at Hint #2, etc. The last hint is very revealing\nof the solution.\n\nThe hints are encoded using [Base64](https://www.base64decode.org/).\n\n#### Hint 1 - If you do not know where to start.\n\n```txt\nQ3JlYXRlIGFsbCBvZiB0aGUgcG9zc2libGUgb3B0aW9uIGNvbWJpbmF0aW9ucy4gSG93IGNhbiB5b3UgZG8gdGhhdD8gSG93IG1hbnkgdG90YWwgcG9zc2libGUgb3B0aW9ucyBhcmUgdGhlcmU/IFdoYXQgaXMgYSBnb29kIGRhdGEgc3RydWN0dXJlIHRvIHJlcHJlc2VudCBhbiBvcHRpb24/\n```\n\n#### Hint 2 - Logic rules 1\n\n```txt\nV2hpY2ggb2YgdGhlIG9wdGlvbnMgY2FuIHlvdSBydWxlIG91dCBiYXNlZCBvbiB0aGUgNiBwdXp6bGUgcnVsZXM/IEhvdyBtYW55IGNhbiB5b3UgcnVsZSBvdXQ/\n```\n\n#### Hint 3 - Logic rules 2\n\n```txt\nU29tZSBvZiB0aGUgb3B0aW9ucyBjYW4gYmUgcnVsZWQgb3V0IGluZGl2aWR1YWxseSwgb3RoZXJzIGFyZSBpbnZhbGlkIHJlbGF0aXZlIHRvIG90aGVyIG9wdGlvbnMuIEhvdyBjYW4geW91IG1vZGVsIHRoZSBkYXRhIGluIG9yZGVyIHRvIHRlc3QgYSBydWxlIGxpa2U6ICJXYWx0ZXIncyBldmVudCB3YXMgb25lIGRheSBlYXJsaWVyIHRoYW4gdGhlIHBlcnNvbiB3aG9zZSBsYXN0IG5hbWUgd2FzIERlRm9yZXN0IiA/\n```\n\n#### Hint 4 - Function and variable names used in a solution.\n\n\u003e Note: This hint is very revealing. Only decode it if you are totally stuck after Hint #3.\n\n```txt\nTODO: add this hint\n```\n\n## License\n\n[ISC License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fshipping-packages-puzzle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foakmac%2Fshipping-packages-puzzle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fshipping-packages-puzzle/lists"}