O
Owen
Guest
Still not perfect, but I improved the code, and added a little bit of move canceling.
lastnum = -1
moves = ["U","D","L","R","F","B","U'","D'","L'","R'","F'","B'","U2","D2","L2","R2","F2","B2"]
25.times do
pick = rand(18)
if lastnum == pick
until not pick == lastnum
pick = rand(18)
end
end
print moves[pick]
print " "
lastnum = pick
end
lastnum = -1
moves = ["U","D","L","R","F","B","U'","D'","L'","R'","F'","B'","U2","D2","L2","R2","F2","B2"]
25.times do
pick = rand(18)
if lastnum == pick
until not pick == lastnum
pick = rand(18)
end
end
print moves[pick]
print " "
lastnum = pick
end