{"id":20048465,"url":"https://github.com/aggstam/patterns-overlap","last_synced_at":"2025-10-15T15:01:40.149Z","repository":{"id":155101781,"uuid":"592511610","full_name":"aggstam/patterns-overlap","owner":"aggstam","description":"Sowcasing Prolog recursion on Codejam 2017 round A problem B.","archived":false,"fork":false,"pushed_at":"2023-05-16T13:32:35.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T20:33:33.605Z","etag":null,"topics":["codejam2017","prolog"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aggstam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-01-23T22:06:11.000Z","updated_at":"2023-01-23T22:22:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"f830e1e8-dfbb-48e9-b909-8a24f077cc94","html_url":"https://github.com/aggstam/patterns-overlap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Fpatterns-overlap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Fpatterns-overlap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Fpatterns-overlap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Fpatterns-overlap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aggstam","download_url":"https://codeload.github.com/aggstam/patterns-overlap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241477934,"owners_count":19969194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["codejam2017","prolog"],"created_at":"2024-11-13T11:44:12.818Z","updated_at":"2025-10-15T15:01:35.078Z","avatar_url":"https://github.com/aggstam.png","language":"Python","readme":"# patterns-overlap\n\nProlog solution for Problem B of Google Codejam Kickstart Round A 2017.\n\u003cbr\u003e\nA python script is used to convert test set input file to a .pl file,\nwhich is used as the test cases when executing the Prolog code.\n\u003cbr\u003e\nOriginal test cases are also included for validating correctness.\n\u003cbr\u003e\nThis implementation is focused on showcasing solution simplicity using Prologs' recursion, not speed.\n\u003cbr\u003e\nTest case execution is streamline via a Makefile:\n- Convert test case input file into a .pl file with desired format using the python script.\n- Execute prolog code and output to a file.\n- Validate output file by performing *diff* on the output file and the test case output file.\n\u003cbr\u003e\nImplementation requires *prolog* and *python* to be installed.\n\n## Problem\nAlice likes reading and buys a lot of books.\n\u003cbr\u003e\nShe stores her books in two boxes; each box is labeled with a pattern that matches the titles of all of the books stored in that box.\n\u003cbr\u003e\nA pattern consists of only uppercase/lowercase English alphabet letters and stars (*).\n\u003cbr\u003e\nA star can match between zero and four letters.\n\u003cbr\u003e\nFor example, books with the titles GoneGirl and GoneTomorrow can be put in a box with the pattern Gone**,\nbut books with the titles TheGoneGirl, Gonetomorrow, and GoneWithTheWind cannot.\n\u003cbr\u003e\nAlice is wondering whether there is any book that could be stored in either of the boxes.\n\u003cbr\u003e\nThat is, she wonders if there is a title that matches both boxes' patterns.\n\n## Input\nThe first line of the input gives the number of test cases, T. T test cases follow.\n\u003cbr\u003e\nEach consists of two lines; each line has one string in which each character is either an uppercase/lowercase English letter or *.\n\n## Output\nFor each test case, output one line containing Case #x: y,\n\u003cbr\u003e\nwhere x is the test case number (starting from 1) and y is TRUE if there is a string that matches both patterns, or FALSE if not.\n\n## Usage\n```\n% make\n```\nMakefile can be configured to use a different test case set and/or files.\n\u003cbr\u003e\nIf *CASES_FILE* is modified, you should also change line 6 *:- ensure_loaded(test_cases).* in the Prolog code, to the other file name.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Fpatterns-overlap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faggstam%2Fpatterns-overlap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Fpatterns-overlap/lists"}