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

  Within an arm reach of desire

The ability to engage in global branding is a key advantage to any large company. Coca-Cola is fortunate in that it possesses a number of instantly recognisable icons which go beyond the familiar taste of its product. In particular the Company ben..

  Types of business processes and information systems

Explain the types of business processes and information systems used in business operations

  Determine the number of students having scores

Write a program that reads a file ("scores.txt") consisting of students' test scores in the range of 0-200. These scores should be loaded into a one-dimensional array. Then the program should determine the number of students having scores in each ..

  Determine the coefficient of static friction

Determine the coefficient of static friction between the friction pad at A and ground if the inclination of the ladder isθ = 60 ° and the wall at B is smooth.

  Estimate the cost of the system

Estimate the cost of the system. To what degree were you able to get a better price through comparison shopping? If you are using a mail-order source, how does shipping affect your final cost

  Successfully permeating and spreading in our community

What evidence of ‘eco-citizenship' do you find in your everyday life? Do you think that ‘eco-modernization project' that Hobson (2006) highlights has been successfully permeating and spreading in our community? - e.g. GreenHome Programme in NSW

  Create a diagram using Visio that lists different IT systems

Identify five different IT systems that have affected business in the past few years (i.e., business software applications, networks, hardware, internet-based technologies, databases).

  Explore the pairs trading strategy for each pair of stocks

Are there characteristics of stocks that seem to lead to larger gains? Does this provide insight into when pairs trading might work or fail?

  Convert following left recursion grammar intoright recursion

Convert the following left recursion grammar into right recursion: a)S->S0S|1 b)S->Aa|Bb ,A->Aa|bA|a, B->Bb|a

  What is the intent of regulatory compliance

What is the intent of regulatory compliance, and what is the role of IT in maintaining corporate compliance and what can happen to organizations and their senior management if they ignore compliance mandates?

  Cloud provider secure large amount of capital

Few organizations tend to prefer operating expense models. whether Cloud providers will continue to secure large amount of capital....or will equity firms stop their funding?

  Formulate one or more problem statements

Formulate one or more problem statements

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