mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-02-04 11:07:59 -08:00
Simplify game loop
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -1 +1 @@
|
||||
You have more shots that there are blank squares.
|
||||
You have more shots than there are blank squares.
|
||||
|
||||
Reference in New Issue
Block a user