ll_j 发表于 2013-3-15 11:39
仅仅是根据数组画图,应该是不难的,我写了一段代码,可以看看是不是你要的。
ll_J大师, 这是固定的二维码,能不能自定义呢?用lee的函数,能完善下吗?
- (defun int2hex ( n )
- (cond
- ( (< n 10) (chr (+ n 48)))
- ( (< n 16) (chr (+ n 55)))
- ( (strcat (int2hex (/ n 16)) (int2hex (rem n 16))))
- )
- )
-
- (defun str->url ( s )
- (apply 'strcat
- (mapcar
- (function
- (lambda ( a )
- (cond
- ( (or (<= 65 a 90) (<= 97 a 122) (member a '(45 46 95 126))) (chr a))
- ( (= a 32) "+")
- ( (< a 16) (strcat "%0" (int2hex a)))
- ( (strcat "%" (int2hex a)))
- )
- )
- )
- (vl-string->list s)
- )
- )
- )
|