Skip to main content
deleted 5 characters in body
Source Link
Zero Fiber
  • 640
  • 3
  • 12

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (or (= j 0) (= j (dec n)))) "N" " "))
    )
    (printf "\n")
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (or (= j 0) (= j (dec n)))) "N" " "))
    )
    (printf "\n")
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (= j 0) (= j (dec n))) "N" " "))
    )
    (printf "\n")
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))
Remove debug statements
Source Link
Zero Fiber
  • 640
  • 3
  • 12

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (or (= j 0) (= j (dec n)))) "N" " "))
        (inc j)
    )
    (printf "\n")
    (inc i)
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (or (= j 0) (= j (dec n)))) "N" " "))
        (inc j)
    )
    (printf "\n")
    (inc i)
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))

#2007 - Clojure

Clojure is a general-purpose programming language with an emphasis on functional programming. It is a dialect of the Lisp programming language. It runs on the Java Virtual Machine, Common Language Runtime, and JavaScript engines.

You can find a online Clojure REPL at Try Clojure. It also includes a short tutorial on the basics of Clojure.

###Task 1

(println "Clojure was made in 2007!")

###Task 2

(defn ascii [n]
  (doseq [i (range 0 n 1)]
    (doseq [j (range 0 n 1)]
        (printf (if (or (= i j) (or (= j 0) (= j (dec n)))) "N" " "))
    )
    (printf "\n")
  )
)

(ascii (read))

###Task 3

(defn gcd [a b]
    (if (zero? b) a (recur b (mod a b)))
)
(println (gcd (read) (read)))
Had Removed @alephalpha edit by accident. Readding that edit.
Source Link
Zero Fiber
  • 640
  • 3
  • 12
I think the snippet won't detect if this is the wrong way around
Source Link
Sp3000
  • 62.3k
  • 13
  • 117
  • 292
Loading
Added Description
Source Link
Zero Fiber
  • 640
  • 3
  • 12
Loading
edited body
Source Link
alephalpha
  • 52.3k
  • 7
  • 75
  • 198
Loading
Source Link
Zero Fiber
  • 640
  • 3
  • 12
Loading