author | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
commit | e16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (unidiff) | |
tree | 9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/games/buzzword | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | noncore/games/buzzword/buzzword.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/buzzword/buzzword.cpp b/noncore/games/buzzword/buzzword.cpp index b870a59..97a17a1 100644 --- a/noncore/games/buzzword/buzzword.cpp +++ b/noncore/games/buzzword/buzzword.cpp | |||
@@ -81,49 +81,49 @@ BuzzWord::BuzzWord() : QMainWindow(0) | |||
81 | grid = NULL; | 81 | grid = NULL; |
82 | gameOver = false; | 82 | gameOver = false; |
83 | newGame(); | 83 | newGame(); |
84 | } | 84 | } |
85 | 85 | ||
86 | void BuzzWord::drawGrid() | 86 | void BuzzWord::drawGrid() |
87 | { | 87 | { |
88 | QStringList l; | 88 | QStringList l; |
89 | 89 | ||
90 | QString path = QPEApplication::qpeDir()+"share/buzzword/"; | 90 | QString path = QPEApplication::qpeDir()+"share/buzzword/"; |
91 | QFile f( path + "buzzwords" ); | 91 | QFile f( path + "buzzwords" ); |
92 | if ( !f.open( IO_ReadOnly ) ) | 92 | if ( !f.open( IO_ReadOnly ) ) |
93 | return; | 93 | return; |
94 | 94 | ||
95 | QTextStream t( &f ); | 95 | QTextStream t( &f ); |
96 | 96 | ||
97 | while (!t.atEnd()) | 97 | while (!t.atEnd()) |
98 | { | 98 | { |
99 | l << t.readLine(); | 99 | l << t.readLine(); |
100 | } | 100 | } |
101 | 101 | ||
102 | f.close(); | 102 | f.close(); |
103 | 103 | ||
104 | grid = new QGrid(gridVal, this); | 104 | grid = new QGrid(gridVal, this); |
105 | grid->setFixedSize(240,240); | 105 | //grid->setFixedSize( 480, 480 ); |
106 | 106 | ||
107 | for( int c = 0 ; c < gridVal ; c++ ) | 107 | for( int c = 0 ; c < gridVal ; c++ ) |
108 | { | 108 | { |
109 | for( int r = 0 ; r < gridVal ; r++ ) | 109 | for( int r = 0 ; r < gridVal ; r++ ) |
110 | { | 110 | { |
111 | uint pos = rand() % l. count(); | 111 | uint pos = rand() % l. count(); |
112 | 112 | ||
113 | QString word = QStringList::split(" ", l[pos]).join("\n"); | 113 | QString word = QStringList::split(" ", l[pos]).join("\n"); |
114 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); | 114 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); |
115 | connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); | 115 | connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); |
116 | map[c][r] = 0; | 116 | map[c][r] = 0; |
117 | 117 | ||
118 | l.remove( l.at( pos )); | 118 | l.remove( l.at( pos )); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | void BuzzWord::clicked(int row, int column) | 123 | void BuzzWord::clicked(int row, int column) |
124 | { | 124 | { |
125 | if ( ! gameOver ) | 125 | if ( ! gameOver ) |
126 | { | 126 | { |
127 | int rowTotal = 0; | 127 | int rowTotal = 0; |
128 | int columnTotal = 0; | 128 | int columnTotal = 0; |
129 | 129 | ||