Orca-c icon indicating copy to clipboard operation
Orca-c copied to clipboard

Bang operator behavior

Open heuripedes opened this issue 4 years ago • 3 comments

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.

heuripedes avatar May 30 '20 15:05 heuripedes

@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.

eelfroth avatar Jun 22 '20 13:06 eelfroth

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

heuripedes avatar Jun 24 '20 14:06 heuripedes

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

npisanti avatar Jun 24 '20 19:06 npisanti