Click here to Skip to main content
15,887,399 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automated save as webpage completed by C# Pin
Nguyễn Đức Thiện23-Oct-09 7:12
Nguyễn Đức Thiện23-Oct-09 7:12 
AnswerMessage Closed Pin
23-Oct-09 7:45
stancrm23-Oct-09 7:45 
GeneralRe: Automated save as webpage completed by C# Pin
Nguyễn Đức Thiện23-Oct-09 15:31
Nguyễn Đức Thiện23-Oct-09 15:31 
QuestionBeginner in need of help Pin
Darren Shields23-Oct-09 6:04
Darren Shields23-Oct-09 6:04 
AnswerRe: Beginner in need of help Pin
Henry Minute23-Oct-09 6:16
Henry Minute23-Oct-09 6:16 
GeneralRe: Beginner in need of help Pin
Darren Shields23-Oct-09 6:30
Darren Shields23-Oct-09 6:30 
GeneralRe: Beginner in need of help Pin
Henry Minute23-Oct-09 6:44
Henry Minute23-Oct-09 6:44 
AnswerRe: Beginner in need of help Pin
ely_bob23-Oct-09 6:43
professionalely_bob23-Oct-09 6:43 
Well you shouldn't be saving the data in text for, you should be saving it internally as a int, use this format:



class Game
{
     public int GameScore;
     public int LeageScore;
     public Game(int S, int LS)
     {
          GameScore = S;
          LeagueScore = LS;
     }
}


class Team{
     public List<Game> Games = new List<Game>()
     public string Name;
     public Team(string _Name)
     {
          Name = _Name;
     }
     public int CumulativeLeagueScore
     {
          get
          {
               int ret = 0;
               foreach(Game G in this.Games){ret+=G.LeagueScore;}
               return ret;
          }
     }

     public void AddGame(int score, int leagescore)
     {
          this.Games.Add(new Game(score, leagescore);
     }

}



that way when you want to add in things like statistics, and multiple years of records it will be easier.

But your issue is coming from using text somewhere in between your RNG(Random number generator) (probably Math>Random()..?) and your test.. Unless you are using dice and then typing it into a form... in which case only convert to int once and then whenever you want to display the info use ToString().
GeneralRe: Beginner in need of help Pin
Not Active23-Oct-09 7:02
mentorNot Active23-Oct-09 7:02 
GeneralRe: Beginner in need of help Pin
ely_bob23-Oct-09 7:41
professionalely_bob23-Oct-09 7:41 
GeneralRe: Beginner in need of help Pin
Not Active23-Oct-09 7:53
mentorNot Active23-Oct-09 7:53 
GeneralRe: Beginner in need of help Pin
ely_bob23-Oct-09 8:12
professionalely_bob23-Oct-09 8:12 
GeneralRe: Beginner in need of help Pin
Not Active23-Oct-09 8:22
mentorNot Active23-Oct-09 8:22 
GeneralRe: Beginner in need of help Pin
ragnaroknrol23-Oct-09 8:41
ragnaroknrol23-Oct-09 8:41 
GeneralRe: Beginner in need of help Pin
EliottA23-Oct-09 17:19
EliottA23-Oct-09 17:19 
GeneralRe: Beginner in need of help Pin
ragnaroknrol23-Oct-09 8:13
ragnaroknrol23-Oct-09 8:13 
GeneralRe: Beginner in need of help Pin
Not Active23-Oct-09 8:29
mentorNot Active23-Oct-09 8:29 
GeneralRe: Beginner in need of help Pin
ely_bob23-Oct-09 8:42
professionalely_bob23-Oct-09 8:42 
GeneralRe: Beginner in need of help Pin
ely_bob23-Oct-09 8:31
professionalely_bob23-Oct-09 8:31 
GeneralRe: Beginner in need of help [modified] Pin
ragnaroknrol23-Oct-09 8:46
ragnaroknrol23-Oct-09 8:46 
GeneralRe: Beginner in need of help Pin
ely_bob23-Oct-09 9:06
professionalely_bob23-Oct-09 9:06 
GeneralRe: Beginner in need of help Pin
ragnaroknrol23-Oct-09 9:11
ragnaroknrol23-Oct-09 9:11 
AnswerRe: Beginner in need of help Pin
Not Active23-Oct-09 7:01
mentorNot Active23-Oct-09 7:01 
QuestionSorry - I remove this topic to WCF forum Pin
dataminers23-Oct-09 5:40
dataminers23-Oct-09 5:40 
AnswerRe: WCF - OperationContract Generic Argument Pin
Not Active23-Oct-09 5:54
mentorNot Active23-Oct-09 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.