Archived
移除了影响打包的部分;
修正了洗牌算法中的错误; 将弱类型中历史记录的功能拆开了,减小了不必要的消耗;
This commit is contained in:
@@ -21,9 +21,12 @@ namespace XericLibrary.Runtime.MacroLibrary
|
||||
/// <returns></returns>
|
||||
public static List<int> FisherYatesShuffle(int length, int select)
|
||||
{
|
||||
if(select > length)
|
||||
throw new ArgumentOutOfRangeException("在进行洗牌时,要求输出的项目比拥有的项目更多,这是不合理的。");
|
||||
|
||||
var random = new System.Random();
|
||||
|
||||
List<int> arr = Enumerable.Range(1, length).ToList();
|
||||
List<int> arr = Enumerable.Range(0, length).ToList();
|
||||
List<int> res = new List<int>();
|
||||
|
||||
for(int i = 0; i < select; ++i)
|
||||
|
||||
Reference in New Issue
Block a user