The Sandbox Thread

11 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

RollDice.NET

Back to Forum: The Sandbox
  • brownsoft

    Hello,
        RollDice.NET is a simple DiceRoller written in C# .NET 1.1  Its a simple app for Gamemasters/Players to use either for online games or any times you rather have a app roll the dice instead of doing it yourself..Smiley

        I wrote this to learn how to program using C#. I mostly work in Java and decided to check this language out and I feel quite at home since its almost a seemless transition from Java to C#.

    Note: I have updated the implementation of the base class to this diceroller.  I was using a simple int array to hold the informaton but i decided that using an ArrayList makes it so much easier to use. 

    It still built with .NET 1.1.  I have posted the source to my application on my website at clutterdump.com Please post any comments about this app.


  • Maurits

    Can you post the source?

  • brownsoft

    Once I touched it up.  It still real rough for consumption.  What are you looking for in the souce?? If you need any questions answered, just let me know.

  • Steve411

    brownsoft wrote:
    Once I touched it up.  It still real rough for consumption.  What are you looking for in the souce?? If you need any questions answered, just let me know.

    It's not that we want to see the source, it's that we crave to see the source! Smiley We're basically an MS community thats against open source software, yet when it comes to the sandbox it's all about the open sourcing baby! Smiley

    Also it's fun to see how other coders find their way around a project. That way we can compare our methods to theirs and learn something, ya know? Smiley

    I wanna' be a Jedi.
    Steve.

  • Maurits

    brownsoft wrote:
    Once I touched it up.  It still real rough for consumption.  What are you looking for in the souce?? If you need any questions answered, just let me know.


    I'm just paranoid.  If I step through the source I can keep an eye on what it's doing.

  • PerfectPhase

    Maurits wrote:
    brownsoft wrote: Once I touched it up.  It still real rough for consumption.  What are you looking for in the souce?? If you need any questions answered, just let me know.



    I'm just paranoid.  If I step through the source I can keep an eye on what it's doing.



    You take paranoia to a whole new level Smiley

    Stephen

  • brownsoft

    Just out of courosity,
        Are you realling against open source software?? If so why??? Open Source has some advantages and yes it does have disadvantages.
        BTW: I have now uploaded the source.

  • Steve411

    brownsoft wrote:
    Just out of courosity,
        Are you realling against open source software?? If so why??? Open Source has some advantages and yes it does have disadvantages.
        BTW: I have now uploaded the source.

    I am, a bit. I can't speak on everyone elses behalf though.

  • brownsoft

    Okay,
        After seeing the source and the program, what is your personal opinon about the program?? I mean if it sucks thats what i want to hear if its the honest opinon but hopefully it didn't suck..Smiley

  • Maurits

    I'm getting a stack overflow error... I'll try to isolate it.  Running VS 2002 on this machine.


    EDIT:
    'K, it's here:
    RollDiceBase.cs line 109

     
           public String diceString
            {
                get 
                { 
                    if (diceString.Equals("") == true) /* this line */
                    {
               
            return (NumberTimes.ToString() +
    "D" + WhichDice.ToString()); 
                    }
    


    EDIT2: OK, here's the fixed property get method
    (it is somewhat dangerous to have a property and a private member that differ only in case...)
            public String diceString
            {
                get 
                { 
                    if (DiceString.Equals("") == true)
                    {
               
            return (NumberTimes.ToString() +
    "D" + WhichDice.ToString()); 
                    }
                    else if (DiceString == null)
               
            throw new
    NullReferenceException("DiceString has not been initialized yet!");
                    else
                        return DiceString;
                }
            }
    


    EDIT3: Looks very nice.

  • brownsoft

    Actually,
        I realized after I got the same error you did that I had to modify the diceString property.  The first edit was the old version while the 2nd edit is the new version. I know have included open ended dice rolls in my RollDiceBase Class which can be seen in Generic System form.
        I will also change the above property so that it will not be dangerous.

    Matt

    EDIT 2 : I have updated the soure using your suggestion about the propertynames  and also add some documentation about the open ended function in the RollDiceBase Class.


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.