What better way than to choose the ultra-tiny and low cost BeagleBoard.org PocketBeagle to program an arcade style competitive game. What -A- Moderate Overview:The What -A- Mole styled game provides a player the opportunity to react quickly to a random LED light up by pressing the corresponding button before the light goes out.
The game provides a “3-2-1” ready signal with two red and one green LED before play begins. Turn the potentiometer to increase the difficulty / speed of the LEDs.
Hardware for What -A- Moderate :Building the What -A- Mole game gives the opportunity to connect several LEDs, push buttons, a potentiometer, buzzer and 4 x 7-segment display to a PocketBeagle building a complete I/O system. By using the external headers on the bottom of PocketBeagle to connect to the Breadboard and populating the internal headers on the top of PocketBeagle with female headers we've created a flexible configuration for connecting to a Breadboard while still being able to add a Click Board for future projects.
Hardware Layout for PocketBeagle What -A- Moderate Frizzing Diagram for Hardware Layout:Follow the instructions in the Frizzing Diagram to build the What -A- Moderate on a Breadboard.
Excludes: Angola, Cameroon, Cayman Islands, French Polynesia, Libya, Mongolia, Suriname, Guyana, Panama, Mauritius, Brunei Darussalam, Chad, Madagascar, New Caledonia, Bahamas, Bermuda, Iran, Saint Kitts-Nevis, Western Sahara, Bolivia, Laos, Congo, Republic of the, Seychelles, Sudan, Guadeloupe, Venezuela, Somalia, Burma, Cuba, Republic of, Reunion, Yemen, Barbados, Belize, Liberia, Sierra Leone, Central African Republic, Martinique, Dominica, Niger, French Guiana, Saint Pierre and Miquelon, Saudi Arabia Will usually ship within 3 business days of receiving cleared payment.
Select PayPal Credit at checkout to have the option to pay over time. Interest will be charged to your account from the purchase date if the balance is not paid in full within 6 months.
The PayPal Credit account is issued by Synchrony Bank. Whack-a- mole describes a situation in which attempts to solve a problem are piecemeal or superficial, resulting only in temporary or minor improvement, as in, “the site’s security team has an ongoing battle against spammers, but it’s a game of whack-a- mole.” See Oxford Dictionaries.
The whack-a- mole concept is familiar to those attempting to classify documents using text-based rules or analytics. It works equally well on scanned or faxed images and on native electronic files.
By examining the largest clusters first, subject-matter experts can generally review and assign consistent document-type labels to 99% of an organizations documents in three days. Subject-matter experts can focus their attention on any new clusters that form, typically a very small percentage of documents after the initial processing.
Identifying document attributes to extract from each cluster is a second process involving different skill sets, and it takes somewhat longer, generally measured in months for enterprise-scale collections. The game you wrote in the previous lab was quite static and purely textual: nothing happened until the user typed a number into a dialog box, and the only reward was the dubious intellectual satisfaction of using binary search.
This lab will build a game that is more graphical and interactive, and less cerebral (if that's the right word in this context). In Wham, an image (in my case, of a prairie dog like the ones here) jumps randomly around the screen.
Either way, read through the instructions carefully and think out your sequence of operations before you begin. All the code sequences are in the instructions too, though minor modifications are sometimes necessary; use copy and paste to ensure that you transcribe them correctly.
Mac users: beware of TextEd it, especially its enthusiasm for so-called smart quotes. Use the template provided to organize your code; copy it into your lab6.html file and modify it.
Do not throw random fragments of code into the file in the hope that they will do something useful; computers are unforgiving, and both syntax and semantics matter. Use Firefox or Chrome instead of Internet Explorer and Safari, which seem less helpful about identifying errors.
The browser provides a library of user interface components like buttons, check boxes, option selectors, and text, and useful functions that make it possible to control what the user sees on the page. It's also possible to generate HTML on the fly and thus create and modify web page contents under program control.
Second, code can be included as an “event handler” for any object on the web page. That example used the click event to do an operation when the button is pressed, but you can also use mouseover and onMouseout to perform some action when the mouse enters a region, like an image, and when it leaves.
Getting values from Forms If you want to ask the user to provide a value for your program to use -- such as the speed at which the prairie dog moves -- you can use a prompt dialog box, or you can use a text field in a form as in Lab 3. The text field can subsequently be accessed through a rather long name that queries the document about an element with a specified id.
You can use any image that you like -- pop stars, politicians and professors are popular -- but choose one that is not too big, perhaps using Photoshop or GIMP to crop or resize a big image into something smaller. Here's an example that places an image dog.jpg with its left side 200 pixels (“200px”) from the left side of the page and its top 100 pixels from the top of the page.
And this shows what it says after the game is played: You can make yours look more professional if you wish, by laying out the components anywhere and using any sizes, fonts, and colors that you like. You could add an image background with, and you could make the dialog at the end more expansive as well.
Each time the user successfully hits the image, the program must move the image to a new random place immediately (i.e., not wait for the current interval to end). The items are listed in this specification in the order in which it seems easiest to write the program.
Create your own HTML file lab6.html by downloading the template directly (right click in Windows, Option click in Mac) and then start replacing the commented parts by your own code, in the order suggested above. Copy and paste example code from the instructions, then modify it appropriately.
Declare Variables You will need variables for several values used by your program, including hit count for the number of times the image has been hit so far, speed for how long the image stays in one place, and start time for the time at which the current game started. So this line creates a new random x value, and sets the left coordinate of the image to that many pixels.
Thus, this line will move the image to a new random horizontal position each time the function move it() is called. You have to write the analogous line for the vertical position, and add it to move it().
That means that you have to attach an click event to the image (within the IMG tag that includes the image), and that event has to call function hit() to record the hit. If the count is 3, however, hit() should display a dialog box with the elapsed time and ask the user about another game.
Use alert statements to display results as computation proceeds, or just to verify that your program is going where you think it is. Add comments to your code to remind yourself of what some statement is doing, and perhaps to help the grader figure out what you had in mind as well.
You can also “comment out” alert statements by sticking // at the beginning of the line; this leaves the code there for future use, but it doesn't affect the program until you uncomment it. When we grade, we will be looking to see that your program works, that it's reasonably cleanly written (properly indented, for instance), and whether you did anything special to make it more than the bare minimum.