Skip to content

Instantly share code, notes, and snippets.

View Gaivile's full-sized avatar

Gaivile Gaivile

  • Remote
View GitHub Profile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 59
(fn [& args]
(fn [& coll] (for [fun args]
(map fun coll))))
(
(fn [& fns]
(let [result (fn [& coll]
@Gaivile
Gaivile / tic-tac-toe.clj
Created February 28, 2017 20:59
tic-tac-toe
(ns tic-tac-toe.core
(:gen-class))
(def board (atom [["_" "_" "_"] ["_" "_" "_"] ["_" "_" "_"]]))
(get-in board [1 2])
(def player1 "X")
(def player2 "O")
(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)
@Gaivile
Gaivile / core.cljs
Created November 12, 2016 15:07
Calculator Done
(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")
@Gaivile
Gaivile / core.cljs
Created November 12, 2016 13:51
Calculator
(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"})))
@Gaivile
Gaivile / init.c
Created July 18, 2016 21:37
Init() function for pset3 fifteen
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--;