Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Construct a smart computer that tries to win against the user in the tic/tac/toe code below. Do not change any other code that is written, it must...

Construct a smart computer that tries to win against the user in the tic/tac/toe code below. Do not change any other code that is written, it must correspond with what has already been written. An example is in the attachments turtle time random pieces = [, , , , , , , , ]turn = :turtle.setup(, )turtle.bgcolor()turtle.color()turtle.hideturtle()turtle.speed()turtle.width()turtle.up()turtle.goto(, )turtle.down()turtle.forward()turtle.up()turtle.goto(, )turtle.down()turtle.forward()turtle.up()turtle.goto(, )turtle.setheading()turtle.down()turtle.forward()turtle.up()turtle.goto(, )turtle.down()turtle.forward()turtle.up()turtle.color()x, y = , pos pieces: pos == :turtle.up()turtle.goto(x + , y - )turtle.setheading()turtle.down()turtle.forward()turtle.up()turtle.goto(x + , y - )turtle.setheading()turtle.down()turtle.forward()turtle.up() pos == :turtle.up()turtle.goto(x + , y - )turtle.setheading()turtle.down()turtle.circle()turtle.up()x += x > :x = y -= : turn, piecesturtle.onscreenclick() column = (x + ) // row = (y - ) // square = int(row * + column)print(, x, , y, , square) pieces[square] == :pieces[square] = turn turn == :turn = :turn = drawgame(pieces):print()turtle.onscreenclick(clicked) : : : clicked(the_board, x, y):drawgame(the_board) gameover(pieces):computer_AI(pieces)drawgame(pieces)gameover(pieces) :turtle.tracer(,)turtle.hideturtle()turtle.onscreenclick(handler)drawgame(pieces)turtle.mainloop()main()

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question