Twelve statements: Difference between revisions
m
→{{header|Uiua}}: final fix :-)
m (→{{header|Uiua}}: minor fix) |
m (→{{header|Uiua}}: final fix :-)) |
||
(One intermediate revision by the same user not shown) | |||
Line 4,122:
<syntaxhighlight lang="Uiua">
Even ← =1◿2⇡⧻ # nb indexes are zero-based
SA ← =12⧻ # Total is always twelve (don't test)
SB ← =3⧻⊚↘6 # Three of last six are true
SC ← =2⧻⊚⊏⊚Even. # Exactly
SD ← ⟨1◌|/×⟩⊢.
SE ← /׬⊏[1 2 3] # 2, 3, 4 are all false
SF ← =4⧻⊚⊏⊚¬Even. # Four odd rules are true
SG ← =1/+↙2↘1 # 2 xor 3
SH ← ⟨1◌|/×⟩⊢.
SI ← =3⧻⊚↙6 # Three of first six are true
SJ ← /×⊏[10 11] # 11 and 12 are both true
Line 4,135:
SL ← =4/+↘¯1 # Exactly four of above are true
≡(
# Test each rule against the data and concatenate
:[⊃⊃⊃⊃⊃⊃⊃⊃⊃⊃⊃SA SB SC SD SE SF SG SH SI SJ SK SL].
⊟∩□:⊙(⊚⌵-). # Append hit-count
)
▲)⋯+1×2⇡2048 # Brute force sensible combinations
# Partition by fit, keep only hits and near-misses
|