For a programming assignment, I have to make a simple dice game in Visual C#. A part of this game is displaying a list of the values, and seeing whether the total of the values is over a certain number.
I currently have a textbox that displays the individual values separated by a newline, and am currently using iPlayer1Total += int.Parse(player1TxtBox.Text);, but this only seems to do the first line of the textbox.
For a programming assignment, I have to make a simple dice game in Visual
Share
It seems that you are using multiline textbox. First split your string on “\n\r” and then:
then
Edit: a better option to split would be: