summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-15 18:15:15 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-08-15 18:15:15 +0200
commit3a910e2df9bb71e0a1601e3be9367278bf6f897f (patch)
treec211f646c87a2459ad921ee9e9d8f71a037cdf84 /data
parent9db1108195fe6c2572005c3eb338c14b445fee3b (diff)
Fixes issue with computational switch.
Diffstat (limited to 'data')
-rw-r--r--data/examples/monster_battle/include/progress.fate2
-rw-r--r--data/tests/conditionals.fate197
2 files changed, 148 insertions, 51 deletions
diff --git a/data/examples/monster_battle/include/progress.fate b/data/examples/monster_battle/include/progress.fate
index 3db8884..12b35d0 100644
--- a/data/examples/monster_battle/include/progress.fate
+++ b/data/examples/monster_battle/include/progress.fate
@@ -2,4 +2,4 @@
(require types/tag.fate)
-(global (list tag) progress)
+(global (set tag) progress)
diff --git a/data/tests/conditionals.fate b/data/tests/conditionals.fate
index 82168ac..0728cbc 100644
--- a/data/tests/conditionals.fate
+++ b/data/tests/conditionals.fate
@@ -1,5 +1,6 @@
(fate_version 1)
+(global (list int) test_list)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; COMPUTATIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -45,58 +46,154 @@
)
FAILED: computation cond D
)
+(assert
+ (cond
+ ((false) (false))
+ ((true)
+ (cond
+ ((false) (false))
+ ((true) (not (is_member 3 test_list)))
+ ((true) (false))
+ )
+ )
+ ((true) (false))
+ )
+ FAILED: computation cond E
+)
+(assert
+ (cond
+ ((false) (false))
+ ((false) (false))
+ ((true)
+ (cond
+ ((false) (false))
+ ((true) (not (is_member 3 test_list)))
+ ((true) (false))
+ )
+ )
+ )
+ FAILED: computation cond F
+)
;; COMPUTATION SWITCH
-;; TODO: re-enable. Currently not implemented in Wyrd compiler
-;;(assert
-;; (switch 3
-;; (0 (false))
-;; (1 (false))
-;; (3 (true))
-;; (2 (false))
-;; (false)
-;; )
-;; FAILED: computation switch A
-;;)
-;;(assert
-;; (switch 3
-;; (0 (false))
-;; (1 (false))
-;; (2 (false))
-;; (true)
-;; )
-;; FAILED: computation switch B
-;;)
-;;(assert
-;; (switch 3
-;; (0 (false))
-;; (1 (false))
-;; (2 (false))
-;; (switch 2
-;; (0 (false))
-;; (1 (false))
-;; (2 (true))
-;; (false)
-;; )
-;; )
-;; FAILED: computation switch C
-;;)
-;;(assert
-;; (switch 3
-;; (0 (false))
-;; (1 (false))
-;; (2
-;; (switch 1
-;; (0 (false))
-;; (2 (false))
-;; (1 (true))
-;; (false)
-;; )
-;; )
-;; (false)
-;; )
-;; FAILED: computation switch D
-;;)
+(assert
+ (switch 3
+ (0 (false))
+ (1 (false))
+ (3 (true))
+ (2 (false))
+ (false)
+ )
+ FAILED: computation switch A
+)
+
+(assert
+ (switch 3
+ (0 (false))
+ (1 (false))
+ (2 (false))
+ (3 (true))
+ (false)
+ )
+ FAILED: computation switch A BIS
+)
+(assert
+ (switch 3
+ (0 (false))
+ (1 (false))
+ (2 (false))
+ (true)
+ )
+ FAILED: computation switch B
+)
+(assert
+ (switch 3
+ (0 (false))
+ (1 (false))
+ (2 (false))
+ (switch 2
+ (0 (false))
+ (1 (false))
+ (2 (true))
+ (false)
+ )
+ )
+ FAILED: computation switch C
+)
+(assert
+ (switch 2
+ (0 (false))
+ (1 (false))
+ (2
+ (switch 1
+ (0 (false))
+ (2 (false))
+ (1 (true))
+ (false)
+ )
+ )
+ (false)
+ )
+ FAILED: computation switch D
+)
+(assert
+ (switch 4
+ (0 (false))
+ (1 (false))
+ (4
+ (switch 44
+ (0 (false))
+ (2 (false))
+ (true)
+ )
+ )
+ (false)
+ )
+ FAILED: computation switch D BIS
+)
+(assert
+ (switch 4
+ (0 (false))
+ (1 (false))
+ (4 (not (is_member 3 test_list)))
+ (false)
+ )
+ FAILED: computation switch D BIS BIS
+)
+(assert
+ (switch 4
+ (4 (not (is_member 3 test_list)))
+ (0 (false))
+ (1 (false))
+ (false)
+ )
+ FAILED: computation switch D BIS BIS BIS
+)
+(assert
+ (switch 4
+ (0 (false))
+ (1 (false))
+ (3 (false))
+ (not (is_member 3 test_list))
+ )
+ FAILED: computation switch D BIS BIS BIS BIS
+)
+(assert
+ (switch 1
+ (0 (false))
+ (1
+ (switch 2
+ (0 (false))
+ (1 (false))
+ (2 (true))
+ (false)
+ )
+ )
+ (2 (false))
+ (false)
+ )
+ FAILED: computation switch E
+)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; INSTRUCTIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;