source: scenarios/GerminationX/oak/src/oak/forms.clj @ 904

Revision 904, 946 bytes checked in by dave, 10 years ago (diff)

connected game world to fatima

Line 
1;; Copyright (C) 2010 FoAM vzw
2;; This program is free software: you can redistribute it and/or modify
3;; it under the terms of the GNU Affero General Public License as
4;; published by the Free Software Foundation, either version 3 of the
5;; License, or (at your option) any later version.
6;;
7;; This program is distributed in the hope that it will be useful,
8;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10;; GNU Affero General Public License for more details.
11;;
12;; You should have received a copy of the GNU Affero General Public License
13;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
15(ns oak.forms)
16
17(defn modify [what f thing]
18  (merge thing {what (f (what thing))}))
19
20(defn discard [l n]
21  (cond
22   (empty? l) l
23   (= 0 n) l
24   :else (cons (first l) (discard (rest l) (- n 1)))))
25
26(defn max-cons [o l m]
27  (cons o (discard l m)))
Note: See TracBrowser for help on using the repository browser.