Last active
September 2, 2020 01:28
-
-
Save sakapon/70c0df78061d3e6a6b28623c12040031 to your computer and use it in GitHub Desktop.
OperatorsSample/StringBoolTest.Tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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