Skip to content

Instantly share code, notes, and snippets.

@sakapon
Last active September 2, 2020 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapon/70c0df78061d3e6a6b28623c12040031 to your computer and use it in GitHub Desktop.
Save sakapon/70c0df78061d3e6a6b28623c12040031 to your computer and use it in GitHub Desktop.
OperatorsSample/StringBoolTest.Tables
[TestMethod]
public void Tables()
{
StringBool t = "true";
StringBool n = "force";
StringBool f = "false";
var s = new[] { t, n, f };
// 真理値表を作成します。
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
Console.Write($"{s[i] && s[j],-8}");
}
Console.WriteLine();
}
Console.WriteLine();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
Console.Write($"{s[i] || s[j],-8}");
}
Console.WriteLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment