git.y1.nz

typie

Minimal typing practice tool.
download: https://git.y1.nz/archives/typie.tar.gz
README | Files | Log | Refs | LICENSE

examples/letters.sh

      1 #!/bin/sh
      2 
      3 # this script generates random orders of specific letters.
      4 # Usage: letters.sh CHARSET MIN_LENGTH MAX_LENGTH
      5 
      6 CHARSET=$1
      7 get_letter() {
      8 	LETTER="$(echo $CHARSET | fold -b -w 1 | shuf -n 1)"
      9 	echo "$LETTER"
     10 }
     11 
     12 LENGTH=$(seq $2 $3 | shuf -n 1)
     13 
     14 WORD=""
     15 for i in $(seq $LENGTH); do
     16 	WORD="$WORD$(get_letter)"
     17 done
     18 
     19 echo "$WORD"
     20 

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.