# [R], <s>66</s> 60 bytes
<!-- language-all: lang-r -->
function(n){while({cat(n," ");n=sample(n,1)-1;n>0})0;cat(0)}
[Try it online!][TIO-jje9iv03]
[R]: https://www.r-project.org/
[TIO-jje9iv03]: https://tio.run/##K/qfpmCj@z@tNC@5JDM/TyNPs7o8IzMnVaM6ObFEI09HSUFJ0zrPtjgxtwAomKdjqKlraJ1nZ1CraWANUmGgWfs/TcPQwMBA8z8A "R – Try It Online"