Guest User

Untitled

a guest
May 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. ;;; package --- Codes for compare the point rate of credit cards.
  2. ;;; Code:
  3. ;;; Commentary:
  4.  
  5. (defvar worst-amounts '(1999 3999 5999 7999 9999 11999 13999 15999 17999 19999 21999 23999 25999 27000))
  6. (defvar middle-amounts '(1000 3000 5000 7000 9000 11000 13000 15000 17000 19000 21000 23000 25000 27000))
  7.  
  8.  
  9. (defun rex-point (x)
  10. (floor (* 25 (/ x 2000))))
  11.  
  12. (defun rakuten-point (x)
  13. (floor (* 1 (/ x 100))))
  14.  
  15. (defun recruit-point (x)
  16. (floor (* 1.2 (/ x 100))))
  17.  
  18. (defun compare-cards (amounts)
  19. (let (value)
  20. (dolist (p (list 'rex-point 'rakuten-point 'recruit-point) value)
  21. (let (val)
  22. (dolist (x amounts val)
  23. (setq val (cons (funcall p x) val)))
  24. (setq value (cons (reverse val) value))))
  25. (reverse value)))
  26.  
  27. ;;; (compare-cards worst-amounts)
  28. ;;; ((0 25 50 75 100 125 150 175 200 225 250 275 ...) (19 39 59 79 99 119 139 159 179 199 219 239 ...) (22 46 70 94 118 142 166 190 214 238 262 286 ...))
  29. ;;; (compare-cards middle-amounts)
  30. ;;; ((0 25 50 75 100 125 150 175 200 225 250 275 ...) (10 30 50 70 90 110 130 150 170 190 210 230 ...) (12 36 60 84 108 132 156 180 204 228 252 276 ...))
  31.  
  32. (provide 'compare-cards)
  33. ;;; compare-cards.el ends here
Add Comment
Please, Sign In to add comment