Permalink
Browse files

Add basic (unimplemented) fingerprint support

  • Loading branch information...
1 parent 0c490e4 commit 21eba1fe4171d9676dd9c5f5b7eda6bc8105ad0f @palfrey committed Aug 20, 2012
Showing with 29 additions and 0 deletions.
  1. +29 −0 src/clostridium/core.clj
View
@@ -352,6 +352,19 @@
)
)
+(defn makeFingerprint [nb]
+ (let [
+ {:keys [b item]} (removeFromStack nb)
+ {:keys [b items]} (removeManyFromStack b item)
+ fingerprint (reduce #(+ (* 256 %1) %2) 0 items)
+ ]
+ {
+ :b b
+ :fingerprint fingerprint
+ }
+ )
+)
+
(def initialInstructions
(merge
numberInsts
@@ -651,6 +664,22 @@
)
)
+ \( (fn [nb]
+ (let [{:keys [b fingerprint]} (makeFingerprint nb)]
+ (do
+ ;(println "Begin Fingerprint" fingerprint)
+ (reflect b) ; FIXME: unimplemented
+ )
+ )
+ )
+ \) (fn [nb]
+ (let [{:keys [b fingerprint]} (makeFingerprint nb)]
+ (do
+ ;(println "End fingerprint" fingerprint)
+ (reflect b) ; FIXME: unimplemented
+ )
+ )
+ )
}
)
)

0 comments on commit 21eba1f

Please sign in to comment.