;; variables (set 'max-columns +12) ;; functions (defun random-number (cases) (fill ((dif cases +0) (cons (random +9) ())) (f (cons (random +9) (random-number (- cases +1)))))) (defun number-to-symbol (num) (fill ((dif +0 num) '0) ((dif +1 num) '1) ((dif +2 num) '2) ((dif +3 num) '3) ((dif +4 num) '4) ((dif +5 num) '5) ((dif +6 num) '6) ((dif +7 num) '7) ((dif +8 num) '8) ((dif +9 num) '9))) (defun number-to-earth-rod (num) (fill ((dif +0 num) "[@-@][@@@@-@]") ((dif +1 num) "[@-@][@@@-@@]") ((dif +2 num) "[@-@][@@-@@@]") ((dif +3 num) "[@-@][@-@@@@]") ((dif +4 num) "[@-@][-@@@@@]") ((dif +5 num) "[-@@][@@@@-@]") ((dif +6 num) "[-@@][@@@-@@]") ((dif +7 num) "[-@@][@@-@@@]") ((dif +8 num) "[-@@][@-@@@@]") ((dif +9 num) "[-@@][-@@@@@]"))) (defun number-to-air-rod (num) (fill ((dif +0 num) "[@-@@@@][@-@]") ((dif +1 num) "[@@-@@@][@-@]") ((dif +2 num) "[@@@-@@][@-@]") ((dif +3 num) "[@@@@-@][@-@]") ((dif +4 num) "[@@@@@-][@-@]") ((dif +5 num) "[@-@@@@][@@-]") ((dif +6 num) "[@@-@@@][@@-]") ((dif +7 num) "[@@@-@@][@@-]") ((dif +8 num) "[@@@@-@][@@-]") ((dif +9 num) "[@@@@@-][@@-]"))) ;; main (defun main () (progs f (set 'n-rand (random-number (random max-columns))) (print (map number-to-symbol n-rand)) ;; (print n-rand) (newline) (read) (map (lambda (num) (princ (number-to-air-rod num)) (newline)) n-rand) (read) (newline) (read))) ;; loop (defun loop () (fill ((main) ()) (f (loop)))) (loop)