Closed samdoshi closed 8 years ago
certainly. perhaps the increment is happening before return?
On Tue, Apr 12, 2016 at 9:57 AM, Sam Doshi notifications@github.com wrote:
On a freshly booted up Teletype...
O prints 1 O 0 O prints 1
The docs indicate that it should return a 0. Want me to fix it?
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/monome/teletype/issues/37
It is, I just wanted to check which was wrong, the docs or the implementation.
How do you feel about renaming O.DIR
to O.INC
to indicate that it can have values other that -1
and 1
?
I'll update the changelog if I make the change.
INC makes more sense, agreed.
i think post-increment is also more understandable.
On Tue, Apr 12, 2016 at 10:14 AM, Sam Doshi notifications@github.com wrote:
It is, I just wanted to check which was wrong, the docs or the implementation.
How do you feel about renaming O.DIR to O.INC to indicate that it can have values other that -1 and 1?
I'll update the changelog if I make the change.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/monome/teletype/issues/37#issuecomment-208926317
Also spotted that FLIP
was using V_O
:
static void v_FLIP() {
if (left || top == 0) {
push(tele_vars[V_O].v);
tele_vars[V_O].v = (tele_vars[V_O].v == 0);
}
else {
tele_vars[V_O].v = (pop() != 0);
}
}
good catch!
On Tue, Apr 12, 2016 at 10:27 AM, Sam Doshi notifications@github.com wrote:
Also spotted that FLIP was using V_O:
static void v_FLIP() { if (left || top == 0) { push(tele_vars[V_O].v); tele_vars[V_O].v = (tele_vars[V_O].v == 0); } else { tele_vars[V_O].v = (pop() != 0); } }
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/monome/teletype/issues/37#issuecomment-208933778
O.DIR
renamed to O.INC
https://github.com/samdoshi/teletype/commit/a757a0c7b497fab5a0e8e47675d4fbd2615e0557
That's everything on this ticket, so I'm closing it
Have also updated DRUNK
to follow the same semantics (as per the docs)
DRUNK changes by -1, 0, or 1 upon each read, saving its state. Setting DRUNK will give it a new value for the next read, and drunkedness will continue on from there with subsequent reads.
https://github.com/samdoshi/teletype/commit/f720fced47edc762f5b656e49ddf08d8d1835ded
On a freshly booted up Teletype...
The docs indicate that it should return a 0. Want me to fix it?