summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-12-27 19:05:15 +0000
committerdavidovski <david@davidovski.xyz>2023-12-27 19:05:15 +0000
commitc2ec01d368fe789101e732da00b87179c1b7bcf3 (patch)
tree15443a9a76115b132efadb7c796222b786edb22d
parent739ff05c19c67d27c5790e365b3315da03c58e34 (diff)
show errors
-rwxr-xr-xtypr.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/typr.sh b/typr.sh
index 9ceafad..676b208 100755
--- a/typr.sh
+++ b/typr.sh
@@ -1,6 +1,7 @@
#!/bin/sh
words="the be of and a to in he have it that for they i with as not on she at by this we you do but from or which one would all will there say who make when can more if no man out other so what time up go about than into could state only new year some take come these know see use get like then first any work now may such give over think most even find day also after way many must look before great back through long where much should well people down own just because good each those feel seem how high too place little world very still nation hand old life tell write become here show house both between need mean call develop under last right move thing general school never same another begin while number part turn real leave might want point form off child few small since against ask late home interest large person end open public follow during present without again hold govern around possible head consider word program problem however lead system set order eye plan run keep face fact group play stand increase early course change help line"
+alphanum="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|,|.|?|\"|'|!|-"
entered_text=""
text=""
@@ -70,9 +71,11 @@ typr_draw_text () {
}
- [ "$ct" = " " ] && [ "$color" = "" ] \
- && draw="${draw}_" \
- || draw="$draw$ct"
+ [ "$color" = "" ] &&{
+ [ "$ce" = " " ] && draw="${draw}_" || draw="${draw}$ce"
+ } || {
+ draw="$draw$ct"
+ }
i=$((i+1))
done
@@ -105,7 +108,7 @@ typr_show_results () {
words="$(set -- $text ; printf "%s" "$#")"
wpm="$((time_ns*words/60000000000))"
acc="100%"
-
+
printf "[%s;${areax}H%s" \
"${areay}" "wpm" \
"$((areay+1))" "$wpm" \
@@ -145,7 +148,7 @@ typr_main () {
'')
entered_text="${entered_text%?}"
;;
- *)
+ " "|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|,|.|\?|\"|\'|!|-)
[ -z "$start" ] && typr_start_timer
entered_text="$entered_text$c"