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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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