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
# -*- coding: utf-8 -*- | |
import yaml,re | |
import logging | |
import logging.handlers | |
import traceback | |
import random | |
import datetime | |
import time | |
try: |
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
;; 1 | |
(defn factorial [n] | |
(loop [ret 1 x n] | |
(if (zero? x) | |
ret | |
(recur (* ret x) (dec x))))) | |
;; 2 | |
(defn factorial2 [n] | |
(reduce * (range 1 (+ n 1)))) |
NewerOlder