Question: For the following Python Tic Tac Code below: Draw a game tree for your program and analyze the performance of the players with utility values.
For the following Python Tic Tac Code below:
Draw a game tree for your program and analyze the performance of the players with utility values. State the evaluation functions wherever applicable.


1.# 2. # Tic Tac Toe 4. import random 6. # 7. # This is the simple game board, Just visualize a tic tac toe board) 8" # 9. game - list("012345678") 10. 12. # 1. Marks a field (if it is a digit, otherwise an 'x' or 'o' is a taken spot) 13. # 2. Runs the Mark-Computer() and puts an 'o' randomly someplace 14. # 15. digits -set("012345678") 16. 17. def mark(x): 18. 19. 20. 21. 22. 23. 24. if x in digits: ix-int (x) if game[ix] x: game [ix]-'x' mark_computer() return print("Please choose a free spot") else: 26. 27. 28. def mark_computer(O: 29. 30. 31. 32. 33. 34. 35 36. # 37. # This is the game loop, it prints the board too. print 'You gotta type in a digit son' while True: z = random . randint (0,8) if game [2] not in ('o', X'): game [2] - .0. # Break out of the loop# break 1.# 2. # Tic Tac Toe 4. import random 6. # 7. # This is the simple game board, Just visualize a tic tac toe board) 8" # 9. game - list("012345678") 10. 12. # 1. Marks a field (if it is a digit, otherwise an 'x' or 'o' is a taken spot) 13. # 2. Runs the Mark-Computer() and puts an 'o' randomly someplace 14. # 15. digits -set("012345678") 16. 17. def mark(x): 18. 19. 20. 21. 22. 23. 24. if x in digits: ix-int (x) if game[ix] x: game [ix]-'x' mark_computer() return print("Please choose a free spot") else: 26. 27. 28. def mark_computer(O: 29. 30. 31. 32. 33. 34. 35 36. # 37. # This is the game loop, it prints the board too. print 'You gotta type in a digit son' while True: z = random . randint (0,8) if game [2] not in ('o', X'): game [2] - .0. # Break out of the loop# break
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
