Updated 2016-09-14 15:10:52 by EMJ

CAS - Character And String utility procedures

Directions to find it at Stu

Man Page edit

 NAME
       cas - Character And String utility procedures

 SYNOPSIS
       package require Tcl

       package require cas 0.2
       namespace import ::cas::*

       randAZChar

       randAZazChar

       randAZazString  length

       strUnique str   ?length? ?uStr?

 DESCRIPTION
       A  Tcl  extension  that  provides  a  set of character and
       string utility procedures.

 COMMANDS
       randAZChar
              Returns one random character in the range A-Z.

       randAZazChar
              Returns one random character in the range A-Za-z.

       randAZazString
              Generates a string  of  random  characters  in  the
              range A-Za-z, of length length.

       strUnique str ?length? ?uStr?
              Returns an uppercase string not in str.
              str: String to check.
              length:  Length  of string to generate, defaults to 8.
              uStr: A potential unique string - if supplied,  use
              it  and  its  length at start of search, and ignore length.
              Throws an error if  unable  to  generate  a  unique
              string after 100 attempts.
CAVEATS
       I  didn't  update  the  docs  for this version.  There's a
       bunch of procs for ASCII art stuff.  Maybe  other  things.
       Next version should have better docs.  Look in the source.
       The file taa_test.tcl should  show  how  to  generate  the
       ASCII art stuff.

CAS ASCII Art Chart edit

+---------------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                          Faces                                                                          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |   laugh   |  neutral  |  square   |   grin    | surprise  | Surprise  | confused  | Confused  |  tongue   |  Tongue   |   frown  |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    :-)    |    :-D    |    :-|    |    :-]    |    :->    |    :-o    |    :-O    |    :-/    |    :-\    |    :-p    |    :-P    |    :-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    ;-)    |    ;-D    |    ;-|    |    ;-]    |    ;->    |    ;-o    |    ;-O    |    ;-/    |    ;-\    |    ;-p    |    ;-P    |    ;-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    8-)    |    8-D    |    8-|    |    8-]    |    8->    |    8-o    |    8-O    |    8-/    |    8-\    |    8-p    |    8-P    |    8-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    B-)    |    B-D    |    B-|    |    B-]    |    B->    |    B-o    |    B-O    |    B-/    |    B-\    |    B-p    |    B-P    |    B-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    =-)    |    =-D    |    =-|    |    =-]    |    =->    |    =-o    |    =-O    |    =-/    |    =-\    |    =-p    |    =-P    |    =-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    O-)    |    O-D    |    O-|    |    O-]    |    O->    |    O-o    |    O-O    |    O-/    |    O-\    |    O-p    |    O-P    |    O-(   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    :)     |    :D     |    :|     |    :]     |    :>     |    :o     |    :O     |    :/     |    :\     |    :p     |    :P     |    :(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    ;)     |    ;D     |    ;|     |    ;]     |    ;>     |    ;o     |    ;O     |    ;/     |    ;\     |    ;p     |    ;P     |    ;(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    8)     |    8D     |    8|     |    8]     |    8>     |    8o     |    8O     |    8/     |    8\     |    8p     |    8P     |    8(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    B)     |    BD     |    B|     |    B]     |    B>     |    Bo     |    BO     |    B/     |    B\     |    Bp     |    BP     |    B(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    =)     |    =D     |    =|     |    =]     |    =>     |    =o     |    =O     |    =/     |    =\     |    =p     |    =P     |    =(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    O)     |    OD     |    O|     |    O]     |    O>     |    Oo     |    OO     |    O/     |    O\     |    Op     |    OP     |    O(    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    :^)    |    :^D    |    :^|    |    :^]    |    :^>    |    :^o    |    :^O    |    :^/    |    :^\    |    :^p    |    :^P    |    :^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    ;^)    |    ;^D    |    ;^|    |    ;^]    |    ;^>    |    ;^o    |    ;^O    |    ;^/    |    ;^\    |    ;^p    |    ;^P    |    ;^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    8^)    |    8^D    |    8^|    |    8^]    |    8^>    |    8^o    |    8^O    |    8^/    |    8^\    |    8^p    |    8^P    |    8^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    B^)    |    B^D    |    B^|    |    B^]    |    B^>    |    B^o    |    B^O    |    B^/    |    B^\    |    B^p    |    B^P    |    B^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    =^)    |    =^D    |    =^|    |    =^]    |    =^>    |    =^o    |    =^O    |    =^/    |    =^\    |    =^p    |    =^P    |    =^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
|          |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    O^)    |    O^D    |    O^|    |    O^]    |    O^>    |    O^o    |    O^O    |    O^/    |    O^\    |    O^p    |    O^P    |    O^(   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    (-:    |    D-:    |    |-:    |    [-:    |    <-:    |    o-:    |    O-:    |    /-:    |    \-:    |    p-:    |    P-:    |    )-:   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    (-;    |    D-;    |    |-;    |    [-;    |    <-;    |    o-;    |    O-;    |    /-;    |    \-;    |    p-;    |    P-;    |    )-;   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    (-8    |    D-8    |    |-8    |    [-8    |    <-8    |    o-8    |    O-8    |    /-8    |    \-8    |    p-8    |    P-8    |    )-8   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    (-B    |    D-B    |    |-B    |    [-B    |    <-B    |    o-B    |    O-B    |    /-B    |    \-B    |    p-B    |    P-B    |    )-B   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    (-=    |    D-=    |    |-=    |    [-=    |    <-=    |    o-=    |    O-=    |    /-=    |    \-=    |    p-=    |    P-=    |    )-=   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    (-O    |    D-O    |    |-O    |    [-O    |    <-O    |    o-O    |    O-O    |    /-O    |    \-O    |    p-O    |    P-O    |    )-O   |
|          |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    (:     |    D:     |    |:     |    [:     |    <:     |    o:     |    O:     |    /:     |    \:     |    p:     |    P:     |    ):    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    (;     |    D;     |    |;     |    [;     |    <;     |    o;     |    O;     |    /;     |    \;     |    p;     |    P;     |    );    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    (8     |    D8     |    |8     |    [8     |    <8     |    o8     |    O8     |    /8     |    \8     |    p8     |    P8     |    )8    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    (B     |    DB     |    |B     |    [B     |    <B     |    oB     |    OB     |    /B     |    \B     |    pB     |    PB     |    )B    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    (=     |    D=     |    |=     |    [=     |    <=     |    o=     |    O=     |    /=     |    \=     |    p=     |    P=     |    )=    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    (O     |    DO     |    |O     |    [O     |    <O     |    oO     |    OO     |    /O     |    \O     |    pO     |    PO     |    )O    |
| nonose   |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
|          |    (^:    |    D^:    |    |^:    |    [^:    |    <^:    |    o^:    |    O^:    |    /^:    |    \^:    |    p^:    |    P^:    |    )^:   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| wink     |    (^;    |    D^;    |    |^;    |    [^;    |    <^;    |    o^;    |    O^;    |    /^;    |    \^;    |    p^;    |    P^;    |    )^;   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| specs    |    (^8    |    D^8    |    |^8    |    [^8    |    <^8    |    o^8    |    O^8    |    /^8    |    \^8    |    p^8    |    P^8    |    )^8   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| shades   |    (^B    |    D^B    |    |^B    |    [^B    |    <^B    |    o^B    |    O^B    |    /^B    |    \^B    |    p^B    |    P^B    |    )^B   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| streek   |    (^=    |    D^=    |    |^=    |    [^=    |    <^=    |    o^=    |    O^=    |    /^=    |    \^=    |    p^=    |    P^=    |    )^=   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+
| right    |           |           |           |           |           |           |           |           |           |           |           |          |
| cyclops  |    (^O    |    D^O    |    |^O    |    [^O    |    <^O    |    o^O    |    O^O    |    /^O    |    \^O    |    p^O    |    P^O    |    )^O   |
| sidenose |           |           |           |           |           |           |           |           |           |           |           |          |
+----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+----------+

+----------------------------------------------------+
|                    Tie Fighters                    |
+---------+----------+----------+----------+---------+
| round   | straight |  square  |  angle   |  curly  |
+---------+----------+----------+----------+---------+
| (-O-)   |  |-O-|   |  [-O-]   |  <-O->   |  {-O-}  |
+---------+----------+----------+----------+---------+

+---------------------------------+
|              Food               |
+-------+--------+--------+-------+
| eat   |  Eat   | coffee |  beer |
+-------+--------+--------+-------+
| |o|   |  |O|   |   LP   |  |_P  |
+-------+--------+--------+-------+

+---------------+
|    Animals    |
+-------+-------+
|  duck |  fish |
+-------+-------+
| \_o<  | ><O_) |
+-------+-------+

+---------------------------+
|          Upside           |
+-------------+-------------+
|             |     down    |
+-------------+-------------+
|    umop     | umop apisdn |
+-------------+-------------+

+------------------------+
|        Uniface         |
+-------+--------+-------+
|       | black  | frown |
+-------+--------+-------+
|  ☺    |   ☻    |   ☹   |
+-------+--------+-------+