(Arne Babenhauserheide)
2013-08-16: moved the unicode fun into its own file. moved the unicode fun into its own file.
diff --git a/d6.w b/d6.w --- a/d6.w +++ b/d6.w @@ -17,34 +17,6 @@ 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 diff --git a/unicode-math-fun.w b/unicode-math-fun.w new file mode 100644 --- /dev/null +++ b/unicode-math-fun.w @@ -0,0 +1,33 @@ +#!/home/arne/wisp/wisp-multiline.sh +; !# + +;; Having fun with unicode and math :) + +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