JSFiddle - React, Tailwind, and code Playground
HTML
<body onload='document.getElementById("scram").innerHTML = scramble();'>
<p id="scram">No Scramble Available.</p>
<button onclick='document.getElementById("scram").innerHTML = scramble();'>Scramble</button>
<script>
function scramble(){for(a=s=y=r=[],x=Math.random;a<25;s[a++]=r+["'",2,''][0|x(y=r)*3])for(;r==y;r='RLUDFB'[0|x()*6]);return s.join(' ')}
</script>
</body>