A simple wellknown game tictactoe is played on a threebythre

A simple well-known game, tic-tac-toe, is played on a three-by-three grid of squares by two players. The Players alternate turns. Each player chooses a square and places a mark in a square. (One player uses X and the other O). The first player with three marks in a row, in a column, or on a diagonal wins the game. A logic circuit is to be designed for an electronic tic-tac-toe that indicates the presence of a winning pattern. The circuit output W_x is a 1 if a winning pattern is present for X and Wo is 1 if a winning pattern for the O\'s is present. For each of the nine squares, X_1 is 1 if the player one put an X and it is 0 if player 2 put an O in that location. Using Boolean algebra write the equations W_x and W_o for the following pattern of signals for the squares: X_1 X_2 X_3 X_4 X_5 X_6 X_7 X_8 X_9 Minimize the equations for W_x and W_o as much as possible, using Boolean algebra. What is the Gl cost of your function? Implement and simulate the full circuit for W_x and Wo in Logistic software (attach a picture of your circuit design).

Solution

answer fot (c) part class Board extends JPanel{ // char[][] cells = new char[2][2]; //boolean won(char token)....? //any clue to construct a boolean to tell if cells[0][0] === cels[0][1]? private char token = \' \'; char turn = \'O\'; char getToken(){ return token; } void setToken(char token){ this.token = token; } JButton b[] = new JButton[4]; public Board(){ setLayout(new GridLayout(2,2,0,0)); for(int i = 0 ; i < 4; i ++){ b[i] = new JButton(); add(b[i]); } listener(); } void listener(){ for(int i = 0; i < 4; i ++){ b[i].addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent e) { turn = (turn == \'X\') ? \'O\': \'X\'; System.out.println(\"Button Clicked\" + turn); //add if(won(turn))....? } }); }
 A simple well-known game, tic-tac-toe, is played on a three-by-three grid of squares by two players. The Players alternate turns. Each player chooses a square

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site