Anonymous user
Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 05:59, 15 May 2022
, 2 years ago→{{header|BQN}}
No edit summary |
|||
Line 665:
5 42
2</pre>
=={{header|BQN}}==
{{works with|https://github.com/dzaima/CBQN CBQN}}
<lang bqn>#!/usr/bin/env bqn
# Cut 𝕩 at occurrences of 𝕨, removing separators and empty segments
# (BQNcrate phrase).
Split ← (¬-˜⊢×·+`»⊸>)∘≠⊔⊢
# Natural number from base-10 digits (BQNcrate phrase).
Base10 ← 10⊸×⊸+˜´∘⌽
# Parse any number of space-separated numbers from string 𝕩.
ParseNums ← {Base10¨ -⟜'0' ' ' Split 𝕩}
# •GetLine is a nonstandard CBQN extension.
•Show ⥊⟜(↕×´) ParseNums •GetLine@</lang>
{{out}}
<pre>4 2
┌─
╵ 0 1
2 3
4 5
6 7
┘</pre>
=={{header|C}}==
|