seems simple enough, but before we go any further there are some side issues...
- var redo = new Array(8);
is a very inefficient way to initialize an array.
does the job
document.write() is well obsolete and not recommended for updating the contents of the page. Use innerHTML or createElement methods
var redo = new Array(8);
is likely to get you into trouble, particularly as you are redefining the variable within the function of that name!
if you would like to show your entire code, it shouldn't be hard to get your redo function working, but I strongly suggest you address those issues first