{"id":26222385,"url":"https://github.com/reeceyang/tetris","last_synced_at":"2026-04-20T08:32:37.843Z","repository":{"id":203437321,"uuid":"709594653","full_name":"reeceyang/tetris","owner":"reeceyang","description":"tetris in the terminal with python","archived":false,"fork":false,"pushed_at":"2023-10-25T04:28:16.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T20:10:43.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/reeceyang.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-25T02:11:58.000Z","updated_at":"2023-10-25T02:12:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"23b9c0ab-171b-439c-b7a9-bf803f9be2a2","html_url":"https://github.com/reeceyang/tetris","commit_stats":null,"previous_names":["reeceyang/tetris"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reeceyang/tetris","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeceyang%2Ftetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeceyang%2Ftetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeceyang%2Ftetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeceyang%2Ftetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reeceyang","download_url":"https://codeload.github.com/reeceyang/tetris/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reeceyang%2Ftetris/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32040061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-03-12T16:51:58.786Z","updated_at":"2026-04-20T08:32:37.818Z","avatar_url":"https://github.com/reeceyang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tetris\ntetris in the terminal with python\n\n\u003cimg width=\"1582\" alt=\"Screen Shot 2023-10-24 at 11 07 23 PM\" src=\"https://github.com/reeceyang/tetris/assets/7040416/805c1044-67d8-4bf8-bcd4-6961f0a1a11a\"\u003e\n\nto run:\n```bash\npython3 tetris.py\n```\n\ncontrols: `left`, `right`, and `down` to move the current piece. `space` to hard drop. `z` and `x` to rotate. `c` to hold.\n\nall pieces are represented by tuples of integers: in binary a 1 indicates the piece is in that cell and a 0 indicates that it isn't. this lets us do many tetris operations through bit operations\n\nthe `Tetris` object is designed to allow for custom pieces and board sizes.\n\ni used the `curses` library for user input and display.\n\npossible extensions: \n - game over checking is unimplemented. all the functionality for this theoretically exists but i couldn't get curses to print the game over message\n - adding in different colors for different pieces. i had a plan to do this by keeping $n$ versions of the board for each color, then bitwise-`or`ing all the color boards together to do the full board computations\n - rotating pieces (and input in general) feels somewhat funky compared to \"real\" tetris\n - add in the bag system for choosing the next piece. right now the next piece is chosen at random\n - adding in sound effects and music\n\n\u003cimg width=\"1582\" alt=\"Screen Shot 2023-10-24 at 1 12 18 PM\" src=\"https://github.com/reeceyang/tetris/assets/7040416/6bd2eeab-08b8-4959-a42a-aadb8062ff3f\"\u003e\n\n_a screenshot of in-progress tetris development_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freeceyang%2Ftetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freeceyang%2Ftetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freeceyang%2Ftetris/lists"}