mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-02 21:00:56 +00:00
examples: simplify row builder using arrays
This commit is contained in:
parent
b0fbf3ee53
commit
0b43f1e968
@ -1,14 +1,11 @@
|
|||||||
func buildRow(str, a, b, c, d) {
|
func buildRow(str, a, b, c, d) {
|
||||||
let checkSeparator = "| "
|
let checkSeparator = " "
|
||||||
print("|", str, checkSeparator)
|
print("|", str, "| ")
|
||||||
if a { print("✅") } else { print("🚫") }
|
for i in [a, b, c, d] {
|
||||||
print(checkSeparator)
|
print(checkSeparator)
|
||||||
if b { print("✅") } else { print("🚫") }
|
if a { print("✅|") } else { print("🚫|") }
|
||||||
print(checkSeparator)
|
}
|
||||||
if c { print("✅") } else { print("🚫") }
|
println()
|
||||||
print(checkSeparator)
|
|
||||||
if d { print("✅") } else { print("🚫") }
|
|
||||||
println("|")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export func main() {
|
export func main() {
|
||||||
@ -29,5 +26,5 @@ export func main() {
|
|||||||
buildRow("!a || b", (not false) or false, (not true) or false, (not false) or true, (not true) or true)
|
buildRow("!a || b", (not false) or false, (not true) or false, (not false) or true, (not true) or true)
|
||||||
buildRow(" a || !b", false or (not false), true or (not false), false or (not true), true or (not true))
|
buildRow(" a || !b", false or (not false), true or (not false), false or (not true), true or (not true))
|
||||||
buildRow("!a || !b", (not false) or (not false), (not true) or (not false), (not false) or (not true), (not true) or (not true))
|
buildRow("!a || !b", (not false) or (not false), (not true) or (not false), (not false) or (not true), (not true) or (not true))
|
||||||
println("|-----------------------------------------------------|")
|
println("|------------------------------------------------------|")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user