#!/bin/sh
: ; exec klone $0 "$@"
; The above line finds the klone executable in the $PATH

;; generates a random word of 8 letters

(setq N (Int (get *arguments* 1 "0")))
(if (= 0 N) (setq N 8))

;; generate list of printable chars
(setq pcl "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789")
(setq pcls (length pcl))

(setq word "")
(dotimes (i N)
  (put word -1 (get pcl (random pcls) #\?))
)

(? word "\n")
