#Need help with C++ project
39 messages · Page 1 of 1 (latest)
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.
Yes.
Hi!, could you help me get started on this project, I'm new to C++ and could use some help
yeah
what have you got so far?
hmm
#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
do you need help figuring out what to do next?
yeah
What are your current thoughts
I need to figure out how to set up the initial board state
then the cells, then updating the board
a 2D array would be convenient i think
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)
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;
}
have you worked with 2D arrays before?
yes but not in over a year
ahhh
yeah lol
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
hmm
