-rw-r--r-- | noncore/games/tictac/main.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/noncore/games/tictac/main.cpp b/noncore/games/tictac/main.cpp new file mode 100644 index 0000000..f2ab334 --- a/dev/null +++ b/noncore/games/tictac/main.cpp | |||
@@ -0,0 +1,31 @@ | |||
1 | /**************************************************************************** | ||
2 | ** $Id$ | ||
3 | ** | ||
4 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. | ||
5 | ** | ||
6 | ** This file is part of an example program for Qt. This example | ||
7 | ** program may be used, distributed and modified without limitation. | ||
8 | ** | ||
9 | *****************************************************************************/ | ||
10 | |||
11 | #include <qpe/qpeapplication.h> | ||
12 | #include <stdlib.h> | ||
13 | #include "tictac.h" | ||
14 | |||
15 | |||
16 | int main( int argc, char **argv ) | ||
17 | { | ||
18 | QPEApplication a( argc, argv ); | ||
19 | int n = 3; | ||
20 | if ( argc == 2 ) // get board size n | ||
21 | n = atoi(argv[1]); | ||
22 | if ( n < 3 || n > 10 ) { // out of range | ||
23 | qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] ); | ||
24 | return 1; | ||
25 | } | ||
26 | TicTacToe ttt( n ); // create game | ||
27 | a.setMainWidget( &ttt ); | ||
28 | ttt.setCaption("TicTac"); | ||
29 | ttt.show(); // show widget | ||
30 | return a.exec(); // go | ||
31 | } | ||