Home | History | Annotate | Download | only in tetris

Lines Matching defs:scores

1 /*	$NetBSD: scores.c,v 1.26 2021/05/02 12:50:46 rillig Exp $	*/
34 * @(#)scores.c 8.1 (Berkeley) 5/31/93
58 #include "scores.h"
62 * Allow updating the high scores unless we're built as part of /rescue.
73 * As long as the scores are kept sorted, this is simply the first one at
82 static struct highscore scores[NUMSPOTS];
302 readname(scores[i].hs_name, sizeof(scores[i].hs_name),
304 scores[i].hs_score = read32(buf[i].hso_score, doflip);
305 scores[i].hs_level = read32(buf[i].hso_level, doflip);
306 scores[i].hs_time = read64(buf[i].hso_time, doflip);
329 readname(scores[i].hs_name, sizeof(scores[i].hs_name),
331 scores[i].hs_score = read32(buf[i].hso599_score, doflip);
332 scores[i].hs_level = read32(buf[i].hso599_level, doflip);
337 scores[i].hs_time =
362 readname(scores[i].hs_name, sizeof(scores[i].hs_name),
364 scores[i].hs_score = read32(buf[i].hso50_score, doflip);
365 scores[i].hs_level = read32(buf[i].hso50_level, doflip);
366 scores[i].hs_time = read32(buf[i].hso50_time, doflip);
467 * and start over with empty scores.
482 /* Empty file; that just means there are no scores. */
614 memcpy(buf[i].hso_name, scores[i].hs_name,
616 buf[i].hso_score = scores[i].hs_score;
617 buf[i].hso_level = scores[i].hs_level;
619 buf[i].hso_time = scores[i].hs_time;
633 warnx("high scores may be damaged");
650 * Read and update the scores file with the current reults.
672 for (i = 0, sp = &scores[0]; i < nscores; i++, sp++) {
701 * Sort & clean the scores, then rewrite.
703 nscores = checkscores(scores, nscores);
719 static char u[sizeof(scores[0].hs_name)];
742 * If two scores are equal, the person who had the score first is
770 * only allowed the highest score. Scores older than EXPIRATION seconds are
841 * Show current scores. This must be called after savescore, if
857 (void)printf("\n\t\t\t Tetris High Scores\n");
861 * the high scores; we do not need to check for printing in highlight
871 for (i = 0, sp = scores; i < nscores; i++, sp++) {
883 * Page each screenful of scores.
885 for (i = 0, sp = scores; i < nscores; sp += n) {