Exemple #1
0
    internal void Play()
    {
        DoIntroduction();

        var result = _io.ReadNumber(Prompts.Answer);

        if (_io.ReadYes(Formats.Bet, Math.CalculateOriginal(result)))
        {
            _io.Write(Streams.Bye);
            return;
        }

        var original = _io.ReadNumber(Prompts.Original);

        _io.WriteLine(Math.ShowWorking(original));

        if (_io.ReadYes(Prompts.Believe))
        {
            _io.Write(Streams.Bye);
            return;
        }

        _io.Write(Streams.Lightning);
    }
Exemple #2
0
 internal static bool ReadYes(this IReadWrite io, string format, Number value) =>
 io.ReadYes(string.Format(format, value));