29 26 bytes
Try it online!
At a high level, here's how this one works...
- write out
- loop 6 times...
- each iteration, write out a random digit in
And for people who like gory details about stacks. :)
'#o - push "#" on stack, print it as char
6[ ,] - loop 6 times
'0'? - push "0" and "?" codepoints on stack
? - pick a random number between them
'9G - is it greater then "9" codepoint?
[p 0]p - if/then, called if pick is > "9"
'( - push 28 on stack (Note 1)
+ - add 28 to random pick (Note 1)
, - decrement (Note 1)
o - print top of stack as a char
p - clear the loop artifact from the stack
Note 1: Mapping the codepoints
a-f means adding 27 to the codepoint. The shortest way to do that would be to push
' onto the stack, but the code for that (at least on TIO)
'' doesn't work. So this code loads 28 (which is
( then decrements the result with