Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. (defun zone-pgm-putz-with-case ()
  2. (goto-char (point-min))
  3. (while (not (input-pending-p))
  4. (let ((np (+ 2 (random 5)))
  5. (pm (point-max)))
  6. (while (< np pm)
  7. (goto-char np)
  8. (let ((prec (preceding-char))
  9. (props (text-properties-at (1- (point)))))
  10. (insert (if (zerop (random 2))
  11. (upcase prec)
  12. (downcase prec)))
  13. (set-text-properties (1- (point)) (point) props))
  14. (backward-char 2)
  15. (delete-char 1)
  16. (setq np (+ np (1+ (random 5))))))
  17. (goto-char (point-min))
  18. (sit-for 0 2)))
  19.  
  20. (defun zone-putz-with-case ()
  21. (goto-char (point-min))
  22. (while (not (input-pending-p))
  23. (let ((np (+ 2 (random 5)))
  24. (pm (point-max)))
  25. (while (< np pm)
  26. (goto-char np)
  27. (let ((prec (preceding-char)))
  28. (delete-char -1)
  29. (insert (if (zerop (random 2))
  30. (upcase prec)
  31. (downcase prec))))
  32. (setq np (+ np (1+ (random 5))))))
  33. (goto-char (point-min))
  34. (sit-for 0 2)))
  35.  
  36. (defvar +test-alphabet+ "abcdefg")
  37. (defun zone-putz-with-letters ()
  38. (setq alph +test-alphabet+)
  39. (goto-char (point-min))
  40. (while (not (input-pending-p))
  41. (let ((np (+ 2 (random 5)))
  42. (pm (point-max)))
  43. (while (< np pm)
  44. (goto-char np)
  45. (delete-char -1)
  46. (insert-char (aref alph (random (length alph))))
  47. (setq np (+ np (1+ (random 5))))
  48. ))
  49. (goto-char (point-min))
  50. (sit-for 0 2)))
  51.  
  52. (insert (upcase prec))
  53.  
  54. (insert (aref `[,prec ,prec ,(upcase prec) ,prec] 2))
  55.  
  56. (insert (upcase (preceding-char)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement