This is a code for Matlab that lays out a grid for tic tac toe Go through the following MATLAB code snippet to determine what
This is a code for Matlab that lays out a grid for tic tac toe
Go through the following MATLAB code snippet to determinewhat it plots,inputs it accepts, andthegameyou are playing. Then add on to the code tomake a game that is you vs. computer. You will also be reviewing another students code.
Your script should contain comments detailing the following:
What does the code plot?
What inputs does the code accept?
What is the game you are playing?
Your script for a game that is you vs.
computer Code Snippet hx1 = [0,3];hy1 = [1,1]; hx2 [0,3]; hy2 = [2,2]; VX1 = [1,1];vy1 = [0,3]; VX2 = [2,2];vy2 = [0,3]; clf plot(hx1, hy1, 'r', hx2, hy2, 'r', vx1, vy1, 'r', vx2, vy2, 'r'),... axis off, axis square, ... title('place the cursor in the desired cell, then click.') hold turn = 0; while turn
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started