This file contains hidden or 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
    
  
  
    
  | ;; Aufgabe 1 | |
| (defn abs [x] (if (< x 0) (* -1 x) x)) | |
| (defn newton [f f'] | |
| (fn [guess eps] | |
| (let [guess' (- guess (/ (f guess) (f' guess)))] | |
| (if (< (abs (- guess' guess)) eps) | |
| guess | |
| (recur guess' eps))))) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | (use 'clojure.repl) | |
| (set! *print-length* 10) | |
| ;; Wiederholung | |
| (defn ! [n] | |
| (if (= 1 n) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ;; Aufgabe 1 | |
| (defn succ [n [a b c]] | |
| (let [p (+ (* a 4) (* b 2) c)] | |
| (comp {true 1, false 0} bit-test) n p)) | |
| (defn muster [c] | |
| (partition 3 1 (concat [(last c)] c [(first c)]))) | |
| (defn line [n c] | |
| (map (partial succ n) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | ;; Aufgabe 1 | |
| (range 100 -101 -1) | |
| (filter even? (range 0 1001)) | |
| (take-while (fn [x] (< x 1001)) (map (fn [x] (* x x)) (iterate inc 0))) | |
| (for [n (range 1 1001)] [n (inc (* n n))]) | |
| (let [x (range 10)] | |
| (for [a x b x c x :when (< a b c)] [a b c b a])) | |
| ;; Aufgabe 2 | 
  
    
      This file contains hidden or 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 repl.core | |
| (:use clojure.repl)) | |
| (def ntype (fn [e] (.getSimpleName (type e)))) | |
| (ntype "foo") | |
| (type "foo") | |
| (set! *print-length* 10) | |
| (iterate inc 0) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | (use 'clojure.repl) | |
| (doc source) | |
| (doc doc) | |
| (source doc) | |
| (apropos "map") | |
| ;; ---------- Strings | |
| "foo" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | span.cm-nothing{ | |
| color: #000 !important; | |
| } | |
| span.cm-type{ | |
| color: #990000 !important; | |
| } | |
| span.cm-logical{ | |
| color: #FF9966 !important; | 
  
    
      This file contains hidden or 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 apple.core) | |
| (def colors [StdDraw/BLUE StdDraw/CYAN StdDraw/GREEN StdDraw/MAGENTA | |
| StdDraw/ORANGE StdDraw/PINK StdDraw/RED StdDraw/BLACK]) | |
| (defn sqf [f x y] (f (* x x) (* y y))) | |
| (defn step-fn | |
| ([[x y]] (step-fn x y x y 0)) | |
| ([x0 y0 x y n] | 
  
    
      This file contains hidden or 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
    
  
  
    
  | Check out README.md to get started editing Clojure with Emacs. | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import java.util.LinkedList; | |
| import de.be4.classicalb.core.parser.BParser; | |
| import de.be4.classicalb.core.parser.analysis.ASTPrinter; | |
| import de.be4.classicalb.core.parser.analysis.DepthFirstAdapter; | |
| import de.be4.classicalb.core.parser.exceptions.BException; | |
| import de.be4.classicalb.core.parser.node.AOperation; | |
| import de.be4.classicalb.core.parser.node.Start; | |
| import de.be4.classicalb.core.parser.node.TIdentifierLiteral; |