Turing-Complete-Game / Suggestions-and-Issues

0 stars 0 forks source link

[Bug]: ALPHA: Incorrect error message with unconnected enable output in 'Little box' #191

Closed MutexRaceCondition closed 1 month ago

MutexRaceCondition commented 2 months ago

Discord Thread

https://discord.com/channels/828292123936948244/1276640884242382858

What happened?

The message "Output should not be enabled" is not correct.

Version

0.1125

What OSes are you seeing the problem on?

Windows

Relevant debug.log output, search next to the exectuable

No response

Stuffe commented 1 month ago

fixed next patch

mizar commented 6 days ago

maybe still broken. It appears that the process of casting a boolean to an int produces a value of -1.

diff --git a/campaign/ram_component/test.si b/campaign/ram_component/test.si
index 2191b10..f3b7ef4 100644
--- a/campaign/ram_component/test.si
+++ b/campaign/ram_component/test.si
@@ -29,13 +29,13 @@ def get_input(tick: Int, $inputs: [Int], $scratch_space: [Int]) {
             save = 1
             load = 0
             add_1 = (tick / 2) & 1
-            add_2 = <Int> ((tick / 2) > 1)
+            add_2 = <Int> (<U64> ((tick / 2) > 1))

         } else {
             save = 0
             load = 1
             add_1 = (tick / 2) & 1
-            add_2 = <Int> ((tick / 2) > 1)
+            add_2 = <Int> (<U64> ((tick / 2) > 1))
         }
     }

@@ -52,7 +52,7 @@ def get_input(tick: Int, $inputs: [Int], $scratch_space: [Int]) {
     inputs[4] = value
 }
 def check_output(tick: Int, inputs: [Int], outputs: [Int], $scratch_space: [Int]) TestResult {
-    let output_enabled = <Int> (outputs[1] > 0)
+    let output_enabled = <Int> (<U64> (outputs[1] > 0))
     if inputs[0] != output_enabled {
         if inputs[0] == 0 {
             set_error("Output should not be enabled.")