Here's the big stuff I changed (and again, we don't have to use my code, I was just trying to figure out what the heck was going on with the app):
createGame()
function to push games into the FB.You've both got access to my xogame
firebase if you want to look at the data structure as I've adapted it, and my latest branch push included my most up to date work.
I switched from five arrays of five to one array of 25 and used Allison's strategy of starting out with the arrays full of "b" (I assume for "blank"). The advantage of one big array is that the index is much easier to find. I also added an id to each td that matches the index of the array (though now that I'm thinking about it, I did it with numbers, which may not have been smart...).
I pushed the array like this: function updateP1Board(uuid, index, ship) {
fb2.child(uuid).child('p1Board').child(index).set(ship);
}
function createNewGame() {
var fb2 = new Firebase('https://xogame.firebaseio.com/Games');
var newGameRef = fb2.push();
var uuid = newGameRef.key();
newGameRef.set({p1Board: emptyBoard2, p2Board: emptyBoard2, p1Ships: '', p2Ships: '', p1Points: 0, p2Points: 0})
return uuid;
}
Nope, unless I'm missing something really important. I changed the image appending approach and don't have that fully re-integrated yet, so if Scott wants us to present in the morning we may be better off with what you've got.
I've tried to frame out all the functions we still need to write -- most require checking elements from firebase, but I think we can knock them out together pretty easily tomorrow. (I hope so anyway).
I'm going to wrap up for tonight in a few minutes (mainly because Panera is going to boot me out pretty soon). See you both in the morning!