-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
30 lines (25 loc) · 814 Bytes
/
main.cpp
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
/**
* CSE 100 C++ Boggle
* Authors: Vivek Ramavajjala, Paul Kube
*/
#include <QtWidgets/QApplication>
#include "mainwindow.h"
static const char* DEFAULTLEXFILENAME = "boglex.txt";
static unsigned int DEFAULTMINWORDLENGTH = 4;
static unsigned int DEFAULTROWS = 4;
static unsigned int DEFAULTCOLS = 4;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
const char* lexfilename = DEFAULTLEXFILENAME;
unsigned int rows = DEFAULTROWS;
unsigned int cols = DEFAULTCOLS;
unsigned int minwordlength = DEFAULTMINWORDLENGTH;
if(argc > 1) lexfilename = argv[1];
if(argc > 2) minwordlength = atoi(argv[4]);
if(argc > 3) rows = atoi(argv[2]);
if(argc > 4) cols = atoi(argv[3]);
MainWindow w(lexfilename,rows,cols,minwordlength);
w.show();
return a.exec();
}