Find Jobs
Hire Freelancers

Write some Software

$30-250 CAD

Completed
Posted over 7 years ago

$30-250 CAD

Paid on delivery
The Game of Life Write a complete C program that implements Conway's Game of Life. The rules for the Game of Life are simple. The universe consists of a two-dimensional matrix of cells with each cell being alive or dead. For each generation every cell determines its next phase of life as follows: If the cell is alive: it dies if it has 0, 1, 4 or more living neighbours (starvation), or it lives if it has 2 or 3 living neighbours (balance). If the cell is dead: it springs to life if it has exactly 3 neighbours (procreation). A cycle occurs as soon as the state of the universe of the latest generation is the same as a previous generation. You should be able to see that once this occurs the Game of Life will repeat the intermediate generations forever. Implementation Requirements All of the following conditions must be met by your solution. Your program must read the initial state from standard input (redirecting files on the command line is the way to go!). Here is a sample input file to use for testing. You will be expected to adequately test your program -- I will not be providing the files used by your marker. All input will conform to the following format: The input will consist of starting universes for multiple games. Play each game completely, in the order they appear in the file. The first line of the game starts with an asterisk and contains the game title. The second line of the game contains two numbers, separated by a space, which indicate the number of rows and columns for the 2-D matrix. Then there is one line for each row in the matrix: A blank character represents a dead cell. An 'X' represents an alive cell. The next game starts on the next line, until EOF. There are no errors in the input file format. For each game, your program will first print the game title as read from the file. Print the starting universe as read in. Then, after each generation is calculated your program will print the current state of the universe. All printing goes to standard output, and each universe must be preceded by a label indicating the generation number (where the initial state is generation 0). Here is a sample of the output expected. You must include a border, use '.' for dead cells and '*' for alive cells. Each game will run for 250 generations or until a cycle is detected, whichever comes first. If the game ends because of a cycle, print the numbers of the two generations that were duplicated. Your program must include appropriate pre and post conditions. Printing all generations is great for debugging purposes (and should prove mesmerizing). But the release version of your program, when compiled with -DNDEBUG, should only print the initial universe and the last 10 (or less) generations. The sample output above is produced by a release version. Hints The following should help point you in the right direction: DO NOT leave this assignment until the last minute. Otherwise, you will NOT get it done on time. Store the universe in a two-dimensional array, but be careful that your program avoids subscripting your array "out of bounds". Not checking for array boundaries may lead to your program crashing, or worse, giving the wrong results. Here is a document detailing what you need to know about using two-dimensional arrays. You will need to store all previous generations in order to identify a cycle. To do this, consider using a struct to represent a generation. Then, you can employ an array of objects to track your universe's history. You may assume file input lines are at most 80 characters, and a universe is at most 60x60 cells.
Project ID: 11868508

About the project

16 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
$30 CAD in 1 day
4.9 (1411 reviews)
7.7
7.7
16 freelancers are bidding on average $135 CAD for this job
User Avatar
Hi there, I would like to do this project if given the opportunity. I've done Conway Game of Life before. Let me know if you are interested. Thanks.
$40 CAD in 1 day
4.9 (1286 reviews)
7.8
7.8
User Avatar
A proposal has not yet been provided
$200 CAD in 5 days
4.9 (419 reviews)
7.6
7.6
User Avatar
Hello, I love c and c++ since more than 20 years ago ... I should be a good option for this project. Please, look at my previous projects. Please, let me know the deadline. BEst regards!
$200 CAD in 6 days
5.0 (111 reviews)
7.2
7.2
User Avatar
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on server side, using c++ under linux environment. I used c++ to make many great projects, for example, I made the tools which can convert java files into c++ scripts, of course garbage collection included, this job is very similar to a compiler, and is very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$150 CAD in 3 days
4.9 (184 reviews)
7.2
7.2
User Avatar
Hi, I have done the Game of Life in C++ before. I can do it in C too. Please contact me. I can complete this pretty quickly........
$150 CAD in 1 day
4.9 (95 reviews)
6.4
6.4
User Avatar
Hello, expert C programmer here, I live in Canada, near Montreal. I can implement for you the Game of Life according to the attached description. If you want to work with me, we should first discuss the details of the project. Thanks, Paul
$300 CAD in 7 days
5.0 (70 reviews)
6.2
6.2
User Avatar
I have 6 years of experience in software development. I made dozens of projects in C/C++ (few versions of Game of Life also). I guarantee good, clean code and possibly help with understand code (skype session/documentation/comments in code).
$144 CAD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$222 CAD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
may I get it
$222 CAD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I clearly understand the algorithm and have written something similar in my Artificial Intelligence class. Have worked with C for 3 years
$35 CAD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of CANADA
Winnipeg, Canada
5.0
2
Payment method verified
Member since Oct 23, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.