Tetris

Check-in [55ffe4a176]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove old debug code
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:55ffe4a176402d13a9954ef47927c8911ebf61dc8867e1c14c5237ba6cc54737
User & Date: ajv-899-334-8894@vsta.org 2017-05-23 20:31:49
Context
2017-12-16
04:40
Add a shape cheat check-in: e8cf031a4a user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-05-23
20:31
Remove old debug code check-in: 55ffe4a176 user: ajv-899-334-8894@vsta.org tags: master, trunk
2014-09-06
00:27
Document score doubling from clearing the play area Leaf check-in: 08f9a6b7a1 user: ajv-899-334-8894@vsta.org tags: REL1_1, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tetris.c.

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
...
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
 * play_game()
 *	Core game processing
 */
static void
play_game(void)
{
    int pos, c, downstep;
#ifdef DEBUG
    int drop_empty = 0;
#endif

    pos = A_FIRST*B_COLS + (B_COLS/2)-1;

    for (;;) {
	/* Display "shadow" of where piece would drop? */
	c = 0;
	if (showshadow) {
................................................................................

	/* Get command char or timeout */
	c = tgetchar();

	/* Move one downward? */
	downstep = ((c < 0) || (c == keys[6]));

#ifdef DEBUG
	/*
	 * Flag that when piece reaches bottom, act as
	 *  if playing area was cleared.
	 */
	if (c == '*') {
	    drop_empty = 1;
	}
#endif

	/* Timeout or explicit step downward */
	if (downstep) {
	    /*
	     * Timeout.  Move down if possible.
	     */
	    if (fits_in(curshape, pos + B_COLS)) {
		pos += B_COLS;
................................................................................
	    /*
	     * Put up the current shape `permanently',
	     * bump score, and elide any full rows.
	     */
	    place(curshape, pos, 2);
	    score++;
	    elide();
#ifdef DEBUG
	    /* Empty board */
	    if (drop_empty) {
		setup_board();
		drop_empty = 0;
	    }
#endif

	    /*
	     * If the playing area is brought back to emptiness,
	     *  double the score.
	     */
	    if (now_empty()) {
		v_victory();







<
<
<







 







<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<







179
180
181
182
183
184
185



186
187
188
189
190
191
192
...
211
212
213
214
215
216
217










218
219
220
221
222
223
224
...
228
229
230
231
232
233
234







235
236
237
238
239
240
241
 * play_game()
 *	Core game processing
 */
static void
play_game(void)
{
    int pos, c, downstep;




    pos = A_FIRST*B_COLS + (B_COLS/2)-1;

    for (;;) {
	/* Display "shadow" of where piece would drop? */
	c = 0;
	if (showshadow) {
................................................................................

	/* Get command char or timeout */
	c = tgetchar();

	/* Move one downward? */
	downstep = ((c < 0) || (c == keys[6]));











	/* Timeout or explicit step downward */
	if (downstep) {
	    /*
	     * Timeout.  Move down if possible.
	     */
	    if (fits_in(curshape, pos + B_COLS)) {
		pos += B_COLS;
................................................................................
	    /*
	     * Put up the current shape `permanently',
	     * bump score, and elide any full rows.
	     */
	    place(curshape, pos, 2);
	    score++;
	    elide();








	    /*
	     * If the playing area is brought back to emptiness,
	     *  double the score.
	     */
	    if (now_empty()) {
		v_victory();