(Arne Babenhauserheide)
2013-08-16: added some unicode math fun. added some unicode math fun.
diff --git a/d6.w b/d6.w
--- a/d6.w
+++ b/d6.w
@@ -17,6 +17,34 @@ define : check skill target effect-thres
. #t
. #f
+define : Σ . n
+ apply + n
+
+define : ∪ . lists
+ apply append lists
+
+define : ∩ list1 list2
+ let : : h : make-hash-table
+ let fill : : toadd list2
+ when : not : equal? toadd '()
+ hash-set! h (list-ref toadd 0) #t
+ fill : list-tail toadd 1
+ let loop : (inboth '()) (tocheck list1)
+ if : equal? tocheck '()
+ . inboth
+ let : : cur : list-ref tocheck 0
+ if : member cur list2
+ loop
+ append inboth : list cur
+ list-tail tocheck 1
+ loop inboth : list-tail tocheck 1
+
+display : Σ 1 2 8 0 5 7 59 12 5
+newline
+display : ∪ '(1 2 3) '(4 5 6)
+newline
+display : ∩ '(1 789 7 897 89 78 78 97 89 2 3 6) '(4 5 6 2 8 7 879 879 879 879 8797 97 97 987 89789 7 7897 987 897 987 87 897 896)
+newline
display : check 12 9 3
newline
display : roll