Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Edge detection wikipedia , lookup
Anaglyph 3D wikipedia , lookup
Tektronix 4010 wikipedia , lookup
3D television wikipedia , lookup
Indexed color wikipedia , lookup
BSAVE (bitmap format) wikipedia , lookup
Spatial anti-aliasing wikipedia , lookup
Hold-And-Modify wikipedia , lookup
Image editing wikipedia , lookup
Dice Display Student Project ABILITY LEVEL: Beginner APPROXIMATE COMPLETION TIME: 1 hour OBJECTIVES: Understand and use string functions Understand and use mathematical functions OVERVIEW OF PROJECT: Many games depend on the roll of a pair of dice. The object of this program is to simulate the roll of dice. The program will display dice images showing the value of dice values. The project assumes standard six sided dice but can be expanded to other sizes if desired. PROJECT INSTRUCTIONS: 1. Create a form with two picture boxes and two command buttons. 2. Set the picture box properties so that it scales to the size of the image 3. Set the text property of one button to Exit and write code so that the program terminates when the button is pushed. 4. Set the text property of the second button to “Roll” and write code so that pictures of dice in each picture box ADDITIONAL RESOURCES: Textbook SUGGESTED SOLUTION: Use the Rnd method and a formula to pick a random number between one and six. Use that number to build the name of a gif image file and use Image.FromFile method to display that image in a picture box. Do this for each picture box in the form when the display dice button is clicked. Place each die image inside the bin/debug folder SAMPLE CODE Dim randomDie As Integer = random number between 1 and 6 Dim newDie As String = "die" + randomDie.ToString() + ".gif" picDice1.Image = Image.FromFile(newDie) PROJECT EXTRAS: Display more then two dice. Display the total of the dice in a label box. Create and use your own die images.