hundredrabbits / Orca-c

Live Programming Environment(C Port)
http://wiki.xxiivv.com/orca
MIT License
482 stars 48 forks source link

Bang operator behavior #67

Open heuripedes opened 4 years ago

heuripedes commented 4 years ago

From Orca's README:

  • bang: Bangs neighboring operands

In both Orca and Orca-c the bang operator * actually only bangs the western and northern neighbors. Other bang sources such as D and F, even when wired with J or Y, as well as a Held * seem to behave in ways similar to the documented in the Orca README.

Input:

11111
1.n.1
1w*e1
1.s.1
11111

Expected output after one tick/frame:

11111
1.*.1
1*.*1
1.*.1
11111

Actual output after one tick/frame:

11111
1.*.1
1*.e1
1.s.1
11111

Disclaimer: I'm writing a clean room (no code from the original) minimal Orca clone with no support for integration with other programs.

eelfroth commented 4 years ago

@heuripedes interesting corner case. it makes sense though when taking into account that orca is executed sequentially from top/left to bottom/right. in your example, n and w execute before the *. then * erases itself, and by the time e and s execute there is no more bang to trigger them.

heuripedes commented 4 years ago

The way you describe the behavior makes it seem to me that all the * does is delete itself when executed and it's the surrounding cells responsibility to self-bang when near a *, but if that was the case one wouldn't be able to bang : from the left as by the time it gets executed the bang no longer exists.

    .D.
     *:abcde
npisanti commented 4 years ago

D, F and U lock their outputs so * can't disappear (it is deleted by those operator when the output should be empty)