Part 2: 简单的ASCII艺术
使用 random
ELISP> (dotimes (i (random 10)) (dotimes (j (random (+ i 5))) (insert "&")) (insert "^")) nil ELISP> &&^&&&&^&&&&^&&&&^&&&&&&&&^&&&&&&&^
使用 if
偶尔插入换行符
ELISP> (dotimes (i (random 30)) (if (= (random 5) 0) (newline)) (dotimes (j (random 10)) (insert "?")) (insert " < ")) nil ELISP> ?? < ?? < ?? < < ?? < ????? < ???????? < ?????? < < ??????? < ????????? < ???????? < ??????? < < ???????? < ?? < ???????? < ???? < ????????? < ???????? < ??? < ????????? < ?? < ????? < ??? < ??? < ????????? <
使用 sit-for
控制时间
ELISP> (dotimes (i 10) (dotimes (j (random 20)) (insert ",,")) (insert "#") (sit-for (* 0.1 (random 4)))) nil ELISP> ,,,,,,,,,,#,,,,##,,,,,,,,#,,,,,,,,,,,,#,,,,,,,,,,#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#,,,,,,,,,,,,,,,,,,,,,,,,,,,,#,,,,,,,,,,,,,,#