From bb0ede88697584bc7ea012844115669853657fdf Mon Sep 17 00:00:00 2001 From: cgd Date: Sat, 22 Apr 1995 08:34:18 +0000 Subject: clean up import, NetBSD RCS Ids, etc. --- snake/snscore/Makefile | 4 ++-- snake/snscore/snscore.c | 41 +++++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 20 deletions(-) (limited to 'snake/snscore') diff --git a/snake/snscore/Makefile b/snake/snscore/Makefile index 28768f32..08ebc767 100644 --- a/snake/snscore/Makefile +++ b/snake/snscore/Makefile @@ -1,5 +1,5 @@ -# from: @(#)Makefile 5.2 (Berkeley) 2/28/91 -# $Id: Makefile,v 1.2 1993/08/01 05:44:03 mycroft Exp $ +# $NetBSD: Makefile,v 1.3 1995/04/22 08:34:41 cgd Exp $ +# @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= snscore CFLAGS+=-I${.CURDIR}/../snake diff --git a/snake/snscore/snscore.c b/snake/snscore/snscore.c index 6b8c2e4e..8ad6b59a 100644 --- a/snake/snscore/snscore.c +++ b/snake/snscore/snscore.c @@ -1,6 +1,8 @@ +/* $NetBSD: snscore.c,v 1.4 1995/04/22 08:34:43 cgd Exp $ */ + /* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,14 +34,17 @@ */ #ifndef lint -char copyright[] = -"@(#) Copyright (c) 1980 Regents of the University of California.\n\ - All rights reserved.\n"; +static char copyright[] = +"@(#) Copyright (c) 1980, 1993\n\ + The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -/*static char sccsid[] = "from: @(#)snscore.c 5.7 (Berkeley) 2/28/91";*/ -static char rcsid[] = "$Id: snscore.c,v 1.3 1994/04/05 00:42:49 cgd Exp $"; +#if 0 +static char sccsid[] = "@(#)snscore.c 8.1 (Berkeley) 7/19/93"; +#else +static char rcsid[] = "$NetBSD: snscore.c,v 1.4 1995/04/22 08:34:43 cgd Exp $"; +#endif #endif /* not lint */ #include @@ -57,9 +62,9 @@ struct player { char *name; } players[MAXPLAYERS], temp; +int main() { - char buf[80], cp; short uid, score; FILE *fd; int noplayers; @@ -77,7 +82,7 @@ main() fread(&whoallbest, sizeof(short), 1, fd); fread(&allbest, sizeof(short), 1, fd); noplayers = 0; - for (uid=2;;uid++) { + for (uid = 2; ;uid++) { if(fread(&score, sizeof(short), 1, fd) == 0) break; if (score > 0) { @@ -91,29 +96,29 @@ main() if (p == NULL) continue; q = p -> pw_name; - players[noplayers].name = malloc(strlen(q)+1); + players[noplayers].name = malloc(strlen(q) + 1); strcpy(players[noplayers].name, q); noplayers++; } } /* bubble sort scores */ - for (notsorted=1; notsorted; ) { + for (notsorted = 1; notsorted; ) { notsorted = 0; - for (i=0; i players[i+1].scores) - j = i+2; + if (players[i].scores > players[i + 1].scores) + j = i + 2; } exit(0); } -- cgit v1.2.3-56-ge451