mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-09 03:43:01 -08:00
Complete game
This commit is contained in:
12
72_Queen/csharp/RandomExtensions.cs
Normal file
12
72_Queen/csharp/RandomExtensions.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Queen;
|
||||
|
||||
internal static class RandomExtensions
|
||||
{
|
||||
internal static Move NextMove(this IRandom random)
|
||||
=> random.NextFloat() switch
|
||||
{
|
||||
> 0.6F => Move.Down,
|
||||
> 0.3F => Move.DownLeft,
|
||||
_ => Move.Left
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user