Create a two-dimensional array at runtime: Difference between revisions

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}}==