{"id":24021081,"url":"https://github.com/zipcodecore/conwaygameoflife","last_synced_at":"2025-04-15T21:15:57.391Z","repository":{"id":94665671,"uuid":"123142288","full_name":"ZipCodeCore/ConwayGameOfLife","owner":"ZipCodeCore","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-17T20:24:40.000Z","size":75,"stargazers_count":0,"open_issues_count":36,"forks_count":60,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T21:15:49.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/ZipCodeCore.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":"2018-02-27T14:40:28.000Z","updated_at":"2023-10-17T20:22:19.000Z","dependencies_parsed_at":"2025-01-08T12:38:53.768Z","dependency_job_id":"5a67935f-3b27-4582-b56a-3aa5e4daf37f","html_url":"https://github.com/ZipCodeCore/ConwayGameOfLife","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FConwayGameOfLife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FConwayGameOfLife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FConwayGameOfLife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FConwayGameOfLife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/ConwayGameOfLife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249153950,"owners_count":21221330,"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":[],"created_at":"2025-01-08T12:38:34.275Z","updated_at":"2025-04-15T21:15:57.372Z","avatar_url":"https://github.com/ZipCodeCore.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conway's Game of Life\n\nThe Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.\n\nThe \"game\" is a zero-player game, \nmeaning that its evolution is determined by \nits initial state, requiring no further input. \nOne interacts with the Game of Life by creating an initial configuration and observing how it evolves over many egenerations.\n\n### Rules\n\nThe universe of the [Game Of Life ](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) is an infinite two-dimensional matrix grid of square cells, each of which is in one of two possible states, alive or dead, or \"populated\" or \"unpopulated\". Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:\n\n* Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.\n* Any live cell with two or three live neighbours lives on to the next generation.\n* Any live cell with more than three live neighbours dies, as if by overpopulation.\n* Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.\n\nThe initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the preceding one). The rules continue to be applied repeatedly to create further generations.\n\nYou run each generation, decide what cells will be alive in the next generation, make the next generation the current generation and then repeat for some number of times.\n\n### Some pages to learn more and to explore\n\n- [Yoda -\u003e Notes on Conway's Life](https://yoda.zipcode.rocks/notes-on-conways-game-of-life/)\n- [Stanford Conway's Game of Life](https://web.stanford.edu/class/sts129/Alife/html/Life.htm) is a terrific site, which has a simulator\non it where you can draw and see what happens.\n\n## The Lab\n\nThis lab has three parts. \n\nThe first is to create a single window of a set size where a random game can start and run for some number of generations. \n\nThe second is to prove your game engine works correctly by correctly running the two very simple tests.\n\nThe third is to do a screen grab of a Size 50 matrix, randomly started, and showing the graphic results after 50 generations.\n\nYou'll use a 2D matrix of ints. So \"int[][]\" is the basic type. When you set the dimension, as referenced in the UML,\nyou will then set the arrays to `int[50][50]` if dimension is set to 50.\n\nYou'll create two constructors and a few methods to help you break the problem up.\n\n`isAlive(int, int, int[][])` is the heart of the ConwayGameOfLife class.\n\nyou call it to determine if the cell at i,j will be alive in the next generation, If the cell and its immediate neighbors\nfulfill the rules above, the cell lives (1), if not it does (0). when you are at the end of the matrix, reach back around to the \"other side\" to get the adjacent cell. This essentially makes the top edge meet with the bottom edge, and left edge meet with the right edge.\n\n`simulate(numberOfGenerations)` returns the final state of the matrix after simulating numberOfGenerations. \n\nTo determine each generation, you should do a nested FOR loop through the currentGeneration matrix, taking the values from the currentGeneration, and deciding on the live/die for that cell in the nextGeneration matrix. \n\nat the end of each generation, you should `copyAndZeroOut(nextGeneration, currentGeneration)`, this routine should\ncopy each i,j value from nextGeneration to the same i,j in currentGeneration. Then it should put a 0 into i,j or nextGeneration. Then you loop and do it again until generations \u003e maxGenerations.\n\nIn each of your Constructors, the first thing you should do is create an instance variable displayWindow from the provided\nSimpleWindow class. \n\n```aidl\n this.displayWindow = new SimpleWindow(dimension);\n```\n\nat the top of your main generations loop, you shoud display the currentGeneration matrix:\n```aidl\n this.displayWindow.display(currentGeneration, generations);\n```\n\nat the botom of the loop, you should call the window's `sleep` method to delay for 125 milliseconds\n```aidl\n this.displayWindow.sleep(125);\n```\n\nFinally, you should create a `private int[][] createRandomStart(Integer dimension)` method\nthat creates a int[][] array and loops through it puting in randoom 1 or 0 values for each cell in the \narray. This can be used to \"seed\" the simulation in the `ConwayGameOfLife(Integer dimension)` constructor.\n\nThe testing constructor `ConwayGameOfLife(Integer dimension, int[][] startmatrix)` takes the dimension and the\ntest starting array.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fconwaygameoflife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fconwaygameoflife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fconwaygameoflife/lists"}