{"id":23495338,"url":"https://github.com/elmisback/mips-snakes","last_synced_at":"2025-10-09T02:48:46.817Z","repository":{"id":21811240,"uuid":"25133938","full_name":"elmisback/mips-snakes","owner":"elmisback","description":"A MIPS implementation of the old arcade game.","archived":false,"fork":false,"pushed_at":"2016-10-23T13:55:57.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T02:48:46.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elmisback.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}},"created_at":"2014-10-12T22:25:08.000Z","updated_at":"2016-10-23T13:54:46.000Z","dependencies_parsed_at":"2022-07-22T03:47:00.115Z","dependency_job_id":null,"html_url":"https://github.com/elmisback/mips-snakes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elmisback/mips-snakes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmisback%2Fmips-snakes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmisback%2Fmips-snakes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmisback%2Fmips-snakes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmisback%2Fmips-snakes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elmisback","download_url":"https://codeload.github.com/elmisback/mips-snakes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmisback%2Fmips-snakes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000766,"owners_count":26082906,"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-10-09T02:00:07.460Z","response_time":59,"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":"2024-12-25T03:26:27.826Z","updated_at":"2025-10-09T02:48:46.801Z","avatar_url":"https://github.com/elmisback.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"#mips-snakes\n\nA MIPS implementation of Snakes! for Dr. Youtao Zhang's CS 447 at the \nUniversity of Pittsburgh.  \n\n## The Algorithm\nI used a standard animation algorithm for moving the game's eponymous snake.\nIn pseudocode, it looks like this:\n\n    t = sys.time()\n    while True:\n        sleep(SMALL_INTERVAL)\n        if key_pressed(): # set new direction here; \n                          # true if the direction has changed, else false\n            move_snake()\n            t = sys.time()\n        elif sys.time() - t \u003e 200ms:\n            move_snake()\n\nThe move\\_snake() function was also fairly simple. Before making a move, it\ncalls a validation function to check what's in the move destination. If the\ndestination is empty, the snake's tail segment is deleted and the destination\nis added as the new head segment.  If the destination is part of the snake, the\ngame is over. If the destination is a frog, the snake \"consumes\" the frog (the\ntail is not deleted and the head advances). If the destination is a wall, the\nvalidation function returns a value to indicate that the snake is tentatively \nstuck. The move function responds to a stuck position by trying to turn left or \nright (in a randomized order). If neither turn works, the snake is officially \nstuck and the game ends.\n\nAs suggested in the assignment's writeup, I used a circular buffer to implement \na queue for tracking the snake's position. The snake's head corresponds to the \nback of the queue, where elements are added; its tail corresponds to the front \nof the queue, where elements are dequeued.\n\n## Extra Credit\nNote the splash screen's decadent grandeur.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmisback%2Fmips-snakes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmisback%2Fmips-snakes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmisback%2Fmips-snakes/lists"}