fix use of alt code in 2019/ciura

The shell scripts look for and use bash.
The helper scripts have been made excurable.
This commit is contained in:
Landon Curt Noll committed 2023-03-07 17:13:56 -08:00
1 parent 8fca101cf3
commit ab391454b1
12 files changed
+162 -351

No files matched your search

+13 -6
View File
@@ -3,16 +3,14 @@
Marcin Ciura
Twitter: @mciura
## To build:
## Judges' comments:
### To use:
make all
make
### To run
./getwords.sh en | grep .. | ./prog aeiouvwxyz
### Try:
./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz
./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx
@@ -35,6 +33,15 @@ It is better that Mr Jock, TV quiz PhD, bags few lynx.
Speaking of jumping, can you rewrite the code to
remote all of the goto jumps in this code?
There is an alternate version of this code that flushes stdout after writing a newline.
See the Author's comments for more information.
To compile this alternate version:
make alt
Use `prog.alt` as you would `prog` above.
## Author's comments:
### What is this? <a name="wit"></a>
@@ -121,7 +128,7 @@ the example from section [What is this?](#wit) finished in 1.35
seconds. On the other hand, **`prog`** can only output series of words
with nonrepeating characters, unlike **`klausler`**.
In contrast to **`prog.orig.c`**, **`prog.c`** does not call
In contrast to **`prog.alt.c`**, **`prog.c`** does not call
**`fflush(stdout)`** after outputting each line, thus running faster.
I am grateful to Witold Jarnicki for suggesting this change.
The original **`prog`** finished the example above in 100 minutes