jeudi 16 janvier 2020

How do I shuffle a list?

How do I shuffle a List in Beef? I would like to add an extension to Random that shuffles a List in-place:

using System.Collections.Generic;

namespace System
{
    extension Random 
    {
        public virtual void Shuffle<T>(List<T> list)
        {
            // Use this to shuffle the list in-place
        }
    }
}



Aucun commentaire:

Enregistrer un commentaire