Files
basic-computer-games/62_Mugwump/csharp/Mugwump/Mugwump.cs
Chris Reuter d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00

21 lines
502 B
C#

namespace Mugwump
{
internal class Mugwump
{
private readonly int _id;
private readonly Position _position;
public Mugwump(int id, int x, int y)
{
_id = id;
_position = new Position(x, y);
}
public (bool, Distance) FindFrom(Position guess) => (guess == _position, guess - _position);
public string Reveal() => $"{this} is at {_position}";
public override string ToString() => $"Mugwump {_id}";
}
}