TicTacToe: Update board function


English (Auto-generated)

doing. So um today we're back with our tic tac toe challenge and I'm very excited for this one, it's still decently easy one. Good thing we titled it up into functions. Um and today we're gonna go ahead and do update board basically we're just gonna get our input which is moved and turn that into into a movie. We're gonna turn that into our updated board. So let's go ahead and do that. So I'm gonna do well actually I like it here first for you too. Look up here update ford. Yeah, we're gonna take board pleasure X and move. Okay. And now that we have that we're going to do these assigned to variables are road roof and our column move and that's going to equal move that since working it in our input is going to be a string, we're gonna go ahead and connect to eight. Eat move zero in the first part of that and then in move right, okay, so that should make decent sense. Um And what we're gonna do is player X eight times false. Then what we're going to do is make board throw throw and call him move. This is just to specify where what we're going to change in our board is going to know equal oh bells our board the board throw move and column move, report X. Okay, so when a player is an X. We're gonna change that area to zero and when her player is X from the Change it two weeks and also yeah, I think I've explained it pretty well so far and yeah, that's what we're going to do now to try it out, we're just gonna grab this part. Mhm. Okay, and then what we're gonna do is grab our board appear just like that and that's whatever else. Then what we're gonna do is a T board, get a bit bored and then bored. Try not board. True. Let's make it because we're starting off and move. Let's make it 11. So it should appear in this barrier right here because it's the second row in the second cup. So that should work. Look at 11 and then we just print force blank show ford like, so let's test it out, see how that goes. And tada puts it like that. We can go ahead and it are pretty little board. Okay, So it can look a lot nicer and stuff like so we can just do that and board. Ah What? Right back? Yeah, let's step down here. Okay, well, when I don't do that actually, but as you can see it works perfectly. So let's try that one more time with a different position. Let's say we're going in the very, very first, you want me just zeros or try that out. Let's see it shows up for the first one. Let's make this fault for example. So it should be Oh no, and yeah, so it works perfectly. So now we have our way of updating the board. I hope you guys like that solution. Always make sure if you want to send me your own solutions or maybe show me your way every friday during this way. There's always things that can really fractured and always honorable most of the times. And yeah, so show me what you're doing this. I would really much very much like that and thank you for tuning in next time we'll probably do our game over winner and we should probably be mainly done and make sure that our way of searching players works. Thank you so much for tuning in and I'll see you guys on the next one.
8 Views 0 Likes 0 Comments

In this part of the series we're going to make a function that updates the board with our player's move!

Leave a comment (supports markdown format)