mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
27 lines
533 B
C#
27 lines
533 B
C#
namespace Chomp;
|
|
|
|
internal class Game
|
|
{
|
|
private readonly IReadWrite _io;
|
|
|
|
public Game(IReadWrite io)
|
|
{
|
|
_io = io;
|
|
}
|
|
|
|
internal void Play()
|
|
{
|
|
_io.Write(Resource.Streams.Introduction);
|
|
if (_io.ReadNumber("Do you want the rules (1=Yes, 0=No!)") != 0)
|
|
{
|
|
_io.Write(Resource.Streams.Rules);
|
|
}
|
|
|
|
while (true)
|
|
{
|
|
_io.Write(Resource.Streams.HereWeGo);
|
|
|
|
if (_io.ReadNumber("Again (1=Yes, 0=No!)") != 1) { break; }
|
|
}
|
|
}
|
|
} |