#Aceto, 33 bytes
Aceto, 33 bytes
We have quite a bit of wasted space, so I'm sure we could get rid of a few more bytes.
=|
0*v
ds<
MDL
&_d
id!L
rDM@xp
The bottom half (except for the xp
) reads the input, and puts it that many times on the stack, as an integer, i.e. '3' -> [3, 3, 3]. I really need a builtin for that..
The top half calculates the product by swapping the top two elements, checking if the top element is zero, otherwise multiplying the top two elements, and so on. xp
prints.