# Thread: My python one-liner scramble generator

1. Code:
```a=rand 3
p (1..25).map{a=(a+rand(2)+1)%3;[%w{R L},%w{F B},%w{D U}][a].sample+["","'","2"].sample}*" "```
Just a few changes to tim's. Should work fine.

2. Haha I made a scrambler in TI-basic last year so we could get scrambles on our calculators.

3. Why would a scramble not be allowed to always start with U/D?

I mean, when rotated, R = U, and moves relative to that are the same relative to those faces/axis.

4. What if you aren't color neutral? Wouldn't it matter then?

5. Originally Posted by qqwref
What if you aren't color neutral? Wouldn't it matter then?
How is that relevant?
If 10 peoples' cubes are scrambled with the same algorithm, and any state can be reached in 25 moves, then everyone's puzzle should be well-scrambled just as if they were scrambled with a random first face. No?

6. Originally Posted by StachuK1992
How is that relevant?
If 10 peoples' cubes are scrambled with the same algorithm, and any state can be reached in 25 moves, then everyone's puzzle should be well-scrambled just as if they were scrambled with a random first face. No?
That's about good as reasoning that since a 20 random-move scramble can reach any state, it should be a random state.

But in practice, doesn't really matter. We use random-state where it counts, and I hope someday it will be no problem to use MRSS everywhere.

7. Originally Posted by dbax0999
Haha I made a scrambler in TI-basic last year so we could get scrambles on our calculators.
Haha I did that this too. Mine was probably horribly inefficent though.

8. Here is one written in Qbasic.
How to add output to a file, I leave as an exercise.

RANDOMIZE TIMER
CLS
A\$ = "UDFBLR '2"
FOR T = 1 TO 10
V\$ = ""
FOR S = 1 TO 25
M\$ = MID\$(A\$, INT(RND * 6) + 1, 1)
T\$ = MID\$(A\$, ((INT(RND * 3) + 1) + 6), 1)
IF M\$ = N\$ THEN GOTO BAD
V\$ = V\$ + M\$ + T\$ + " "
N\$ = M\$
NEXT S
PRINT V\$: PRINT
NEXT T

http://www.qbcafe.net/qbc/english/do...compiler.shtml

http://www.qb64.net/forum/index.php?...ik5jqcgd391r5&

9. Anyone want to make a nice scrambler for the motorola w180?
I can't find any documentations for it. Its java I guess...

10. Anyone who writes a scrambler with Brainf*** wins my respect.