From 448a2d9775cc42f55276b5ba663f0a7a0562e103 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 26 Feb 2023 16:39:54 -0800 Subject: [PATCH] fix 1989/tromp Makefile and remove old tromp.orig.c The 1989/tromp entry was missed using the processing of of the 1989 Makefile set. --- 1989/tromp/Makefile | 102 +--------------------------------------- 1989/tromp/README.md | 30 +++++------- 1989/tromp/tromp.orig.c | 19 -------- 3 files changed, 12 insertions(+), 139 deletions(-) delete mode 100644 1989/tromp/tromp.orig.c diff --git a/1989/tromp/Makefile b/1989/tromp/Makefile index 18d0eea92..e40a2116b 100644 --- a/1989/tromp/Makefile +++ b/1989/tromp/Makefile @@ -143,6 +143,7 @@ GENCAT= gencat GENSTRINGS= genstrings GETOPT= getopt GETOPTS= getopts +GINDENT= gindent GNUMAKE= gnumake GREP= grep GROFF= groff @@ -327,107 +328,6 @@ X11_LIBDIR= /opt/X11/lib #X11_INCDIR= /usr/X11/include X11_INCDIR= /opt/X11/include -# Compiler warnings -# -#CWARN= -#CWARN= -Wall -#CWARN= -Wall -Wextra -CWARN= -Wall -Wextra ${CSILENCE} -#CWARN= -Wall -Wextra -pedantic ${CSILENCE} -#CWARN= -Wall -Wextra -Weverything -#CWARN= -Wall -Wextra -Weverything -pedantic -#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE} - -# Silence warnings that ${CWARN} would normally complain about -# -CSILENCE= -Wno-error -Wno-implicit-function-declaration -Wno-pointer-to-int-cast \ - -Wno-no-return-type -Wno-builtin-requires-header -Wno-empty-body \ - -Wno-string-plus-int -Wno-return-type -Wno-unknown-warning-option -#CSILENCE= -Wno-implicit-int - -# Compiler standard -# -#CSTD= -#CSTD= -ansi -CSTD= -std=gnu89 - -# Compiler bit architecture -# -# Some entries require 32-bitness: -# ARCH= -m32 -# -# Some entries require 64-bitness: -# ARCH= -m64 -# -# By default we assume nothing: -# -ARCH= - -# Defines that are needed to compile -# -CDEFINE= -#CDEFINE= -DIOCCC=26 - -# Include files that are needed to compile -# -CINCLUDE= -#CINCLUDE= -include stdlib.h -#CINCLUDE= -include stdio.h -#CINCLUDE= -include stdlib.h -include stdio.h -#CINCLUDE= -I ${X11_INCDIR} -#CINCLUDE= -I ${HOMEBREW_PREFIX}/include/SDL2 - -# Optimization -# -# Most compiles will safely use -O2. Some can use only -O1 or -O. -# A few compilers have broken optimizers or this entry make break -# under those buggy optimizers and thus you may not want anything. -# Reasonable compilers will allow for -O3. -# -#OPT= -#OPT= -O -#OPT= -O1 -#OPT= -O2 -OPT= -O3 - -# default flags for ANSI C compilation -# -CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT} - -# Libraries needed to build -# -LIBS= -#LIBS= -lm -#LIBS= -L ${X11_LIBDIR} -lX11 -#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL - -# ANSI compiler -# -# Set CC to the name of your ANSI compiler. -# -# Some entries seem to need gcc. If you have gcc, set -# both CC and MAY_NEED_GCC to gcc. -# -# If you do not have gcc, set CC to the name of your ANSI compiler, and -# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just : -# to disable such programs. -# -CC= cc -#CC=clang -MAY_NEED_GCC= gcc - -# Set X11_LIBDIR to the directory where the X11 library resides -# -#X11_LIBDIR= /usr/X11R6/lib -#X11_LIBDIR= /usr/X11/lib -X11_LIBDIR= /opt/X11/lib - -# Set X11_INCLUDEDIR to the directory where the X11 include files reside -# -#X11_INCDIR= /usr/X11R6/include -#X11_INCDIR= /usr/X11/include -X11_INCDIR= /opt/X11/include - # Common C compiler warnings to silence # #CSILENCE= diff --git a/1989/tromp/README.md b/1989/tromp/README.md index 57313d5cb..f03b9040a 100644 --- a/1989/tromp/README.md +++ b/1989/tromp/README.md @@ -1,4 +1,4 @@ -Best game: +# Best game: John Tromp Centre for Mathematics and Computer Science (CWI) @@ -6,17 +6,20 @@ Best game: 1701CK Heerhugowaard Netherlands -Judges notes: +## To build: + + make all + +### To run + + ./tromp [drops_per_sec [cmd_string]] + +## Judges' comments This is a character terminal version of the TETRIS program. It runs on a VT100 compatible terminal or emulator. It is best used at 4800 baud or more. - Usage: - - tromp [drops_per_sec [cmd_string]] - tromp.s5 [1 [cmd_string]] - By default, "drops_per_sec", the number of times an object will drop in a second, is 2. The default "cmd_string" is "jkl pq". The first 6 characters of "cmd_string" relate @@ -34,21 +37,10 @@ Judges notes: prints the current score. To un-pause, type the pause character again, which by default is "p". - This original program requires a BSD-style interval timer and - and new BSD signal interface. If you are using System V.3 - or earlier, for example, you will need to make "tromp.s5" - instead of "tromp". You can change the default make rule - by changing "tromp" to "tromp.s5" in the "WINNERS=..." line - of the Makefile. - - The "tromp.s5" version is not as functional as "tromp". - The "drops_per_sec" is ignored and defaults to 1. The level - is always reported as 0. - As was stated last year, we are likely to be more strict about portability in the future. [ We mean it this time :-) ] -Selected notes from the author: +## Author's comments This program plays the familiar game of `TETRIS' with the following features: diff --git a/1989/tromp/tromp.orig.c b/1989/tromp/tromp.orig.c deleted file mode 100644 index 7e5b7fe9e..000000000 --- a/1989/tromp/tromp.orig.c +++ /dev/null @@ -1,19 +0,0 @@ -long h[4];E[80],S;t(){signal(14,t);if(S)longjmp(E,1);}c,d,l,v[]={(int)t,0,2}, -w,s,I,K=0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9 -,-1,1,12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13, -10,-12,1,12,11,-12,-1,1,2,-12,-1,12,13,-12,12,13,14,-11,-1,1,4,-13,-12,12,16,- -11,-12,12,17,-13,1,-1,5,-12,12,11,6,-12,12,24};u(){for(i=11;++i<264;)if((k=q[i -])-Q[i]){Q[i]=k;if(i-++I||i%12<1)printf("\033[%d;%dH",(I=i)/12,i%12*2+28); -printf("\033[%dm "+(K-k?0:5),k);K=k;}alarm(1);Q[263]=c=((S=1)&&!setjmp(E))? -getchar():-1;alarm(0);}G(b){for(i=4;i--;)if(q[i?b+n[i]:b])return 0;return 1;}g -(b){for(i=4;i--;q[i?x+n[i]:x]=b);}main(C,V,a)char**V,*a;{for(a=C>2?V[2]: -"jkl pq";i;i--)*n++=i<25||i%12<2?7:0;srand(getpid());system("stty raw -echo"); -signal(14,t);t();puts("\033[H\033[J");for(n=f+rand()%7*4;;g(7),u(),g(0)){if(c< -0){if(G(x+12))x+=12;else{g(7);++w;for(j=0;j<252;j=12*(j/12+1))for(;q[++j];)if( -j%12==10){for(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G -(x=17)||(c=a[5]);}}if(c==*a)G(--x)||++x;if(c==a[1])n=f+4**(m=n),G(x)||(n=m);if -(c==a[2])G(++x)||--x;if(c==a[3])for(;G(x+12);++w)x+=12;if(c==a[4]||c==a[5]){ -printf("\033[H\033[J\033[0m%d\n",w);if(c==a[5])break;for(j=264;j--;Q[j]=0); -while(getchar()-a[4]);puts("\033[H\033[J\033[7m");}}system("stty cooked echo") -;d=popen("cat - HI|sort -rn|sed -n 1,20p>/tmp/$$;mv /tmp/$$ HI;cat HI","w"); -fprintf(d,"%4d on level %1d by %s\n",w,l,getlogin());pclose(d);}