Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Conditional-structures/BQN/conditional-structures-1.bqn
Normal file
11
Task/Conditional-structures/BQN/conditional-structures-1.bqn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
If ← {𝕏⍟𝕎@}´ # Also Repeat
|
||||
IfElse ← {c‿T‿F: c◶F‿T@}
|
||||
While ← {𝕩{𝔽⍟𝔾∘𝔽_𝕣_𝔾∘𝔽⍟𝔾𝕩}𝕨@}´ # While 1‿{... to run forever
|
||||
DoWhile ← {𝕏@ ⋄ While 𝕨‿𝕩}´
|
||||
For ← {I‿C‿P‿A: I@ ⋄ While⟨C,P∘A⟩}
|
||||
|
||||
# Switch/case statements have many variations; these are a few
|
||||
Match ← {𝕏𝕨}´
|
||||
Select ← {(⊑𝕩)◶(1↓𝕩)@}
|
||||
Switch ← {c←⊑𝕩 ⋄ m‿a←<˘⍉∘‿2⥊1↓𝕩 ⋄ (⊑a⊐C)◶m@}
|
||||
Test ← {fn←{C‿A𝕊e:C◶A‿E}´𝕩⋄Fn@}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
a<b ? a+↩1 ; # If
|
||||
a<c ? c-↩1 ; # Else If
|
||||
a-↩2 # Else
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue