From 2f76ad3c8ef2a5b1bbd34a22c30ab43aabea80df Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 13 Jan 2024 06:12:40 -0800 Subject: [PATCH] Add 1990/baruch to bugs.md, update try.sh A feature is that as the number specified gets bigger so too does the runtime, the amount of resources and the number of lines of output. The script has another example command (that isn't too long but is a number of pages of less(1) output). --- 1990/baruch/README.md | 12 ++++++++ 1990/baruch/try.sh | 5 ++++ bugs.md | 69 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) diff --git a/1990/baruch/README.md b/1990/baruch/README.md index 825dcb4d1..692092589 100644 --- a/1990/baruch/README.md +++ b/1990/baruch/README.md @@ -8,6 +8,18 @@ There is an alternate version for those using Turbo-C or MSC. See [alternate code](#alternate-code) below for details. +### Bugs and (Mis)features: + +The current status of this entry is: + +``` +STATUS: INABIAF - please **DO NOT** fix +``` + +For more detailed information see [1990 baruch in bugs.md](/bugs.md#1990-baruch). + + + ## To use: ```sh diff --git a/1990/baruch/try.sh b/1990/baruch/try.sh index 28822ca1a..c3e98403e 100755 --- a/1990/baruch/try.sh +++ b/1990/baruch/try.sh @@ -20,6 +20,11 @@ echo 1>&2 echo 5 | ./baruch | less -rEXF echo 1>&2 +read -r -n 1 -p "Press any key to run: echo 8 | ./baruch (space = next page, q = quit): " +echo 1>&2 +echo 8 | ./baruch | less -rEXF +echo 1>&2 + read -r -n 1 -p "Press any key to run: echo 2 | ./baruch: " echo 1>&2 echo 2 | ./baruch diff --git a/bugs.md b/bugs.md index 8e3788e78..4d6a35b5b 100644 --- a/bugs.md +++ b/bugs.md @@ -673,6 +673,75 @@ Enjoy! :-) # 1990 +## 1990 baruch + +### STATUS: known bug - please help us fix +### Source code: [1990/baruch/baruch.c](1990/baruch/baruch.c) +### Information: [1990/baruch/README.md](1990/baruch/README.md) + +A point worth considering is that as the number passed into the program gets +bigger the number of lines of output gets substantially larger and it takes much +more time and resources to run as well. For instance: + +```sh +$ for n in $(seq 1 18); do echo "$n"; echo "$n" | time "./baruch" | wc -l | sed -E -e 's/[[:space:]]//g'; done +1 +3 +./baruch 0.00s user 0.00s system 5% cpu 0.115 total +2 +1 +./baruch 0.00s user 0.00s system 64% cpu 0.004 total +3 +1 +./baruch 0.00s user 0.00s system 60% cpu 0.003 total +4 +11 +./baruch 0.00s user 0.00s system 64% cpu 0.003 total +5 +61 +./baruch 0.00s user 0.00s system 66% cpu 0.003 total +6 +29 +./baruch 0.00s user 0.00s system 61% cpu 0.003 total +7 +321 +./baruch 0.00s user 0.00s system 69% cpu 0.002 total +8 +829 +./baruch 0.00s user 0.00s system 76% cpu 0.003 total +9 +3521 +./baruch 0.00s user 0.00s system 87% cpu 0.005 total +10 +7965 +./baruch 0.01s user 0.00s system 95% cpu 0.014 total +11 +32161 +./baruch 0.05s user 0.00s system 98% cpu 0.053 total +12 +184601 +./baruch 0.29s user 0.00s system 99% cpu 0.294 total +13 +1031969 +./baruch 1.78s user 0.00s system 99% cpu 1.794 total +14 +5483941 +./baruch 11.26s user 0.02s system 99% cpu 11.311 total +15 +36466945 +./baruch 79.20s user 0.15s system 99% cpu 1:19.72 total +16 +251132705 +./baruch 592.89s user 0.77s system 99% cpu 9:55.34 total +17 +1724671873 +./baruch 4535.71s user 5.25s system 99% cpu 1:15:49.76 total +18 +12655721857 +./baruch 37496.97s user 58.50s system 99% cpu 10:27:48.29 total +``` + + ## 1990 jaw ### STATUS: known bug - please help us fix