1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include <cstdlib> // random numbers header file//
#include <ctime> // used to get date and time information
#include <conio.h>//used to read and validate input
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <iostream>
using namespace std;
int money = 10;//global variable used to keep track of money
int main()
{
char First[5][3] = // initialise array to grid
{
{ 'A','A','A' }, // row 0
{ 'B','B','B' }, // row 1
{ 'C','C','C' }, // row 2
{ 'D','D','D' }, // row 3
{ 'E','E','E' }, // row 4
};
cout << "Welcome to the Machine Money Count:"<<money << endl;
cout << " Press 1 to spin"<<endl;
int answer = 0;
//1.0 Display Contents of 2d array
for (int i = 0; i < 5; i++)
{
cout << First[i][1] <<First[i][2]<< First[i][3]<<"\r";
//outputs slot machine board using 2d array contents
}
|