none
How can i sort a List<sting> randomly? RRS feed

  • Вопрос

  • I have a pack of cards:
            public static readonly List<string> PackNew = new List<string> 
              { "club_1", "club_4", "club_3", "club_2", "club_10", "club_9", "club_8", "club_7", 
                "spade_1", "spade_4", "spade_3", "spade_2", "spade_10", "spade_9", "spade_8", "spade_7", 
                "heart_1", "heart_4", "heart_3", "heart_2", "heart_10", "heart_9", "heart_8", "heart_7", 
                "diamond_1", "diamond_4", "diamond_3", "diamond_2", "diamond_10", "diamond_9", "diamond_8", "diamond_7" };
    Can I sorting this collection randomly in to the new varible?
    • Перемещено SachinW 2 октября 2010 г. 1:01 MSDN Forums Consolidation (От:Visual Studio Team System)
    22 апреля 2009 г. 9:38

Ответы

    • http://social.msdn.microsoft.com/forums/en-US/Vsexpressinstall/thread/a802cc59-0398-49e7-a06d-be36888975fb/
    • http://www.dotnetperls.com/shuffle-array
    • http://stackoverflow.com/questions/108819/best-way-to-randomize-a-string-array-in-c
    • http://forum.codeby.net/lofiversion/index.php/t11823.html

    Don't forget to vote for useful replies and/or mark answers for your questions - that helps other guys to find the answer faster.
    • Предложено в качестве ответа Dmitry Pavlov 12 мая 2011 г. 19:19
    • Помечено в качестве ответа PashaPashModerator 12 мая 2011 г. 19:55