Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typos #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Moq;
using Xunit;

public class RandomBoardFillterTests
public class RandomBoardFillerTests
{
[Fact]
public void Fill()
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Logic/BattleshipBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public bool TryPlaceShip(BoardIndex ix, int shipLength, Direction direction)
/// <param name="ix">Coordinates where the ship should be placed</param>
/// <param name="shipLength">Length of the ship (max. 10)</param>
/// <param name="direction">Direction of the ship</param>
/// <param name="isWater">Callback to find out if a given suqare is water before placing the ship</param>
/// <param name="isWater">Callback to find out if a given square is water before placing the ship</param>
/// <returns>
/// <c>true</c> if the ship can be placed here, otherwise <c>false</c>.
/// </returns>
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Logic/BoardIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static int GetIndex(int col, int row)
// This is a private method, so we can assume that col and row
// contain valid values. We check them only in debug builds.

// Read more about assertation in C#
// Read more about assertion in C#
// https://docs.microsoft.com/en-us/visualstudio/debugger/assertions-in-managed-code
Debug.Assert(col is >= 0 and <= 9 && row is >= 0 and <= 9);

Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Logic/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public SquareContent Shoot(int shootingPlayer, BoardIndex ix)
if (shipResult == ShipFindingResult.CompleteShip
&& shipRange.All(ix => shootingBoard[ix] == SquareContent.HitShip))
{
// The hit sank the ship -> change all ship quares to SunkenShip
// The hit sank the ship -> change all ship squares to SunkenShip
content = SquareContent.SunkenShip;
foreach(var shipIx in shipRange)
{
Expand Down
4 changes: 2 additions & 2 deletions NBattleshipCodingContest.Logic/ISinglePlayerGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// NOTE that this interface is for future use. Currently not part of the project.

/// <summary>
/// Represens a log entry in a single-player game' log
/// Represents a log entry in a single-player game' log
/// </summary>
public record SinglePlayerGameLogRecord(BoardIndex Location, SquareContent ShotResult);

Expand Down Expand Up @@ -36,7 +36,7 @@ public interface ISinglePlayerGame
/// Gets the board with ships on it
/// </summary>
/// <remarks>
/// The computer player has to shink those ships. Does not contain <see cref="SquareContent.Unknown"/>
/// The computer player has to sink those ships. Does not contain <see cref="SquareContent.Unknown"/>
/// squares.
/// </remarks>
IReadOnlyBoard Board { get; }
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Logic/ReadOnlyBoardExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class ReadOnlyBoardExtensions
/// </summary>
/// <param name="board">Board to convert</param>
/// <returns>
/// String in which each letter represents one board sqare.
/// String in which each letter represents one board square.
/// </returns>
public static string ToShortString(this IReadOnlyBoard board) =>
string.Create(100, board, (buf, content) =>
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Players/PlayerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class PlayerBase
/// Gets the next shot from the player.
/// </summary>
/// <param name="gameId">Unique identifier of the current game</param>
/// <param name="opponent">identifier of the opponent</param>
/// <param name="opponentId">identifier of the opponent</param>
/// <param name="board">Current board content</param>
/// <param name="shoot">Callback with which the method has to do the shooting</param>
/// <remarks>
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Players/Sequential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public override async Task GetShot(Guid _, string __, IReadOnlyBoard board, Shoo
// Find next unknown square
while (board[ix] != SquareContent.Unknown) ix = ix.Next();

// Shoot at first unknonwn square
// Shoot at first unknown square
await shoot(ix);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void SyntaxReceiver()
var (tree, _) = Compile(Code);
var receiver = FillReceiver(tree);

// Check that syntax receiver recogniced candidate classes (i.e. classes
// Check that syntax receiver recognized candidate classes (i.e. classes
// with at least one base class).
Assert.Equal(4, receiver.CandidateClasses.Count);
}
Expand Down
4 changes: 2 additions & 2 deletions NBattleshipCodingContest.PlayersGenerator/PlayersGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
/// <inheritdoc/>
public void Initialize(GeneratorInitializationContext context) =>
// We do the work in a helper functions because we want to be able to verify that
// a syntax receiver is registeres. However, our mocking framework Moq does not support
// a syntax receiver is registered. However, our mocking framework Moq does not support
// creating mock objects for structs like this (at least I don't know how to do it).
InitializeImpl(context.RegisterForSyntaxNotifications);

Expand Down Expand Up @@ -73,7 +73,7 @@ public static class PlayerList
{
");

// Mandator base class for players
// Mandatory base class for players
var playerBaseSymbol = compilation.GetTypeByMetadataName("NBattleshipCodingContest.Players.PlayerBase");
if (playerBaseSymbol == null)
{
Expand Down
2 changes: 1 addition & 1 deletion NBattleshipCodingContest.Protocol/ProtocolTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static SquareContent EncodeSquareContent(Logic.SquareContent content)
{
var result = (SquareContent)content;

// Check enum value in debug build. Read more about assertation in C#
// Check enum value in debug build. Read more about assertion in C#
// https://docs.microsoft.com/en-us/visualstudio/debugger/assertions-in-managed-code
Debug.Assert(Enum.IsDefined(typeof(Logic.SquareContent), content));
Debug.Assert(Enum.IsDefined(typeof(SquareContent), result));
Expand Down