rowlandsfc
Active member
im new to this, im currently in my first year of college studying coding and we have tro create the game hammurabi, im having issues getting my array towork as i need it, i need to use to store data from each year(button click = 1 year) up to 10 years. the data is calculated based ontheinformation theuser enters before clicking the button.
that is what ive got so far, but every time i click the button all 10 slots show the data for that yearbuti need to only show 1 year in 1 slot and not useup all10 slots every year
any helpwould be appreciated
C#:
listBox1.Items.Clear();
double[] starved = new double[10];
for (int year = 0; year != (starved.Length); year++)
{
starved[year] = died;
listBox1.Items.Add(starved[year]);
}
that is what ive got so far, but every time i click the button all 10 slots show the data for that yearbuti need to only show 1 year in 1 slot and not useup all10 slots every year
any helpwould be appreciated