fix Makefile and README.md for 2019/karns

This commit is contained in:
Landon Curt Noll committed 2023-03-25 03:17:45 -07:00
1 parent a4677e7c5d
commit dfe6c95c67
2 files changed
+41 -35

No files matched your search

+5 -7
View File
@@ -104,8 +104,8 @@ 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
#CINCLUDE= -I ${X11_INCDIR} -I ${X11_INCDIR}/X11
#CINCLUDE= `${SDL2_CONFIG} --cflags`
# Optimization
#
@@ -129,7 +129,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
LIBS=
#LIBS= -lm
#LIBS= -L ${X11_LIBDIR} -lX11
#LIBS= -L ${HOMEBREW_PREFIX}/lib -lSDL
#LIBS= `${SDL2_CONFIG} --libs`
# C compiler to use
#
@@ -168,7 +168,8 @@ ENTRY= karns
PROG= prog
#
OBJ= ${PROG}.o
DATA=
CSRC= ${PROG}.o
DATA= maze demo.sh
TARGET= ${PROG}
#
ALT_OBJ=
@@ -189,9 +190,6 @@ all: data ${TARGET}
${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
test: ${PROG}
${CAT} ${PROG}.c | ./${PROG}
# alternative executable
#
alt: data ${ALT_TARGET}
+36 -28
View File
@@ -1,33 +1,38 @@
# Most in need of whitespace
Joshua Karns
Twitter: @jkarnss
Joshua Karns
Twitter: @jkarnss
## To build:
# To build:
make all
```sh
make
```
### To run
### To run:
./prog < textfile_that_fits_on_the_screen
```sh
./prog < textfile_that_fits_on_the_screen
```
### Try:
make test
```sh
./prog < README.md
./prog < README.md
./prog < prog.c
./prog < prog.c
./prog < maze
./prog < maze
```
The last two can be done in a sequence, first showing the respective files at
the terminal, like:
./demo.sh
```sh
./demo.sh
```
### Selected Judges Remarks:
## Judges' comments:
If you typically get lost in mazes, watching this program run might -- or might not, YMMV --
teach you how to find your way in a maze. The algorithm is well-known but the drawing is amazing!
@@ -41,8 +46,7 @@ A puzzle for the reader: Can you change the program to consider a diagonal movem
## Author's comments:
The Program
-----------
### The Program
This program is pretty simple! It performs a breadth first search on the
specified graph. The graph can be any ascii text file that has an 'at'
@@ -52,26 +56,31 @@ which will be the destination.
The nodes on this graph that are spaces are connected with any directly
adjacent nodes that are also spaces. Nodes that aren't spaces are not
connected with anything.
Compiling and Running
---------------------
### Compiling and Running
This program usually compiles under both GCC and clang. Build with:
$(CC) -std=c99 -o tbfs prog.c
```sh
$(CC) -std=c99 -o tbfs prog.c
```
where $(CC) is cc, gcc, clang, or somet other c compiler.
You can then run it with:
cat <input file> | ./tbfs
```sh
cat <input file> | ./tbfs
```
Examples:
./tbfs < maze
./tbfs < prog.c
Issues
-----------
```sh
./tbfs < maze
./tbfs < prog.c
```
### Issues
- The program must be ran in a terminal that supports ANSI escape codes for
moving the cursor and changing colors.
@@ -88,11 +97,10 @@ not encountered this myself).
- The program could be obfuscated much further.
- The program contains some unused code and data.
--------------------------------------------------------------------------------
<!--
## Copyright:
(c) Copyright 1984-2019, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->