Sparkline in unicode: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: syntax coloured, made p2js compatible)
(Added Arturo implementation)
Line 389: Line 389:
Median 4.0
Median 4.0
Max 7.5</pre>
Max 7.5</pre>

=={{header|Arturo}}==

<lang rebol>bar: "▁▂▃▄▅▆▇█"
barcount: to :floating dec size bar

while ø [
line: input "Numbers separated by spaces: "
numbers: to [:floating] split.words line
mn: min numbers
mx: max numbers
extent: mx-mn
sparkLine: new ""
loop numbers 'n [
i: to :integer barcount*(n-mn)//extent
'sparkLine ++ bar\[i]
]
print ["min:" round.to:1 mn "max:" round.to:1 mx]
print sparkLine
print ""
]</lang>

{{out}}

<pre>Numbers separated by spaces: 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1
min: 1.0 max: 8.0
▁▂▃▄▅▆▇█▇▆▅▄▃▂▁

Numbers separated by spaces: 1.5 0.5 3.5 2.5 5.5 4.5 7.5 6.5
min: 0.5 max: 7.5
▂▁▄▃▆▅█▇
</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==