@LuisMendo Looking at this challenge, I figured, why not do 0:YY. However, in the Try it online! compiler, the result was Inf. So, I tried 0:YP, which resulted in 3.14... rather than 0,1,2,3. How can I do a range up to a constant? :YP works, but does not include 0.
(note that regardless, the answer would have been invalid since it must start printing on finite memory too)
@sanchises By default : takes one input x and gives the range 1:x. You want two inputs, so use 2$:or its abbreviated version :&. For example, :& with inputs 3, 7gives[3 4 5 6 7]. You can also use : in literals (as opposed : to being a function). So 3:7works too
@sanchises Using d is very clever. Saves two bytes over the obvious approach nq:
The last v!1e can be replaced by &h. The meta-function & for h means N$. So &h (or N$h) concatenates the whole stack horizontally.
You may want to add a link to Try it online so people can test it
Or MATL Online (developed by Suever with a bunch of interesting, MATL-specific features), but the latter is still experimental and occasionally freezes
MATL, 14 bytes
10&YlktX<=G*X>
Try it online!
Explanation:
&Yl % Log
10 % Base 10
kt % Floor and duplicate
X< % Find the smallest element
= % Filter out elements that do not equal the smallest element
G % Push the ...
@LuisMendo What would it take to get unicode support in MATL?
@Suever You could substitute the unicodes with (any) ascii characters to demonstrate your language but it would make the answer non-competing — Bassdrop Cumberwubwubwub10 mins ago
@Suever I'd like to know that too :-) Matlab supports them, up to code point 65535 I think. Octave apparently doesn't. Maybe there's some configuration possible. Do you have any idea? There must be a way for Octave to support Unicode
Man, all this terminal / encoding stuff is over my head. I can't even find relevant info using Google
Anyway, I would be happy having it working in the online compiler only (and on my Matlab). But the fact that double('─┐') gives three values per char on Octave is unsettling