Rename wrongly named author/winner handles
There were many files renamed in this commit and I hope I got all the references to the old names changed to the new names. To explain this commit there were some older entries that had the wrong directory name: not the surname but something else. Very possibly there are other directories that need to be renamed and I am actually aware of one right now but since it's in 2005 (which is close to being worked on) I am not changing that now but just noting it: 2005/anon should be changed to 2005/anonymous (unless there's a very good reason I am unaware of). But like I said since 2005 will be worked on soon I have not touched it. The Makefiles, .gitignore, the all/summary.txt, years.html and winners.html files as well as the directories and the files under the renamed directories have all been updated. This is a rather big update and it might be that there are conflicts. If so I will fix them. I will have to update 2005/anon later on to try and prevent this from happening but very possibly there will be conflicts here. It's also possible I missed some changes in years.html and/or winners.html and/or summary/all.txt but I think I got them all. These should be verified later on.
This commit is contained in:
1 parent
9e540136d1
commit
ad04d21fda
52 files changed
+163
-162
No files matched your search
@@ -1,12 +0,0 @@
|
||||
adbasename
|
||||
adbasename.c
|
||||
adecho
|
||||
adecho.c
|
||||
adgrep
|
||||
adhead
|
||||
adhead.c
|
||||
adrian
|
||||
adsleep
|
||||
adsleep.c
|
||||
adwc
|
||||
adwc.c
|
||||
@@ -1,355 +0,0 @@
|
||||
#!/usr/bin/env make
|
||||
#
|
||||
# IOCCC 1992 winning entry - adrian
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Regarding individual entries:
|
||||
#
|
||||
# IOCCC winning entry code may not work on your system. Even with standards,
|
||||
# conditions and build environments change, especially when it comes to more
|
||||
# extreme code such you might find in an IOCCC winner. Moreover, what was
|
||||
# allowed and liked in one IOCCC contest may no longer be liked/allowed in
|
||||
# later IOCCC years.
|
||||
#
|
||||
# Corrections on winning author and fixing typos in remarks are VERY WELCOME.
|
||||
#
|
||||
# GitHub pull requests are welcome:
|
||||
#
|
||||
# If you have a patch that might make running an entry work in modern Unix-like
|
||||
# environments, please create a GitHub pull request for the IOCCC judges to
|
||||
# consider.
|
||||
#
|
||||
# Suggestions and corrections regarding Makefiles, winning author information,
|
||||
# fixing typos in remarks, and code patches are welcome via opening a GitHub
|
||||
# issue or better yet, by creating a GitHub pull request for the IOCCC judges
|
||||
# to consider. To form a GitHub issue or GitHub pull, please visit:
|
||||
#
|
||||
# https://github.com/ioccc-src/winner
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# This work by Landon Curt Noll and Leonid A. Broukhis is licensed under:
|
||||
#
|
||||
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
#
|
||||
# See: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
|
||||
#############################
|
||||
# shell used by this Makefile
|
||||
#############################
|
||||
#
|
||||
SHELL= bash
|
||||
|
||||
#######################
|
||||
# common tool locations
|
||||
#######################
|
||||
include ../../var.mk
|
||||
#
|
||||
|
||||
# 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=
|
||||
CSILENCE= -Wno-bitwise-op-parentheses -Wno-comment -Wno-deprecated-declarations \
|
||||
-Wno-error -Wno-implicit-function-declaration -Wno-format-security \
|
||||
-Wno-logical-op-parentheses -Wno-macro-redefined -Wno-parentheses \
|
||||
-Wno-return-type -Wno-uninitialized -Wno-unused-value -Wno-unused-variable \
|
||||
-Wno-unused-but-set-variable -Wno-unsequenced -Wno-unused-parameter
|
||||
|
||||
# Common C compiler warning flags
|
||||
#
|
||||
#CWARN= ${CSILENCE}
|
||||
#CWARN= -Wall ${CSILENCE}
|
||||
#CWARN= -Wall -Wextra ${CSILENCE}
|
||||
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
|
||||
|
||||
# Compiler standard
|
||||
#
|
||||
#CSTD=
|
||||
#CSTD= -ansi
|
||||
CSTD= -std=gnu90
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# C compiler to use
|
||||
#
|
||||
CC= cc
|
||||
#CC=clang
|
||||
#CC=gcc
|
||||
|
||||
# Compiler add-ons or replacements for clang only
|
||||
#
|
||||
ifeq ($(CC),clang)
|
||||
#
|
||||
CSILENCE+= -Wno-comma -Wno-float-conversion -Wno-missing-noreturn \
|
||||
-Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded \
|
||||
-Wno-poison-system-directories -Wno-shadow -Wno-unreachable-code \
|
||||
-Wno-unused-macros
|
||||
#
|
||||
CWARN+= -Weverything
|
||||
#
|
||||
endif
|
||||
|
||||
# Specific add-ons or replacements for gcc only
|
||||
#
|
||||
ifeq ($(CC),gcc)
|
||||
#
|
||||
#CSILENCE+=
|
||||
#
|
||||
#CWARN+=
|
||||
#
|
||||
endif
|
||||
|
||||
|
||||
##############################
|
||||
# Special flags for this entry
|
||||
##############################
|
||||
#
|
||||
ENTRY= adrian
|
||||
PROG= ${ENTRY}
|
||||
#
|
||||
OBJ= ${PROG}.o
|
||||
DATA=
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
|
||||
|
||||
#################
|
||||
# build the entry
|
||||
#################
|
||||
#
|
||||
all: data ${TARGET}
|
||||
@${TRUE}
|
||||
|
||||
.PHONY: all alt data everything clean clobber install \
|
||||
love haste waste maker easter_egg sandwich \
|
||||
supernova deep_magic magic charon pluto
|
||||
|
||||
${PROG}: ${PROG}.c
|
||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||
${RM} -f ad.temp adwc.c adbasename.c adecho.c adhead.c adsleep.c
|
||||
${SED} '1s/\..*\./. wc ./' adrian.c > ad.temp
|
||||
-./adrian ad.temp <ad.temp >adwc.c
|
||||
${CC} ${CFLAGS} -o adwc adwc.c
|
||||
${SED} '1s/\..*\./. basename ./' adrian.c > ad.temp
|
||||
-./adrian ad.temp <ad.temp >adbasename.c
|
||||
${CC} ${CFLAGS} -o adbasename adbasename.c
|
||||
${SED} '1s/\..*\./. echo| ./' adrian.c > ad.temp
|
||||
-./adrian ad.temp <ad.temp >adecho.c
|
||||
${CC} ${CFLAGS} -o adecho adecho.c
|
||||
${SED} '1s/\..*\./. head; ./' adrian.c > ad.temp
|
||||
-./adrian ad.temp <ad.temp >adhead.c
|
||||
${CC} ${CFLAGS} -o adhead adhead.c
|
||||
${SED} '1s/\..*\./. sleep ./' adrian.c > ad.temp
|
||||
-./adrian ad.temp <ad.temp >adsleep.c
|
||||
${CC} ${CFLAGS} -o adsleep adsleep.c
|
||||
${RM} -f ad.temp
|
||||
|
||||
adgrep: ${PROG}
|
||||
${RM} -f $@
|
||||
${LN} $< $@
|
||||
|
||||
# alternative executable
|
||||
#
|
||||
alt: data ${ALT_TARGET}
|
||||
@${TRUE}
|
||||
|
||||
# data files
|
||||
#
|
||||
data: ${DATA}
|
||||
@${TRUE}
|
||||
|
||||
# both all and alt
|
||||
#
|
||||
everything: all alt
|
||||
|
||||
|
||||
###############
|
||||
# utility rules
|
||||
###############
|
||||
#
|
||||
clean:
|
||||
${RM} -f ${OBJ} ${ALT_OBJ}
|
||||
@-if [ -f indent.c ]; then \
|
||||
echo ${RM} -f indent.c; \
|
||||
${RM} -f indent.c; \
|
||||
fi
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||
${RM} -f adbasename adbasename.c adecho adecho.c adgrep adhead
|
||||
${RM} -f adhead.c adrian adsleep adsleep.c adwc adwc.c
|
||||
@-if [ -e sandwich ]; then \
|
||||
${RM} -f sandwich; \
|
||||
echo 'ate sandwich'; \
|
||||
fi
|
||||
|
||||
install:
|
||||
@echo "Dr. Spock says that is not logical!"
|
||||
@${TRUE}
|
||||
|
||||
# you may be able to misunderstand the source by reading indent.c
|
||||
#
|
||||
indent.c: ${PROG}.c
|
||||
@if which "${GINDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${GINDENT} < $< > $@"; \
|
||||
${GINDENT} < $< > $@; \
|
||||
elif which "${INDENT}" >/dev/null 2>&1; then \
|
||||
echo ${RM} -f $@; \
|
||||
${RM} -f $@; \
|
||||
echo "${INDENT} < $< > $@"; \
|
||||
${INDENT} < $< > $@; \
|
||||
else \
|
||||
echo "no intent tool found, ident $< yourself, sorry"; \
|
||||
echo "exit 1"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
##################
|
||||
# 133t hacker rulz
|
||||
##################
|
||||
#
|
||||
love:
|
||||
@echo 'not war?'
|
||||
@${TRUE}
|
||||
|
||||
haste:
|
||||
$(MAKE) waste
|
||||
@${TRUE}
|
||||
|
||||
waste:
|
||||
@echo 'haste'
|
||||
@${TRUE}
|
||||
|
||||
maker:
|
||||
@echo 'Participate in a maker faire'
|
||||
@${TRUE}
|
||||
|
||||
easter_egg:
|
||||
@echo "you expected to often misunderstand this $${RANDOM} magic"
|
||||
@echo "chongo '<was here>' /\\oo/\\"
|
||||
@echo "Eggy"
|
||||
|
||||
sandwich: easter_egg
|
||||
@if [ `id -u` -eq 0 ]; then \
|
||||
echo 'Okay.'; \
|
||||
echo "$${RANDOM}`date +%s`$${RANDOM}" > $@; \
|
||||
else \
|
||||
echo 'What? Make it yourself.'; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Understand the history of the Homebrew Computer Club
|
||||
# as well as the West Coast Computer Faire and
|
||||
# you might be confused different. :-)
|
||||
#
|
||||
supernova: sandwich
|
||||
@-if [ -r .code_anal ]; then \
|
||||
${RM} -f .code_anal_v6; \
|
||||
else \
|
||||
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
|
||||
fi
|
||||
@echo "A $@ helps ${MAKE} the elements that help form planets"
|
||||
@${TRUE}
|
||||
|
||||
deep_magic: supernova
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --deep_magic 7889066cdbdf09b0408021754586e895be641cc9be29e7eafd3ca65359541f17 \
|
||||
--FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
|
||||
else \
|
||||
echo "Wrong! Do it again!"; \
|
||||
sleep 2; \
|
||||
echo "Wrong! Do it again!"; \
|
||||
sleep 2; \
|
||||
echo "Wrong! Do it again!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
magic: deep_magic
|
||||
@-if [ -r .code_anal ]; then \
|
||||
ccode_analysis --level 20003 --mode 5717175 --FNV1a_hash_512_bit -v2 "${PROG}" "${PROG}.c"; \
|
||||
else \
|
||||
echo "If you don't eat yer meat, you can't have any pudding!"; \
|
||||
echo "How can you have any pudding if you don't eat yer meat?!"; \
|
||||
fi
|
||||
@${TRUE}
|
||||
|
||||
# The IOCCC resident astronomer states
|
||||
#
|
||||
charon: magic
|
||||
@echo "$@ is a dwarf planet"
|
||||
@echo "dwarf is a type of planet"
|
||||
@echo "therefore IAU, $@ is a planet"
|
||||
|
||||
pluto: charon
|
||||
${MAKE} charon
|
||||
@echo "$@ is a dwarf planet"
|
||||
@echo "dwarf is a type of planet"
|
||||
@echo "therefore, $@ is a planet"
|
||||
@echo "having lots of planets is good feature because supernovae can help ${MAKE} a lot of them"
|
||||
@@ -1,228 +0,0 @@
|
||||
# Most Educational:
|
||||
|
||||
Adrian Mariano
|
||||
University of Washington
|
||||
2729 72nd Ave SE
|
||||
Mercer Island, WA 98040
|
||||
USA
|
||||
|
||||
## To build:
|
||||
|
||||
make all
|
||||
|
||||
### To run
|
||||
|
||||
./adrian adrian.grep.try < adrian.hint
|
||||
|
||||
For the slow minded, try:
|
||||
|
||||
./adsleep 32767
|
||||
|
||||
## Judges' comments
|
||||
|
||||
Once you get past the obfuscation, you have an opportunity to learn
|
||||
about regular expressions and state machines.
|
||||
|
||||
NOTE: Some compilers have had trouble optimizing this entry.
|
||||
|
||||
## Author's comments
|
||||
|
||||
ADrian's GREP (adgrep)
|
||||
|
||||
For those confused by the complexity of full-blown egrep style regular
|
||||
expressions, this program offers an alternative. It implements an
|
||||
equivalent search, using a deterministic finite automaton.
|
||||
|
||||
A deterministic finite automaton consists of a finite set of states,
|
||||
along with transition rules to move from one state to another, an initial
|
||||
state, and a set of accepting states. The automaton takes a string as
|
||||
input and begins in the start state. It reads a character of the string
|
||||
and consults the rules for the current state, moving to the new state
|
||||
indicated by the appropriate rule. This process is repeated until the
|
||||
string is consumed. If the current state at this point is one of the
|
||||
accepting states, then the string is accepted.
|
||||
|
||||
The deterministic finite automaton is specified as a series of rules for
|
||||
each state:
|
||||
|
||||
<state> chars1 <dest1> chars2 <dest2> ...
|
||||
|
||||
chars1 is a list of characters (only the first 8 are significant) which
|
||||
should trigger a transition to <dest1>. <dest1> is another state which
|
||||
should have a similar specification somewhere. A state is accepting if
|
||||
it is specified in square brackets: [final], and state strings are
|
||||
significant to only eight characters.
|
||||
|
||||
Example 1: matches ^abc$
|
||||
|
||||
<q0> a <q1> The first state to appear is the start state
|
||||
<q1> b <q2>
|
||||
<q2> c [q3]
|
||||
[q3]
|
||||
|
||||
Technically, a deterministic finite automaton should have a rule for each
|
||||
possible input character at each state. To simplify descriptions of the
|
||||
automata, if no rule is present, the string will not be accepted. Also,
|
||||
the '.' character matches any character if it occurs first in the
|
||||
character list.
|
||||
|
||||
|
||||
Example 2: ^abc
|
||||
|
||||
<q0> a <q1>
|
||||
<q1> b <q2>
|
||||
<q2> c [q3]
|
||||
[q3] . [q3]
|
||||
|
||||
|
||||
Example 3: abc$
|
||||
|
||||
<q0> a <q1> . <q0>
|
||||
<q1> b <q2> a <q1> . <q0>
|
||||
<q2> c [q3] a <q1> . <q0>
|
||||
[q3] . <q1>
|
||||
|
||||
|
||||
Example 4: ^(abc)*$
|
||||
|
||||
[q0] a <q1>
|
||||
<q1> b <q2>
|
||||
<q2> c [q0]
|
||||
|
||||
|
||||
Example 5: ^[ab][cd][ef]$
|
||||
|
||||
<q0> ab <q1>
|
||||
<q1> cd <q2>
|
||||
<q2> ef [q3]
|
||||
[q3]
|
||||
|
||||
|
||||
Example 6: ^(abc|efg)$
|
||||
|
||||
<q0> a <q1> e <q3>
|
||||
<q1> b <q2>
|
||||
<q2> c [q5]
|
||||
<q3> f <q4>
|
||||
<q4> g [q5]
|
||||
[q5]
|
||||
|
||||
|
||||
With the automaton specification in 'filename', invoke the program by
|
||||
typing
|
||||
|
||||
adgrep 'filename'
|
||||
|
||||
It will read stdin and print out all the lines which the automaton
|
||||
accepts. If the file cannot be opened, a system error message will
|
||||
be printed. If the input contains errors, then an error message along
|
||||
with the number of the offending line will be printed to stderr. The
|
||||
number of rules for each state is limited to 17. If more than 17 rules
|
||||
are present, you get the error to_many_rules, and the state that was
|
||||
being processed is printed. Error no_destination occurs if you specify a
|
||||
set of characters, but no destination state, and error too_many_states
|
||||
occurs if your automaton has more than 257 states.
|
||||
|
||||
Running
|
||||
adgrep from < your_mailbox
|
||||
|
||||
will perform a function similar to that of the unix from command.
|
||||
|
||||
If no filename is specified on the command line, then "adgrep.c" is used
|
||||
as the specification for the automaton. (This file has been renamed
|
||||
to adrian.c by the judges.) In this case, the program will search for
|
||||
matches to the regular expression:
|
||||
|
||||
^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$
|
||||
|
||||
I suggest using adgrep.c as input, and storing the output in adwc.c:
|
||||
|
||||
adgrep < adgrep.c > adwc.c
|
||||
|
||||
Compiling the new file, mywc.c, yields a clone of the unix wc command. It
|
||||
runs on one file (defaulting to "adgrep.c" if no file is given) and
|
||||
displays the number of lines, words, and bytes in the input file.
|
||||
|
||||
|
||||
Another possibly interesting automaton can be created by slightly
|
||||
adjusting the adgrep.c file. Change the first line to read
|
||||
|
||||
/* . echo| . */
|
||||
|
||||
and repeat the process above
|
||||
|
||||
adgrep <adgrep.c > adecho.c
|
||||
|
||||
The new file now contains all lines which match
|
||||
|
||||
^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$
|
||||
|
||||
Compile and run. This is an echo clone. Note the efficient algorithm
|
||||
employed.
|
||||
|
||||
|
||||
Two other adjustments to the first line also yield useful results. By
|
||||
changing it to
|
||||
/* . head; . */
|
||||
|
||||
you can search for matches to
|
||||
|
||||
^.[^W]*W..*$
|
||||
|
||||
By some freak happenstance, lines of adgrep.c which match this regular
|
||||
expression form a unix head command. It prints the first ten lines of
|
||||
the file specified on the command line (or adgrep.c if no file is
|
||||
specified).
|
||||
|
||||
By setting the first line to
|
||||
|
||||
/* . basename . */
|
||||
|
||||
a clone of the unix basename command can be unearthed. The automaton will
|
||||
search for
|
||||
^.[^j]*jr.*$
|
||||
|
||||
on standard input. And the program which results by running adgrep.c
|
||||
through this filter requires two parameters. The first is meant to be a
|
||||
filename, and the second, an extension. All leading pathname components
|
||||
are removed from the filename, and the extension is removed if present.
|
||||
The resulting base name is printed to stdout.
|
||||
|
||||
Lastly, by setting the first line to
|
||||
|
||||
/* . sleep . */
|
||||
|
||||
you can search for
|
||||
|
||||
^.[^(~][^s]*sl.*$
|
||||
|
||||
Filtering adgrep.c through this search yields a clone of the sleep
|
||||
command. Invoke with a single integer parameter, and it will pause
|
||||
for that many seconds.
|
||||
|
||||
If either adbasename or adsleep is invoked with too few parameters,
|
||||
the program will print the error message:
|
||||
Segmentation fault (core dumped)
|
||||
|
||||
(The exact text of the above error messages varies from machine to
|
||||
machine.) The four programs which read from stdin require lines
|
||||
shorter than 999 characters.
|
||||
|
||||
The other info files are adrian.grep.[1-6] which contain the six
|
||||
examples that appear above, and from, which is used to emulate the
|
||||
unix from command. For reasons of clarity, the name "from" should
|
||||
probably not be changed if possible. I wouldn't want to be accused of
|
||||
confusing people by giving the input files weird names.
|
||||
|
||||
If you want to change the default input filename (line 80) you must be
|
||||
careful to choose a name that doesn't match the wrong search patterns,
|
||||
introducing extra lines into one of the programs.
|
||||
|
||||
The program will produce at least one warning and possible several
|
||||
when compiled depending on the compiler.
|
||||
|
||||
Copyright (c) 1992, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
granted provided this this copyright and notice are included in its entirety
|
||||
and remains unaltered. All other uses must receive prior permission in writing
|
||||
from both Landon Curt Noll and Larry Bassel.
|
||||
@@ -1,113 +0,0 @@
|
||||
/* . wc . */
|
||||
#include<stdio.h>/* Wht majr flwchrt? */
|
||||
#include<string.h>/* That mjr flwchrt! */
|
||||
#define P 257
|
||||
#define G 17
|
||||
#define z 8
|
||||
#define v(jr) jr
|
||||
int W ,head;
|
||||
#define S(W,b,f) strncpy(W,b,f),W[f]=0\
|
||||
|
||||
|
||||
char *wcs=" \t\n";
|
||||
struct{ char X[z+1];
|
||||
char f ;
|
||||
int e ;
|
||||
struct{ char g[z+1];
|
||||
int b ;
|
||||
} w[ G];
|
||||
} o[ P];
|
||||
int L=0,j= -28;
|
||||
|
||||
|
||||
void E(int i, int m,char*c)
|
||||
{
|
||||
for(; i<43; i+=3)
|
||||
putc("}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"[i]+i-9,stderr);
|
||||
fprintf(stderr,"(%d): %s\n" ,m,c);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int N(int m, char *t)
|
||||
{
|
||||
int i ;
|
||||
if (strlen (
|
||||
t)>z) t[z ]=0;
|
||||
for(i= 0; i< L ; i++) if(
|
||||
!strcmp (o[ i] . X
|
||||
, t))return i;
|
||||
if( L== P)
|
||||
E(0, m, t);
|
||||
S (o[ L] . X , t
|
||||
,z);
|
||||
head; W = .1* head;
|
||||
o[L ].f = !( strchr( t,']' )== 0 );
|
||||
o[L ++ ] . e = 0;
|
||||
return L -1 ; }
|
||||
|
||||
#define v(x )
|
||||
|
||||
int A(char *R)
|
||||
{
|
||||
int c=0, i;
|
||||
while(* R) {
|
||||
i = -1;
|
||||
while(j){
|
||||
if( ++ i==o[ c].e ) return 0;
|
||||
if(o[
|
||||
c] .w[i ] .g[0 ]
|
||||
=='.' ||strchr (o[ c].w[i] .g ,* R)){
|
||||
c=
|
||||
o[ c ] .w[i].b; break;/*
|
||||
main(int sl,char *j[]){
|
||||
sleep (~~~~~~~~atoi(j[1])) ;/* . sl
|
||||
sl s l . sl
|
||||
l l ]
|
||||
sl */ }
|
||||
}
|
||||
R++;
|
||||
}
|
||||
return o[ c].f;
|
||||
}
|
||||
|
||||
|
||||
main(int wc,char *V[]){char Y[999],*s;FILE*W;int m=0,echo,jr,q,wcl=0,wcw=0,wcc=0;
|
||||
v(s = V[1]; if (*V=strrchr(s,'/'))s=*V+1; if(( !strncmp( s + (jr=strlen(s)) -
|
||||
(q=strlen(V[2]) ),V[2],q))&&jr!=q) s[jr-q] = 0; puts(s); )
|
||||
int e,p,C=0,Q ,basename;
|
||||
W= fopen(wc>= 2 ? V[1] : "adgrep.c","rt");
|
||||
echo| m^ e| 5| (int) .8| echo|
|
||||
wc |C ==o[o[C] .e] .
|
||||
e| e==+p,p; s[o[C] .e ]
|
||||
;
|
||||
while( fgets(Y,998,W)) { wcc += strlen(Y); m++;
|
||||
if( s = strtok(Y,wcs)) wcw++;
|
||||
else continue ;
|
||||
C=
|
||||
basename= j +j+*"* . basename"
|
||||
+j+*"* r ] " + N(m,s) ;
|
||||
while( s = strtok(0,wcs)) {
|
||||
if( o[ C ] . e ==
|
||||
G) E(1 ,m,o[C] .X) ;
|
||||
S(o[C
|
||||
] .w[o[C ] .e].g,s, z);
|
||||
Q= C ;
|
||||
if(! ( s =strtok ( 0 ,wcs )))wcw --
|
||||
,E( 2 , m, o[C]
|
||||
. w[ o[ Q ] .e] . g );
|
||||
e
|
||||
= o[C ] .w[o[C ] .e++ ] .b= N(m,s)
|
||||
; wcw += 2; }
|
||||
0&&
|
||||
W && wcl++
|
||||
< 10 && printf((W,Y)); }
|
||||
if(j+28) { {
|
||||
; } printf("%7u%7u%7u\n", wcl , wcw , wcc); }
|
||||
while( gets(Y) ) if(A(Y)) puts(Y);
|
||||
W, jr; }
|
||||
|
||||
O(int wc,char**V) {
|
||||
--wc && (printf("%s ",*++V), main(wc,V), 1) || printf("\n"); }
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<q0> a <q1> The first state to appear is the start state
|
||||
<q1> b <q2>
|
||||
<q2> c [q3]
|
||||
[q3]
|
||||
@@ -1,4 +0,0 @@
|
||||
<q0> a <q1>
|
||||
<q1> b <q2>
|
||||
<q2> c [q3]
|
||||
[q3] . [q3]
|
||||
@@ -1,4 +0,0 @@
|
||||
<q0> a <q1> . <q0>
|
||||
<q1> b <q2> a <q1> . <q0>
|
||||
<q2> c [q3] a <q1> . <q0>
|
||||
[q3] . <q1>
|
||||
@@ -1,3 +0,0 @@
|
||||
[q0] a <q1>
|
||||
<q1> b <q2>
|
||||
<q2> c [q0]
|
||||
@@ -1,4 +0,0 @@
|
||||
<q0> ab <q1>
|
||||
<q1> cd <q2>
|
||||
<q2> ef [q3]
|
||||
[q3]
|
||||
@@ -1,8 +0,0 @@
|
||||
<q0> F <q1>
|
||||
<q1> r <q2>
|
||||
<q2> o <q3>
|
||||
<q3> m <q4>
|
||||
<q4> : <q5> . [q6]
|
||||
<q5> . <q5>
|
||||
[q6] . [q6]
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<q0> t <q1> . <q0>
|
||||
<q1> hc <q2> t <q1> . <q0>
|
||||
<q2> eh [q3] t <q1> . <q0>
|
||||
[q3] . <q1>
|
||||
Reference in new issue
Block a user