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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; 59 | |
(fn [& args] | |
(fn [& coll] (for [fun args] | |
(map fun coll)))) | |
( | |
(fn [& fns] | |
(let [result (fn [& coll] |
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
(ns tic-tac-toe.core | |
(:gen-class)) | |
(def board (atom [["_" "_" "_"] ["_" "_" "_"] ["_" "_" "_"]])) | |
(get-in board [1 2]) | |
(def player1 "X") | |
(def player2 "O") |
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
(defn parse-int | |
[number] | |
(map read-string (map str number))) | |
(defn interpret | |
[input base] | |
(let [s-coin (parse-int input)] | |
(loop [total 0 | |
remain-nums s-coin] | |
(println total remain-nums) |
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
(ns calculator.core | |
(:require [cljsjs.react] | |
[cljsjs.react.dom] | |
[clojure.string :as str])) | |
(defn element [type props & children] | |
(js/React.createElement type (clj->js props) children)) | |
(def vdom (element "div" {} | |
(element "p" {} "Hello from React") |
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
(ns calculator.core | |
(:require cljsjs.react | |
cljsjs.react.dom)) | |
(defn element [type props & children] | |
(js/React.createElement type (clj->js props) children)) | |
(def vdom (element "div" {} | |
(element "p" {} "Hello from React") | |
(element "img" {:src "/parrot.jpg"}))) |
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
void init(void) | |
{ | |
int f = (d * d) - 1; | |
int grid [d][d]; | |
for (int i = 0; i < d; i++) | |
{ | |
for (int j = 0; j < d; j++) | |
{ | |
grid[i][j] = f; | |
f--; |