Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:05:02+00:00 2026-06-03T09:05:02+00:00

For a programming assignment, I have to make a simple dice game in Visual

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:05:03+00:00Added an answer on June 3, 2026 at 9:05 am

    It seems that you are using multiline textbox. First split your string on “\n\r” and then:

    string[] strArray =player1TxtBox.Text.Split("\n\r".ToCharArray());
    

    then

            int iPlayer1Total = 0;
            foreach (string str in strArray)
            {
                int temp =0;
                int.TryParse(str, out temp);
                iPlayer1Total  += temp;
             }
    

    Edit: a better option to split would be:

    var strArray  = player1TxtBox.Text.Split("\r\n".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a part of the programming Assignment, I have to maintain a linked list
I have this programming assignment that converts between meters and feet, and between kilograms
For a programming assignment, we have the following requirements: It needs to be a
I'm rushing against the clock for a programming assignment in which I have to
I have completed the assignment (yes it is for a programming class), but I
As part of the last assignment in a beginner python programing class, I have
I'm doing a homework assignment for my course in C (first programming course). Part
I have an assignment from my programming class, which is very poorly worded... The
i have a unix c programming assignment in which i do some advanced C
Hello I have one c++ Programming assignment question. I tried hard but somehow I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.