diff -rc orig/header.h mine/header.h *** orig/header.h Wed Apr 7 02:43:45 1993 --- mine/header.h Thu Jan 20 20:21:53 2000 *************** *** 29,35 **** #define MAXCOLUMN 13 /* The number of high scores that are kept. */ ! #define MAXHIGHSCORES 500 /* The maximum length of the user defined name. * The user can set his hextris playing name by setting the * environment variable XHEXNAME, like this: --- 29,35 ---- #define MAXCOLUMN 13 /* The number of high scores that are kept. */ ! #define MAXHIGHSCORES 50 /* The maximum length of the user defined name. * The user can set his hextris playing name by setting the * environment variable XHEXNAME, like this: *************** *** 41,47 **** #define MAXUSERIDLENGTH 40 /* The maximum nuber of high scores a user can have in the high score file. */ ! #define MAXUSERHIGHS 3 /* The number of pieces in the game. DON'T CHANGE!!! */ #define NUMBEROFPIECES 10 --- 41,47 ---- #define MAXUSERIDLENGTH 40 /* The maximum nuber of high scores a user can have in the high score file. */ ! #define MAXUSERHIGHS 10 /* The number of pieces in the game. DON'T CHANGE!!! */ #define NUMBEROFPIECES 10 diff -rc orig/stdsys.c mine/stdsys.c *** orig/stdsys.c Wed Apr 7 03:21:20 1993 --- mine/stdsys.c Thu Jan 20 20:42:19 2000 *************** *** 28,71 **** #include #include "header.h" - /* The function reverse is not copyrighted. - * - * This is a standard string reverse routine. - */ - reverse(s) - char *s; - { - int c,i,j; - - for (i = 0, j = strlen(s)-1; i < j; i++,j--) { - c = s[i]; - s[i] = s[j]; - s[j] = c; - } - } - - /* The function itoa is not copyrighted. - * - * This is a standard integer to string converter. - */ - itoa(n,s) - int n; - char *s; - { - int i, sign; - - if ((sign = n) < 0) - n = -n; - i = 0; - do { - s[i++] = n % 10 + '0'; - } while ((n /= 10) > 0); - if (sign < 0) - s[i++] = '-'; - s[i] = '\0'; - reverse(s); - } - /* This randomly selects the next piece. It also selects the current * piece, if it has not yet been set (rotation = -1). */ --- 28,33 ---- *************** *** 153,161 **** high_score_file); fwrite(high_scores[i].userid,sizeof(char),MAXUSERIDLENGTH, high_score_file); ! itoa(high_scores[i].score,buffer); fwrite(buffer,sizeof(char),40,high_score_file); ! itoa(high_scores[i].rows,buffer); fwrite(buffer,sizeof(char),40,high_score_file); } fflush(high_score_file); --- 115,123 ---- high_score_file); fwrite(high_scores[i].userid,sizeof(char),MAXUSERIDLENGTH, high_score_file); ! sprintf (buffer, "%d", high_scores[i].score); fwrite(buffer,sizeof(char),40,high_score_file); ! sprintf (buffer, "%d", high_scores[i].rows); fwrite(buffer,sizeof(char),40,high_score_file); } fflush(high_score_file); diff -rc orig/xio.c mine/xio.c *** orig/xio.c Wed Apr 7 03:11:23 1993 --- mine/xio.c Thu Jan 20 20:55:45 2000 *************** *** 483,489 **** high_score_t high_scores[MAXHIGHSCORES]; { int y_offset, i; ! static int x_offset[5] = {5,30,150,200,300}; static char *header[] = {"#","Name","UID","Score","Rows"}; char message[40]; --- 483,489 ---- high_score_t high_scores[MAXHIGHSCORES]; { int y_offset, i; ! static int x_offset[5] = {5,30,150,230,330}; static char *header[] = {"#","Name","UID","Score","Rows"}; char message[40]; *************** *** 495,512 **** header[i],strlen(header[i])); y_offset = 60; for (i = 0; i < ((MAXHIGHSCORES > 40) ? 30 : MAXHIGHSCORES); i++) { ! itoa(i+1,message); XDrawString(display, win, gc, x_offset[0], y_offset+(i*17), message,strlen(message)); XDrawString(display, win, gc, x_offset[1], y_offset+(i*17), high_scores[i].name,strlen(high_scores[i].name)); ! strncpy(message, high_scores[i].userid, 5); XDrawString(display, win, gc, x_offset[2], y_offset+(i*17), message, strlen(message)); ! itoa(high_scores[i].score,message); XDrawString(display, win, gc, x_offset[3], y_offset+(i*17), message,strlen(message)); ! itoa(high_scores[i].rows,message); XDrawString(display, win, gc, x_offset[4], y_offset+(i*17), message,strlen(message)); } --- 495,513 ---- header[i],strlen(header[i])); y_offset = 60; for (i = 0; i < ((MAXHIGHSCORES > 40) ? 30 : MAXHIGHSCORES); i++) { ! sprintf (message, "%d", i+1); XDrawString(display, win, gc, x_offset[0], y_offset+(i*17), message,strlen(message)); XDrawString(display, win, gc, x_offset[1], y_offset+(i*17), high_scores[i].name,strlen(high_scores[i].name)); ! strncpy(message, high_scores[i].userid, 8); ! message[8] = '\0'; XDrawString(display, win, gc, x_offset[2], y_offset+(i*17), message, strlen(message)); ! sprintf (message, "%d", high_scores[i].score); XDrawString(display, win, gc, x_offset[3], y_offset+(i*17), message,strlen(message)); ! sprintf (message, "%d", high_scores[i].rows); XDrawString(display, win, gc, x_offset[4], y_offset+(i*17), message,strlen(message)); }