author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/games/buzzword/buzzword.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/games/buzzword/buzzword.cpp') (more/less context) (ignore whitespace changes)
-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 13eb481..b7f2573 100644 --- a/noncore/games/buzzword/buzzword.cpp +++ b/noncore/games/buzzword/buzzword.cpp | |||
@@ -90,49 +90,49 @@ void BuzzWord::drawGrid() | |||
90 | QFile f( path + "buzzwords" ); | 90 | QFile f( path + "buzzwords" ); |
91 | if ( !f.open( IO_ReadOnly ) ) | 91 | if ( !f.open( IO_ReadOnly ) ) |
92 | return; | 92 | return; |
93 | 93 | ||
94 | QTextStream t( &f ); | 94 | QTextStream t( &f ); |
95 | 95 | ||
96 | while (!t.atEnd()) | 96 | while (!t.atEnd()) |
97 | { | 97 | { |
98 | l << t.readLine(); | 98 | l << t.readLine(); |
99 | } | 99 | } |
100 | 100 | ||
101 | f.close(); | 101 | f.close(); |
102 | 102 | ||
103 | grid = new QGrid(gridVal, this); | 103 | grid = new QGrid(gridVal, this); |
104 | //grid->setFixedSize( 480, 480 ); | 104 | //grid->setFixedSize( 480, 480 ); |
105 | 105 | ||
106 | for( int c = 0 ; c < gridVal ; c++ ) | 106 | for( int c = 0 ; c < gridVal ; c++ ) |
107 | { | 107 | { |
108 | for( int r = 0 ; r < gridVal ; r++ ) | 108 | for( int r = 0 ; r < gridVal ; r++ ) |
109 | { | 109 | { |
110 | uint pos = rand() % l. count(); | 110 | uint pos = rand() % l. count(); |
111 | 111 | ||
112 | QString word = QStringList::split(" ", l[pos]).join("\n"); | 112 | QString word = QStringList::split(" ", l[pos]).join("\n"); |
113 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); | 113 | BuzzItem* bi = new BuzzItem( c, r, word, grid ); |
114 | connect( bi, SIGNAL(clicked(int, int)), this, SLOT(clicked(int,int)) ); | 114 | connect( bi, SIGNAL(clicked(int,int)), this, SLOT(clicked(int,int)) ); |
115 | map[c][r] = 0; | 115 | map[c][r] = 0; |
116 | 116 | ||
117 | l.remove( l.at( pos )); | 117 | l.remove( l.at( pos )); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | void BuzzWord::clicked(int row, int column) | 122 | void BuzzWord::clicked(int row, int column) |
123 | { | 123 | { |
124 | if ( ! gameOver ) | 124 | if ( ! gameOver ) |
125 | { | 125 | { |
126 | int rowTotal = 0; | 126 | int rowTotal = 0; |
127 | int columnTotal = 0; | 127 | int columnTotal = 0; |
128 | 128 | ||
129 | map[column][row] = 1; | 129 | map[column][row] = 1; |
130 | 130 | ||
131 | for( int c = 0 ; c < gridVal ; c++ ) | 131 | for( int c = 0 ; c < gridVal ; c++ ) |
132 | { | 132 | { |
133 | for( int r = 0 ; r < gridVal ; r++ ) | 133 | for( int r = 0 ; r < gridVal ; r++ ) |
134 | { | 134 | { |
135 | if ( map[c][r] == 1 ) | 135 | if ( map[c][r] == 1 ) |
136 | rowTotal++; | 136 | rowTotal++; |
137 | 137 | ||
138 | if ( rowTotal == 4 ) | 138 | if ( rowTotal == 4 ) |