Skip to content

Commit

Permalink
Improve some response syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dukeofsussex committed Apr 23, 2023
1 parent 87179ec commit 6749aa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Game/Modules/Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public override string Process(string command, Bomb bomb)
}

this.stage++;
return $"Press {numberToPress}, " + (this.stage != 6 ? $"stage {this.stage}" : "done");
return $"Press {numberToPress}, {(this.stage != 6 ? $"stage {this.stage}" : "done")}.";
}
}
}
9 changes: 2 additions & 7 deletions Game/Modules/Simon.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace KTANE.Game.Modules
{
using System.Collections.Generic;
using System.Linq;
using System.Speech.Recognition;
using System.Text;
using KTANE.Game;
Expand Down Expand Up @@ -84,17 +85,11 @@ public override string Process(string command, Bomb bomb)
{
this.sequence.Add(command);

StringBuilder buttonsToPress = new ();
Dictionary<string, string> targetDict = bomb.HasVowel.Value
? this.vowel[bomb.Strikes]
: this.noVowel[bomb.Strikes];

foreach (string s in this.sequence)
{
_ = buttonsToPress.Append($"{targetDict[s]}, ");
}

return $"Press {buttonsToPress}.";
return $"Press {string.Join(", ", this.sequence.Select(s => targetDict[s]))}.";
}
}
}

0 comments on commit 6749aa3

Please sign in to comment.