1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kay [80]
4 years ago
12

Design a method for representing the state of a tic-tac-toe board in computer memory. can you fit your representation into three

bytes?
Computers and Technology
2 answers:
ra1l [238]4 years ago
7 0
The combination of Xs,Os, and blanks will approximately be somewhere between 2048 and about 4048. The combination’s total is 19, 683, but since the Xs and Os number will always be equal or off by 1, many cases are eliminated. Thus, the board is represented in 11 or 12 bits.
mote1985 [20]4 years ago
4 0

Answer:

A Tic-Tac-Toe board consist of 9 fields. Each field can take 3 states: Empty, Circle, Cross. To represent each state you need 2 bits: 00, 01, 10.

With two bits for each field, you can easily represent whole board in 3 bytes, by using two bits as each field, and each byte as row of board.

You might be interested in
They are correct? thank you!
vredina [299]

Answer:

<em>Yes</em><em> </em><em>they</em><em> </em><em>are</em><em> </em><em>correct</em><em>.</em><em> </em><em>welcome</em><em>.</em><em>.</em><em>.</em><em>.</em>

8 0
3 years ago
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
Write the pseudo-code of an algorithm that returns the sum of all integers in a list of integers. You may use the Pascal-like ps
Arlecino [84]

Answer:

//variable integer_list to hold a list of integers

DECLARE integer_list

ASSIGN values to integer_list

//variable sum to hold the sum of the elements in the list

DECLARE sum

ASSIGN zero to sum

//loop through the integer_list and sum all it's elements together.

for(int i=0; i<integer_list.size(); i++){

sum += interger_list.get(i)

}

//Show the result of the addition from the for loop

DISPLAY "The sum is " + sum

Explanation:

The above code uses some hypothetical programming language syntax. The second and third lines declare an arbitrary integer list and assign a set of values to it respectively.  

The fifth line declares a variable "sum" which will hold the result of summing all the elements in the list. The sixth line initializes "sum" to zero.

The for loop shown iterates through the integer list cumulatively summing its elements.

The result is displayed as written on line 12.

Hope it helps!  

3 0
4 years ago
Hashing algorithms are used on evidence files to uphold the chain of custody in an investigation. Which of the following is NOT
raketka [301]

Answer:

C. DAT-1

Explanation:

Chain of custody is applied when examining digital evidence and checking for proof that no alterations have been made to the document. It ensures that the original piece of digital evidence which could be in text, image, video, or other electronic formats, is preserved and protected from alterations. Hashing algorithms which are mathematical computations that help to condense files are applied during this procedure.

Common hashing algorithms applied, include;  the message digest 4, secure hashing algorithms 1, 2, 256, 224, 512, etc. The message digest 4 is used to evaluate why a particular piece of evidence was handled by an individual. This is further authenticated by examining the fingerprint.

4 0
3 years ago
Write 4 types of viruses , explain them briefly.
wariber [46]

I can help with two.

Web Scripting Virus, A sneaky virus that targets popular websites. What this virus does is overwrite code on a website and insert links that can install malicious software on your device. Web scripting viruses can steal your cookies and use the information to post on your behalf on the infected website.

FILE INFECTOR, targeting executable files (.exe), file infector viruses slow down programs and damage system files when a user runs them.

8 0
3 years ago
Other questions:
  • What are the features of the Outline view in Word? Select three options.
    9·1 answer
  • Which one of the following terms is defined as the material and surfaces upon which an artist works?
    9·1 answer
  • Suppose you can access the caches in the local DNS servers of your department. Can you propose a way to roughly determine the We
    14·1 answer
  • To update a bibliography field that is not contained in a ____, right-click the bibliography, and then click Update Field on the
    10·1 answer
  • 12. Realizar un algoritmo que genere un número aleatorio, el usuario debe adivinar cual es el número generado para esto tendrá 3
    10·1 answer
  • Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers s
    14·1 answer
  • How to make a website
    15·2 answers
  • Any anime weebs wanna talk
    7·2 answers
  • Area Triangolo Rettangolo in c++
    6·1 answer
  • Do you think should give credit to people who invented viral dances?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!