Sparkline in unicode: Difference between revisions
Content added Content deleted
m (→{{header|Python}}: Preamble) |
|||
Line 1,651: | Line 1,651: | ||
Or, by composition of pure functions, with type comments for the reader, rather than the compiler. |
Or, by composition of pure functions, with type comments for the reader, rather than the compiler. |
||
To vary the approach, the block |
To vary the approach, the block used is derived from the option type (<code>Just x | Nothing</code>) result of a search over 7 zero-indexed lower bounds [0..6]. |
||
If a lower bound whose value exceeds that of the data point is found, we just use the index of that bound. |
|||
in a search over 7 zero-indexed lower bounds [0..6]. |
|||
⚫ | |||
The index used is either just that of the first bound which exceeds the given data value, |
|||
⚫ | |||
<lang python>import re |
<lang python>import re |