home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume15
/
gtetris
/
part02
/
tscores.c
< prev
Wrap
C/C++ Source or Header
|
1993-01-27
|
1KB
|
54 lines
/*
# GENERIC X-WINDOW-BASED TETRIS
#
# tscores.c
#
###
#
# Copyright (C) 1992 Qiang Alex Zhao
# Computer Science Dept, University of Arizona
# azhao@cs.arizona.edu
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and
# that both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of the author not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# This program is distributed in the hope that it will be "playable",
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
*/
#include "tetris.h"
void
main()
{
int fd, i;
score_t curs;
fprintf(stderr, "\tGENERIC TETRIS HALL OF FAME\n\n");
fd = open(SCOREFILE, O_RDONLY, 0644);
if (fd == -1)
return;
i = 0;
fprintf(stderr, " # USER SCORE L R HOST DATE\n");
while (read(fd, (char *) &curs, SCORELEN) == SCORELEN) {
i++;
fprintf(stderr, "%4d %-12s%9s %3s %4s %-12s %-s", i,
curs.myname, curs.score, curs.level, curs.lines,
curs.myhost, curs.mytime);
}
close(fd);
fprintf(stderr, "There are %d scores to date\n", i);
}