languages | products | page_type | name | urlFragment | description | |||
---|---|---|---|---|---|---|---|---|
|
|
sample |
.NET Core parallel interactive reversi game |
parallel-programming-wpf-raytracer-cs |
A .NET Core WPF application that demonstrates AI algorithms using minimax with alpha-beta pruning and parallel AI. |
The sample source code is a .NET Core WPF application written in C#, that demonstrates AI algorithms using minimax with alpha-beta pruning, and the parallel AI (light player) uses Tasks and CancellationTokens to achieve speedup via parallelism. For more information, see .NET Core 3 for Windows Desktop.
This sample is written in C# and targets .NET Core 3.1. It requires the .NET Core 3.1 SDK.
The sample source code uses the following types and members:
Monitor.Enter
Monitor.Exit
CancellationTokenSource
CancellationToken
Queue<Task>
Task.WaitAll
Task.Run
Task.Factory.StartNew
TaskScheduler.FromCurrentSynchronizationContext
The source code includes an MSBuild project file for C# (a .csproj file) that targets .NET Core 3.1. After you download the .zip file containing the example code, create a directory and select Download ZIP to download the sample code files to your computer. To build the example:
- Download the .zip file containing.
- Create the directory to which you want to copy the files.
- Copy the files from the .zip file to the directory you just created.
- If you are using Visual Studio 2019:
- In Visual Studio, select Open a project or solution (or File > Open > Project/Solution from the Visual Studio menu.
- Select Debug > Start Debugging from the Visual Studio menu to build and launch the application.
- If you are working from the command line:
- Navigate to the directory that contains the sample.
- Type in the command
dotnet run
to build and launch the application.