final project virtual slot machine n.
Skip this Video
Loading SlideShow in 5 Seconds..
Final Project Virtual Slot Machine. PowerPoint Presentation
Download Presentation
Final Project Virtual Slot Machine.

Loading in 2 Seconds...

play fullscreen
1 / 18

Final Project Virtual Slot Machine. - PowerPoint PPT Presentation

  • Uploaded on

Final Project Virtual Slot Machine. By: Bander Alrogi Khaled Al Nuaimi Mohammed Almajhad Metaib Al-Enzai Course Title: ECE 2552 Instructor: Dr Kepuska Spring 2005. Concepts Used. Classes Inheritance Abstract Class Graphic Mode and Objects Sound Function. Objective.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Final Project Virtual Slot Machine.' - rafi

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
final project virtual slot machine

Final ProjectVirtual Slot Machine.

By: Bander Alrogi Khaled Al Nuaimi Mohammed Almajhad Metaib Al-Enzai

Course Title: ECE 2552

Instructor: Dr Kepuska

Spring 2005

concepts used
Concepts Used
  • Classes
  • Inheritance
  • Abstract Class
  • Graphic Mode and Objects
  • Sound Function
  • To create a program that is a simulation of a Virtual Slot Machine used specially for gambling. Color shapes appear in a window, as if slot machine wheels were turning.

When we start the program, three square windows appear on the screen. One of four different shapes appears randomly in each window. Red circle (apple), blue circle (blueberry), square, and pyramid. Each time a shape appears, a click sound is heard. Gradually, the shapes appear more and more slowly, as if the slot machine wheel were slowing down. Finally they stop, and the program sounds a two-tone signal. If the three shapes are same, you win otherwise you lost.

class hierarchy
Class Hierarchy





No Shape






  • Display Points, Lines, and Shapes
  • Address individual pixels and dots
  • Resolution of 640*480 VGA mode can address 307,200 pixels
  • initgraph() Function:

It must be executed before any other graphic mode function can be used. It switches your computer’s display system into the appropriate graphics mode. Uses Graphic.h header file

  • Graphics Driver

To specify the mode, we need to choose appropriate values for the parameters to initgraph().

  • Graphics Mode

Specify the specific mode to be used. For example CGA, EGA, VGA,….

  • Driver = DETECT

Let the system decide what graphic mode to use, it checks the adaptor and choose the driver and mode that gives the highest resolution. Set the driver argument to the constant DETECT.


initgraph(&drive, &mode, "c:\\tc\\bgi");

  • Address of Operator: &

Instead of using like EGA and EGAHI, we placed them in variables driver and mode. & Symbol address where the constants are stored.


initgraph(&drive, &mode, "c:\\tc\\bgi");

  • Path:

It’s the path to the graphic driver. This argument must be specified whether you use auto-detect or specify a mode yourself.



  • When exit from the graphics program, we should restore the system to the video mode that was previously in use.
sound generation
Sound Generation

Sound Generation requires three steps

  • Turning the sound on
  • Delaying for an appropriate amount of time
  • Turning the sound off
sound generation1
Sound Generation
  • Sound() function

It sets the sound generation to a specific frequency in Hertz. The range of the frequency varies from 15 Hertz to 3000 Hertz. Once this function is executed, the sound remains on until specifically stopped.

sound generation2
Sound Generation
  • Delay() function

Function to control how long the sound will continue. It takes simple argument in milliseconds.

  • Nosound() function

Takes no argument and it turn off the sound.

drawing shapes
Drawing Shapes
  • Circle

It takes the (x, y) co-ordinates and radius as parameters to draw it

circle (x, y, radius);

drawing shapes1
Drawing Shapes
  • Rectangle

It takes the top-left co-ordinates and the right-bottom co-ordinates as parameters to draw it

rectangle (x1, y1, x2, y2);

drawing shapes2
Drawing Shapes
  • Triangle

Fillpoly function draws and fill a polygon. It takes 2 input arguments. Number of points, and the points to a sequence of (numpoint * 2). Each pair of integers gives x and y co-ordinates of a point on the polygon.

triangle[] = {x1, y1, x2, y2, x3, y3};

fillpoly (3, triangle[]);