Skip to main content
deleted 35 characters in body
Source Link

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Recursive approach

Also 50 50 28

f()(echo $1;if((!$1));then exit;fi;f$1&&f $[RANDOM%$1])

TryTry

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Recursive approach

Also 50

f()(echo $1;if((!$1));then exit;fi;f $[RANDOM%$1])

Try

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Recursive approach

50 28

f()(echo $1&&f $[RANDOM%$1])

Try

added 229 characters in body
Source Link

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Recursive approach

Also 50

f()(echo $1;if((!$1));then exit;fi;f $[RANDOM%$1])

Try

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

Recursive approach

Also 50

f()(echo $1;if((!$1));then exit;fi;f $[RANDOM%$1])

Try

Using for as a main loop instead of while saved 6 bytes.
Source Link

Bash, 65 58 56 5650 bytes

f()(echo ${a=$1};while;for((a;a;));do{ echo $[a=RANDOM%a];done$[a=RANDOM%a];})

Try it online!Try it online!

(Improved thanks to manatwork)

Bash, 65 58 56 bytes

f()(echo ${a=$1};while((a));do echo $[a=RANDOM%a];done)

Try it online!

(Improved thanks to manatwork)

Bash, 65 58 56 50 bytes

f()(echo ${a=$1};for((;a;)){ echo $[a=RANDOM%a];})

Try it online!

(Improved thanks to manatwork)

deleted 94 characters in body
Source Link
Loading
deleted 1 character in body
Source Link
Loading
added 227 characters in body
Source Link
Loading
Source Link
Loading