Determines whether the boolean code is correct

Assignment Help Basic Computer Science
Reference no: EM131117815

Binary Code Game

Build a world with three switches (Controls) and a light bulb (Lights), as seen below. Set the emissive color property of the light bulb to black (turned-off).

1219_20d2f42d-3723-4de6-96af-a74c9e13a7c0.png

In this game, the positions of the levers on the switches represent a binary code. When a lever is up, it represents 1 (electric current in the switch is high) and when down, 0 (electric current in the switch is low). In the above world, all three levers are up, so the binary code is 111. The correct binary code is chosen at the beginning of the game. (You can enter a given code, and then have a friend try to guess it, or you can use the world-level random number function, as described in Tips & Techniques 6.) The idea is to have the user try to guess the correct binary code that will light up the light bulb (its emissive color will be yellow). To guess the binary code, the user will click on the levers to change their position. Each time the user clicks on a lever, it move s in the opposite direction-up (if currently down) or down (if currently up). When all three switches are in the correct position for the binary code, the bulb will turn on.

Each switch should respond to a mouse-click on the switch. If the handle is down, flip it up. If the handle is up, flip it down. To track the current position of a handle, an invisible circle can be placed on the switch and used as a point of reference. When the handle is above the circle, turn it down. When the handle is below the circle, turn it up. See Exercise 12 for more detail.
Your program must include a Boolean function that determines whether the Boolean code is correct.

Reference no: EM131117815

Questions Cloud

Industrial revolution or nationalism : Make the case that either the Industrial Revolution or nationalism was the most significant force in nineteenth-century world history. Consider the case for the other option, as well, by way of demonstrating why your choice was more significant.
Evaluated a number of tools in helping to find solutions : Your role is to prepare a professional report for the board of directors, demonstrating that you have evaluated a number of tools and methods in helping to find solutions to the issues identified in the scenario above.
Discount service stations to several neighboring states : INTERMEDIATE The Ewing Distribution Company is planning a $100 million expansion of its chain of discount service stations to several neighboring states. This expansion will be financed, in part, with debt issued with a coupon interest rate of 15 ..
University in the united states : When was the University of Pennsylvania founded and was it first official University in the United States?
Determines whether the boolean code is correct : Each switch should respond to a mouse-click on the switch. If the handle is down, flip it up. If the handle is up, flip it down. To track the current position of a handle, an invisible circle can be placed on the switch and used as a point of refe..
Law in the us congress : Outline and explain the basic steps in the process by which a bill becomes a law in the U.S. Congress
Describe perspective about the soviet rule : Take the perspective of a citizen of East Berlin after 1961. Describe your perspective about the Soviet rule, Western freedoms, and hope for the future.
Intrinsic value of a firm : Select a U.S. S&P 500 Company required to submit either 8-K, 10-Q, or 10-K U.S. Securities and Exchange Commission (SEC) reports. Before proceeding to Part Two, submit your firm selection to your instructor and obtain approval; completing this as..
What is maggie total profit or loss from a long straddle : Describe how Maggie could use straddles to speculate on the euro's value. At option expiration, the value of the euro is $1.30. What is Maggie's total profit or loss from a long straddle position? What is Maggie's total profit or loss from a long str..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Which shipper service to choose for company

Your task is to choose the best shipper for company. Compare these shippers, like FedEx (www.fedex.com), UPS (www.ups.com), and the U.S. Postal Service (www.usps.gov).

  Additional web resources for telecommunication

You may search these questions or part of them on the web resource links available under "Additional Web Resources for Telecommunication & Network Security.pdf". If you do so, you must provide the reference to the resource as well as cite in your ..

  Can we characterize the shapes of these regions

Can we characterize the shapes of these regions?

  Problem regarding the communication technologies

How do you think these communication technologies will affect the travel industry which depends heavily on business-related travel?

  Information technology is the process of using computers or

information technology is the process of using computers or computing devices to obtain and handle information and

  Bringing an organization products

This is an individual project. This project is related to the Case Study project. Each student must complete an Architectural Diagram that illustrates the placement of security and other technologies within the converged network solution.

  Given a set p of n points on the plane

Given a set P of n points on the plane, consider the problem of finding the smallest circle containing all the points in P. Show that the following is a 2-factor approximation algorithm for this problem. Pick a point x ∈ P, and set r to be the ..

  How many code words have exactly three 0''s

How many code words have exactly three 0's?

  Input and output devices - please describe your view of

1 input and output devices - please describe your view of what direction such devices is taking in computing. are we

  How might these be minimized

What DNS cache issues are involved in changing the IP address of, say, a Web server host name?

  Four values aligned to the standards of conduct in pmp

What are the four values aligned to the standards of conduct in pmp? Choose ONE of the values and provide your reasons as to why this value is essential in project voice based email for blind people.

  Business in the marketplace over the long term

Compare and contrast the DYB and GYB strategies in terms of the ability to sustain a business in the marketplace over the long term, to be competitive against rivals, and profitability.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd