in reply to Neanderthal Boggle

Your fy_shuffle routine merely swaps the last Boggle cube with any one of the cubes (possibly itself). Don't you want to actually shuffle the entire array?

The code in the FAQ uses a C-style for loop to iterate through the entire array. Your code uses a foreach loop with a single element list and only makes one swap in the array.