I am trying to write a program that requires me to add data to a datagrid. There's a pattern, but I can't seem to figure out how to decently get this data done through a For-Loop.
This is my code without using a For-Loop:
table.Rows.Add("0", "0", "0", "0", "0");
table.Rows.Add("0", "0", "0", "1", "0");
table.Rows.Add("0", "0", "1", "0", "0");
table.Rows.Add("0", "1", "0", "0", "0");
table.Rows.Add("1", "0", "0", "0", "0");
table.Rows.Add("1", "0", "0", "1", "0");
table.Rows.Add("1", "0", "1", "0", "0");
table.Rows.Add("1", "1", "0", "0", "0");
table.Rows.Add("1", "1", "0", "1", "0");
table.Rows.Add("1", "1", "1", "0", "0");
table.Rows.Add("1", "1", "1", "1", "0");
The last zero will be dynamically generated, no need to do anything with that.
Is this somehow possible to do through a For-Loop?