{"id":23249361,"url":"https://github.com/sigmachirality/blessed-memory","last_synced_at":"2025-04-06T01:22:21.245Z","repository":{"id":47383668,"uuid":"213266774","full_name":"sigmachirality/blessed-memory","owner":"sigmachirality","description":"Memory card game that runs in the terminal made using blessed-react","archived":false,"fork":false,"pushed_at":"2023-01-04T22:14:42.000Z","size":145,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T07:28:53.392Z","etag":null,"topics":["blessed","blessed-react","card-game","memory-game","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigmachirality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-07T00:39:53.000Z","updated_at":"2021-03-22T16:50:00.000Z","dependencies_parsed_at":"2023-02-02T21:46:40.450Z","dependency_job_id":null,"html_url":"https://github.com/sigmachirality/blessed-memory","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/sigmachirality%2Fblessed-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmachirality%2Fblessed-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmachirality%2Fblessed-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmachirality%2Fblessed-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigmachirality","download_url":"https://codeload.github.com/sigmachirality/blessed-memory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247421265,"owners_count":20936262,"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":["blessed","blessed-react","card-game","memory-game","react"],"created_at":"2024-12-19T08:18:53.472Z","updated_at":"2025-04-06T01:22:21.223Z","avatar_url":"https://github.com/sigmachirality.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memory\n\n## Setup and Running\nTo run this game, you need a computer with a Node environment and yarn or npm installed. \nClone this repository and run the following commands from the root of this repo in a terminal.\nI used yarn in building this, so I recommend yarn, but npm works too I guess.\n```\nyarn install\nyarn play\n```\nor\n```\nnpm i\nnpm run play\n```\n\n## Rules\nThis is an implementation of Memory. Click on cards - up to two can be visible at a time. Continue matching cards\nof the same color into pairs until no more cards remain. Try to get as low of a time and number of wrong guesses\nas possible!\n\n## Rationale\n\n### Algorithm\nI track cards by their index. I store their state in two arrays - status and cards. Cards contains, at each index,\nwhat type/color of card that card is. Status contains whether the card is currently flipped up or down - if the\nvalue at status[ind] is true, then the indth card is flipped up. The arrays are flat despite there being two rows\nof cards, but it is fairly simple to calculate which card is in which row. I also track which cards have been matched\nusing a Set. \n\n### UI\nIn terms of design, I tried to make the layout responsive, using relative measurements to denote the height and\nwidth of the cards. I decided to include a timer and a wrong count guesser because I felt that the game of \nmemory by itself wasn't competitive enough - It's my hope that introducing these metrics will encourage people\nto have their friends play this game too, in order to compare scores! It also helps with player retention, since\npeople will be motivated to try over and over to get the lowest possible time and misscounts.\n\n### Tooling\nI was aware of libraries like blessed, but hadn't worked much with them before. Therefore I ended up using\nblessed-react, a blessed bindings package for Javascript that you write using React! Most of my experience comes\nfrom React web development, so it was easy to get started and build this game. I recognize there are drawbacks to\nrelying on React wrappers (case in point, React Native's fall from grace in industry) but I just needed something\nfairly quick and dirty yet also good enough to allow me to play around with the interface. blessed-react has \nlodash as an dependency so I also leverage some of its functionality to make the code look cleaner.\n\n#### Packages used\nFor the full unabridged list, see the package.json.\n- react\n- blessed\n- blessed-react\n- lodash (aka _)\n- babel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmachirality%2Fblessed-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigmachirality%2Fblessed-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmachirality%2Fblessed-memory/lists"}