an attempt to do that...
(DEFUN c:brandom (/ prefix pt sufix ssize number block lastblock)
(SETQ prefix "TREE")
(WHILE (SETQ pt (GETPOINT "\n-> Insertion point or ENTER for finish : "))
(SETQ sufix (RTOS (GETVAR "date") 2 7)
ssize (STRLEN sufix)
number (SUBSTR sufix (- ssize 1))
block (ATOI number)
)
(IF (<= block 30)
(PROGN (SETQ block (STRCAT prefix number)
lastblock block
)
(ALERT (STRCAT "Insert block " block " goes here"))
)
(IF lastblock
(ALERT (STRCAT "Insert block " lastblock " goes here..."))
(PRINC "\n-> Try again...")
)
)
)
(PRINC)
)
;; you must have the blocks TREE0, TREE1, TREE2, TREE..., TREE30