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 2two even rules are true
SD ← ⟨1◌|/×⟩⊢.↙3↻4↙3↘4 # If 5 is true so are 6 and 7
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◌|/×⟩⊢.⇌↙3↻4⇌↙3↘4 # If 7 is true so are 6 and 5
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
 
)⋯+1×2⇡2048 # Brute force sensible combinations
≡(
# Test each rule against the data and concatenate
:[⊃⊃⊃⊃⊃⊃⊃⊃⊃⊃⊃SA SB SC SD SE SF SG SH SI SJ SK SL].
⊙⊂⟜SG⊙⊂⟜SH⊙⊂⟜SI⊙⊂⟜SJ⊙⊂⟜SK⟜SL
⊙⊂⟜SA⊙⊂⟜SB⊙⊂⟜SC⊙⊂⟜SD⊙⊂⟜SE⊙⊂⟜SF
⊟∩□:⊙(⊚⌵-). # Append hit-count
)
)⋯+1×2⇡2048 # Brute force sensible combinations
 
# Partition by fit, keep only hits and near-misses
129

edits