Last active
August 29, 2015 14:28
-
-
Save asterwolf/b984353e2268aaa8075a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Tester program | |
* @author: Diego Diaz | |
* Created on: Aug 23, 2015 | |
* Source File: | |
*/ | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
//int numb[30]; | |
string bingo = "BINGO"; | |
string letter; | |
int loc = 0; | |
int numb; | |
srand (time(NULL)); | |
for(int row = 0; row < 6; row++){ | |
for(int col = 0; col < 5; col++){ | |
while(row == 0 && loc < 5){ | |
letter = bingo.substr(loc,1); | |
cout << "[" << letter << " " << "]"; | |
loc++; | |
} | |
numb = rand() % 100; | |
if(row != 0){ | |
if(numb < 10){ | |
cout << "[" << "0" << numb << "]"; | |
} | |
else if( row == 3 && col == 2){ | |
cout << "[" << "**" << "]"; | |
} | |
else{ | |
cout << "[" << numb << "]"; | |
} | |
} | |
} | |
cout<< endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Revision 3: The free spot was just an extra 2 or 3 lines of code and is now implemented in the code.
![screen shot 2015-08-24 at 1 03 07 am](https://cloud.githubusercontent.com/assets/7812814/9435353/eb466c26-49fb-11e5-9027-51f5b5b9c8fa.png)
next goal will be to check to make sure there are no repeating numbers on one bingo card.