Julia 10.06, 5349 bytes
~x=rpad("🔵"^ceil(Int,10(0<=x<1 ? x : 1)),1020,"⚪")
If the input x
falls outside the range [0,1), it's replaced with 1
. The value ⌈10x⌉ determines the number of "🔵"
, and the output is padded to length with "⚪"
.
Using the ternary operator without spaces is deprecated in Julia 0.7 and disabled in Julia 1.0. The padding length passed to rpad
has to be adjusted for Julia 0.6, probably because textwidth
was added in Julia 0.7.