{"id":19692997,"url":"https://github.com/magnetrwn/some-ncurses-snakes","last_synced_at":"2025-07-22T01:05:55.903Z","repository":{"id":195078627,"uuid":"692180169","full_name":"magnetrwn/some-ncurses-snakes","owner":"magnetrwn","description":"A collection of implementations of Snake in different programming languages, using ncurses.","archived":false,"fork":false,"pushed_at":"2023-09-19T18:49:32.000Z","size":49,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T11:57:53.664Z","etag":null,"topics":["ncurses","ncurses-game","ncurses-library","ncurses-tui","ncurses-ui"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magnetrwn.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-09-15T18:37:08.000Z","updated_at":"2023-09-15T18:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b29708c-2a43-42c5-b340-6e29eb1f1cb5","html_url":"https://github.com/magnetrwn/some-ncurses-snakes","commit_stats":null,"previous_names":["magnetrwn/some-ncurses-snakes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/magnetrwn/some-ncurses-snakes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2Fsome-ncurses-snakes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2Fsome-ncurses-snakes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2Fsome-ncurses-snakes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2Fsome-ncurses-snakes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnetrwn","download_url":"https://codeload.github.com/magnetrwn/some-ncurses-snakes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnetrwn%2Fsome-ncurses-snakes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266405405,"owners_count":23923536,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["ncurses","ncurses-game","ncurses-library","ncurses-tui","ncurses-ui"],"created_at":"2024-11-11T19:14:58.424Z","updated_at":"2025-07-22T01:05:55.879Z","avatar_url":"https://github.com/magnetrwn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Some `ncurses` Snakes!\n\n**Developing a simple version of Snake in various programming languages!**\n\nEach folder contains a version of the game Snake for terminal that interfaces with `ncurses` to provide the game UI, or some other library in case it's not available.\n\nI thought of this idea to learn Go, but now I want to expand it a little, just to give it a touch of many different languages.\n\n**Make sure to check the implementation-specific READMEs, not just this one!**\n\n## Current Implementations\n\n+ C\n+ C++\n+ That's it for now :smile:\n\n## C and C++ Version\n\nThe possible Snake algorithms I had thought of for the game were:\n\n+ Store a list of snake node coordinates, direction, and next_direction\n+ **Store a list of snake rotations and only the head coordinates, then draw backward and rotate when meeting rotation points**\n+ Use a delayed tail approach, which moves the same as the head but after N steps and clears nodes instead of applying them\n\nSince C can be considered lower level than other popular languages, I wanted to make something a bit more interesting algorithmically, so I decided to implement the snake by using a linked list of rotations (the second one). This allows the program to use memory way more efficiently to store the Snake!\n\nInside the `c/` or `cpp/` folder. You can find a few sources, headers and build script for Snake. Just execute the script and run `snake` once complete!\n\nHere is an Asciinema Demo of the C version (C++ is very similar):\n\n\u003ca href=\"https://asciinema.org/a/608243\" target=\"_blank\"\u003e\u003cimg src=\"https://asciinema.org/a/608243.svg\" /\u003e\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetrwn%2Fsome-ncurses-snakes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnetrwn%2Fsome-ncurses-snakes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnetrwn%2Fsome-ncurses-snakes/lists"}