Coding Adventure 8: Play Tic Tac!

What is the function of a snowman?

Learn nested loops, Arrays, Lists and functions to build and play with your snowman

免費加入

描述

Awesome! Now we need to build a Tic Tac game. Can you?!

預覽視頻

任務

Print the board!

Now print the board. Build 3x3 List variable and fill it with "-" and print it on screen. That will bring the game to the iceworld.

First X!

Now read the two values beside Robo. The first value determines the row number and the second value determines the cell location in the row. Set the correct cell in the list of lists variable to "X" and print the variable to screen to update the board. 

First O!

Now we have 4 numbers, the first two numbers determine the location of the first X. The third and fourth numbers determine the location of the first O. Set the "X and "O" inside your list of lists variable and print the variable to screen each time to update the board.

Do it twice!

Wow! Can you repeat the previous mission two more times for another X and another O. Print the list of lists to screen after each time you change a value in it to update the board.

Full game!

Now it's time to read 4 "X" and 4"O" locations and set them in the list of lists. Print the list of lists to screen after each time you change a value in it to update the board.

What is the function of a snowman?

Learn nested loops, Arrays, Lists and functions to build and play with your snowman

免費加入
Canada Flag 隱私政策使 使用條款
Got an invite