Created
December 16, 2015 18:37
-
-
Save lucca65/fa7f72fd230b154fdc48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun safadao () | |
(interactive) ;; interactive interpreter | |
(let (birthdate) ;; create variable birthdate, it will be avaliable for nested stuff | |
(progn (setq birthdate (read-no-blanks-input "digite sua data de nascimento: "))) ;; set birthdate to whatever user inputs | |
(if (and (< 7 (length birthdate)) | |
(> 9 (length birthdate))) | |
(let ((sum 0) list day month year safadeza) | |
(progn | |
(setq list (split-string birthdate "/")) | |
(setq day (string-to-int (nth 0 list))) | |
(setq month (string-to-int (nth 1 list))) | |
(setq year (string-to-int (nth 2 list))) | |
(while (> month 0) | |
(setq sum (+ sum month)) | |
(setq month (1- month))) | |
(setq safadeza (+ sum (* (/ year 100.0) (- 50 day)))) | |
(message (format "voce é %s safado e %s anjo." safadeza (-100 safadeza))) | |
) | |
) | |
(message "por favor, digite o formato certo, animal") | |
) | |
) | |
) | |
(safadao) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment