|
@@ -1,3 +1,4 @@
|
|
|
+using System.Collections.Concurrent;
|
|
|
using Connect4;
|
|
|
|
|
|
namespace MinMaxAB;
|
|
@@ -154,7 +155,7 @@ public class Connect4Minimax
|
|
|
|
|
|
public static int GetBestMove(GameBoard board, int depth)
|
|
|
{
|
|
|
- List<(int Column, int Score)> moves = [];
|
|
|
+ ConcurrentBag<(int Column, int Score)> moves = [];
|
|
|
// Parallel.For(0, board.dimensions.Columns, new() { MaxDegreeOfParallelism = 1 }, i =>
|
|
|
Parallel.For(0, board.dimensions.Columns, i =>
|
|
|
{
|