#Need help with C++ project

39 messages · Page 1 of 1 (latest)

undone apex
#

Conway Game of Life

split sandalBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

foggy heart
#

Yes.

undone apex
#

Hi!, could you help me get started on this project, I'm new to C++ and could use some help

wide gorge
#

what have you got so far?

#

hmm

undone apex
#

#include <iostream>

static const int activeRows = 18;
static const int activeCols = 50;
static const int totalRows = activeRows + 2;
static const int totalCols = activeCols + 2;

int main()
{

return 0;

}

#

not much

#

The one I have to implement requires a specific generation/result as well

wide gorge
#

do you need help figuring out what to do next?

undone apex
#

yeah

cold elbow
#

What are your current thoughts

wide gorge
#

wait zelis already has krill issues

#

hm

#

i thought it wasnt taken

cold elbow
#

You're an imposter

undone apex
#

I need to figure out how to set up the initial board state

#

then the cells, then updating the board

cold elbow
#

Ok

#

How do you want to represent the board in your program

wide gorge
#

a 2D array would be convenient i think

undone apex
#

the one I need to make is supposed to look like this

#

then when the program runs, it will initially ask "How many organisms initially?" then you give it a number which brings up a second prompt "Locations?" (Ex: 1 1 1 3 2 2 3 2 4 1 4 3) then Finally "Generations?" (Ex. 2)

wide gorge
#

aha

#

why not start with reading all input?

undone apex
#

sure

#

I wrote down the basic ones

#

int main()
{
//Get initial number of Organisms
int numOrganisms;
std::cout << "How many Organisms initially? ";
std::cin >> numOrganisms;

//Get the number of Generations
int numGenerations;
std::cout << "How many Generations? ";
std::cin >> numGenerations;

return 0;

}

wide gorge
#

have you worked with 2D arrays before?

undone apex
#

yes but not in over a year

wide gorge
#

ahhh

undone apex
#

yeah lol

wide gorge
#

well

#
std::vector<std::vector<bool>> board;
#

you'd need to resize that to fit your board dimensions
then you'd need to initialize everything to false except for the initial organisms which would probably be true

undone apex
#

hmm