Skip to content

Instantly share code, notes, and snippets.

@asterwolf
Last active August 29, 2015 14:28
Show Gist options
  • Save asterwolf/b984353e2268aaa8075a to your computer and use it in GitHub Desktop.
Save asterwolf/b984353e2268aaa8075a to your computer and use it in GitHub Desktop.
/*
* 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;
}
}
@asterwolf
Copy link
Author

screen shot 2015-08-24 at 12 35 56 am

@asterwolf
Copy link
Author

I will put in the free spot tomorrow! For now here's what it looks like.

@asterwolf
Copy link
Author

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

next goal will be to check to make sure there are no repeating numbers on one bingo card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment