Improving a Rubik's Cube scrambler's byte count Okay, I recently wrote a Javascript Rubik's Cube scrambler that outputs a 25-move scramble. It's 135 bytes. The Gist is here, but for reference, I have the formatted code:



function(){
  for(a=s=y=r=[],m='RLUDFB',x=Math.random;++a&lt;26;y=r,s.push(r+["'",2,''][0|x()*2]))
  for(;r==y;r=m[0|x()*5]);
  return s.join(' ')
}


Any tips?

EDIT: Code is updated, with @Optimizer's edits.
140 135 127 bytes

Still a big one, but here's for starters:



function(){for(a=s=y=r=[],x=Math.random;a&lt;25;s[a++]=r+["'",2,''][0|x(y=r)*3])for(;r==y;r='RLUDFB'[0|x()*6]);return s.join(' ')}


Some of the few tips used:


Loose the var. There is no point in using var when your aim is to golf!
When a = [], a++ gives 0. We use this fact to remove a 0 and ,
Combine the a&lt;25 and a++
You don't need to split a string. You can access its characters anyways via [i]
Get rid of {} in for loops


More to come.