Simplify game loop

This commit is contained in:
drewjcooper
2023-05-23 07:55:41 +10:00
parent 461b4e2b64
commit d1be351045
2 changed files with 11 additions and 2 deletions

View File

@@ -38,7 +38,9 @@ L2230: if (humanShotSelector.CanTargetAllRemainingSquares)
_io.WriteLine(Streams.YouHaveMoreShotsThanSquares);
L2250: goto L2890;
}
computerFleet.ReceiveShots(humanShotSelector.GetShots(turnNumber), ship => _io.Write(Strings.YouHit(ship.Name)));
computerFleet.ReceiveShots(
humanShotSelector.GetShots(turnNumber),
ship => _io.Write(Strings.YouHit(ship.Name)));
L2620: if (!humanStarts)
{
L2640: turnNumber++;
@@ -84,6 +86,13 @@ L2960: humanFleet.ReceiveShots(
}
}
internal enum Winner
{
None,
Human,
Computer
}
internal class DataRandom : IRandom
{
private readonly Queue<float> _values =

View File

@@ -1 +1 @@
You have more shots that there are blank squares.
You have more shots than there are blank squares.