Example Code

Slot Machine using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW
  • Other

Code and Documents

Attachment

Overview
This example VI demonstrates how to create a slot machine simulation in LabVIEW. 


Description
In LabVIEW you are able to generate random numbers and manipulate them in order to simulate a slot machine. The three random numbers are multiplied and rounded in order to obtain integers from 0 to 4, corresponding to a ring of five images representing the possible outcomes of the slot machine. Custom images are used to represent the output of the slot machine. 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached files to your computer
  2. Open the VI "Slot Machine LV2012 NI Verified.vi"
  3. Run the program

 

Additional Information or References

VI Block Diagram

 

Gambling Machine LV2012 NI Verified.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.