last day (483 days later) » 
03:00 - 22:0022:00 - 00:00

03:02
hah first message
Hello
If anyone sees this chat and has experience in two-dimensional languages, I'd like feedback on Triangular
03:17
Hello @LeakyNun
@MDXF hi
what is the file triangular for?
Oops it's the executable
for what
Deleted now
Well when you make it generates the interpreter executable
I see
03:19
I pushed without deleting / adding triangular to the .gitignore
I'll be making a PR in a few minutes
Okay, thanks
@LeakyNun Ping me when you PR
Oh :P
Thanks :-)
I'll be making another
but have you tested it before merging?
I may have a syntax error somewhere...
03:29
Yep I tested it, nothing messed up
good
can you tell me what buf will be, if the code is abc?
Darn I had some code in there that would print buf based on a command-line argument
but I removed it for some reason
I can't run C anyway
I just mean theoretically
buf[0] = "a" and buf[1] = "bc"
        if (x < 0)
            x = 0;
        if (y < 0)
            y = 0;
then why isn't there a similar wrapper for x > y?
03:31
Hm I never saw it being a problem since if buf[y][x] is 0 it will automatically terminate IIRC
And if x > y then buf[y][x] will be 0
but then why doesn't it terminate if you go west?
It does
If you go too far west
    if (buf[y][x] == 0)
        exit(EXIT_SUCCESS);
yeah I was right, I did put that catch in there
but if you go too far southwest, you won't terminate
1 min ago, by MD XF
    if (buf[y][x] == 0)
        exit(EXIT_SUCCESS);
buf is initialized to be filled with zeroes
        if (x < 0)
            x = 0;
        if (y < 0)
            y = 0;
if you go too far southwest, you'll be at [0][0], which would not be 0
if ((direction == 4 && x < 0) || (direction == 2 && y < 0) || (direction == 1 && (y < 0 || x < 0)))
    exit(EXIT_SUCCESS);
directions 4,2,1 are checked
03:35
I need an enum for directions...
but southwest is direction 6
Wait no
nah you just need constants
I can make them for you
in my next PR
Southwest is direction 6, direction 6 increments y
increments y
So travelling southwest will never get to [0][0]
oh you're right
03:37
Also I've got 50 test programs on my offline PC and I'll test all those late tonight with the new code so if there are any bugs in the code they won't go unnoticed for more than 12 hours
ok
right, I just found a bug.
caused by me.
Oh?
I thought the directions were arranged in a circular order
They are...
wait that's not circular
duh
if (x < 0)
    x = 0;
if (y < 0)
    y = 0;
what's this code for?
03:41
Error catching
'cause if either of those are less than zero it'll segfault
but they can't be
you already detected them beforehand
Yeah I think that's either a safety thing or a fallthrough from an old version
Don't remove it, I'll remove it tonight when I'm checking everything
  case '|': direction = SOUTH; break;
but in your docs it should be v
Where do I have that??
Is that really in there? *smacks head*
I changed the 7 to SOUTH
03:44
Ha well looks like I don't have one test case
No I know SOUTH = 7 but I was talking about the case '|'
I guess I never bothered to test v
Ping when PR
Also if you don't use a computer on which you can test C, I'd recommend using cloud9, it's what I use to pull/test C repos
@MDXF PR
<insert a bunch of const ints here> -> enum { UNDEF, NORTHWEST, NORTH, NORTHEAST, WEST, EAST, SOUTHWEST, SOUTH, SOUTHEAST};
Why introduce so much confusion with dx and dy?
    switch (direction) {
      case NORTHWEST:   dx = -1; dy = -1; break;
      case NORTH:       dx = -1; dy =  2; break;
      case NORTHEAST:   dx =  0; dy = -1; break;
      case WEST:        dx = -1; dy =  0; break;
      case EAST:        dx =  1; dy =  0; break;
      case SOUTHWEST:   dx =  0; dy =  1; break;
      case SOUTH:       dx =  1; dy =  2; break;
      case SOUTHEAST:   dx =  1; dy =  1; break;
    }

    x += dx * (skip + 1);
    y += dy * (skip + 1);
That's a bit less manageable than it used to be...
04:03
because I don't like how the skip works
like, seriously? You skip it one by one?
Well for one thing, the IP still needs to move if skip is nonzero
skip is not always true/false so x += dx * (skip + 1); is gonna really bork stuff up
@MDXF I know, which is why I put +1
@MDXF can you show me how?
skip may be any value
go on
Oh you broke that part :P
skip = (size && stack[size-1]);
skip needs to be stack[size-1], not stack[size-1] == true
04:07
wait a sec, fixing
what... how come 1&&0 is 0, 1&&1 is 1, and 1&&2 is 1?
@LeakyNun Because 2 evaluates to true
&& != ==
&& just checks if both values are nonzero
I thought && is like and in Python lol
Nope haha
    skip = skip < 0 ? 0 : skip;
Are you ok with this line?
@MDXF
When will skip ever be ... good point, that's a bug. Yeah that looks okay, where're you putting it?
04:15
just before
    x += dx * (skip + 1);
    y += dy * (skip + 1);
...I thought we were removing those lines
@MDXF PR fixed
@MDXF I intend those lines are not borked
and are equivalent with what you originally have
and are faster when skip = 10000
Yes but say dx = 1 and skip = 3. Won't x += dx * (skip + 1); evaluate to x += 1 * 4?
And we don't want x incremented by 4
Hmm... putchar(size ? stack[size-1] : 0); is not good, we don't want to print null bytes...
@MDXF what would x be incremented by instead?
@MDXF so just don't print anything?
Wait a sec
Oh it's all making sense now
Does x += dx * (skip + 1); automatically increment x to however many it should be if skip is not 0 or 1?
Like if skip = 4 then it'll skip the correct number of commands. Ohhh
And skip = 0; Yup yup looks great, sorry about that
04:22
@MDXF yes
My bad, I'm tired :P
@MDXF so what do we do here?
I'm still looking over the PR @LeakyNun
@LeakyNun I don't think these safety nets are necessary; if size < 1 then the compiler will just default stack[size-1] to 0
I thought stack[-1] is segfault
@LeakyNun I'm pretty sure it's not but I'll test it
@LeakyNun Nope, defaults to 0
04:30
@MDXF then what is this?
@LeakyNun Hm, I think it was my best guess as to why I put that useless code in there. Actually, I'm pretty sure that code was to prevent x or y going under 0, and then the error-check that exits if the code is empty later ... yeah never mind
and I still don't like stack[-1] being called...
It was useless
@LeakyNun Well neither do I...
but this
skip = (size ? stack[size-1] : 0) < 1;
If size isn't 0 then it just compares 0 < 1
Which is just a waste of the compiler's time
Maybe skip = size ? (stack[size-1] : 0 < 1) : 0
Actually I can just do that @LeakyNun do you have any more changes to make?
I'm going to merge your PR
@MDXF it's actually UB
@LeakyNun GCC/TCC/Clang (the only compilers you should use) really handle UB well
04:36
my conjecture is that if you do x[-1000] eventually you access non-zero addresses
@LeakyNun Okay yeah that seg-faults
But it will never get that low
@MDXF there's an obvious syntax error in your code
@LeakyNun Where?
Not in my code... I already tested it
follow my reply arrow
This? skip = size ? (stack[size-1] : 0 < 1) : 0
04:39
yes
Oh duh
skip = size ? (stack[size-1] < 1) : 0
Thanks
Anyway I'll implement a few things; can I merge your PR now?
@LeakyNun
@LeakyNun But still it will never get that low
        if (buf[y][x] == 0)
            exit(EXIT_SUCCESS);
So y and x will never get below -1
This too
if ((direction == WEST && x < 0) || (direction == NORTH && y < 0) || (direction == NORTHWEST && (y < 0 || x < 0)))
    exit(EXIT_SUCCESS);
@MDXF this is redundant, it wont get that low because it wont even be executed
and for other cases, it's your language, so you use UB at your discretion
Either way I'm removing the UB
Well, you removed the UB
Also for some reason your eight consts in the switch didn't work
but I fixed that with an enum
04:48
cool
I have no idea why those didn't work
triangular.c:73:13: error: case label does not reduce to an integer constant
maybe not global?
I think they were global
Ah well, I'll look into that some other time
I gtg in 6 minutes @LeakyNun so if there's anything else you'd like to bring up...?
@MDXF I'll just create 1000 PR's
you can discuss those with me when you come back
Nice :P I may make changes over"night" (depending on your timezone) but they won't be pushed 'till "tomorrow" morning, and they'll just be bugfixes
04:54
how many hours later?
Oh crap, I'm out of town tomorrow, just remembered
alright
I may not have time to do anything on GitHub until ... say in 20 hours, sorry
no problem
In that case I won't do anything overnight aside from tests. Thanks for the help
05:49
@MDXF you write ] move the instruction pointer back to the most recent ( if the ToS is > 0, but you only check stack[size-1]: what is the ToS is negative?
 
2 hours later…
07:39
@MDXF UB much
 
7 hours later…
14:09
@LeakyNun Then it shouldn't do anything; in Triangular, negative numbers act as falsy values
@MDXF yes, but in your code it doesn't.
your code checked for truthiness.
Oh crud
I'll check on that
I thought you are not available until 11 hours later
Neither did I but my flight got cancelled
oh...
my condolences
14:11
¯\_(ツ)_/¯
Fixed ]
did you check my code before merging it?
Yep
alright
There was one bug but I noticed it overnight and fixed it a few minutes ago
If the direction was North, dy was getting set to 2 instead of -2
 
6 hours later…
20:22
@LeakyNun I figured out why having a const int in a switch case didn't work, see this
21:15
@MDXF I think triangular may not be TC
@WheatWizard how so?
There isn't any arbitrary stack acess
What do you mean, like printing the non-top stack value?
You can't perform an action on the second value without destroying the top value
You can perform =
21:16
this doesn't necessarily mean its not TC, but its usually a sign
Thats not what I mean
A program that adds the 2nd item to the 3rd is impossible
Ohh yeah I meant to implement something like I did in Decimal
Gimme ten minutes
@DJMcMayhem Could you move these recent messages from me and WheatWizard to this room?
If it is TC its going to have to have a really strange memory representation
@WheatWizard what do you mean?
I might be able to make a quine anyway though
For example there is a subset of Brain-Flak called Microflak
Micro flak is technically turing complete,
Link?
21:20
there is no link
Its all on paper at the moment
Oh, you're writing it. ok
But the point is that Microflak is TC, but all data has to bre represented in binary because it can't distinguish between non zero numbers
That seems like a very complex language; I'm excited to see it
So if you want to say add two numbers, you have to pass the numbers in a really esoterric format, in order for the language to compute any thing
Yeah. Well, Triangular won't be that way, I'm adding "memory" like in Decimal
Decimal has one memory value and a stack
21:23
Its Brainflak without [...],<...>, (), or[]
How is that even possible?
Really esoterric input formats
What's a good name for a command that takes a value from a stack and puts it somewhere else without popping it?
stash?
sounds good
Like leave it on the board?
@MDXF I'll have to switch to my computer, just a sec
21:25
Yeah
how do you pick it back up?
For example, say we have two stacks: I need a name for a command to transfer the top of one stack to the other
@DJMcMayhem Okay, thanks
Where do you want me to start?
Without popping it
Ah like Klein's (...) ?
21:26
I guess so; never used Klein
ah ok
pull?
Yes that works
Maybe here? but if they don't need to be moved then don't bother
18 messages moved from The Nineteenth Byte
Okay, three commands to interface with the second stack (which is currently not even a stack but just a single memory value): Pop, pUll and Stash
How does one compile triangular?
21:30
make
Should that be in the README? Probably
Ah i didn't see the makefile
Does triangular strip whitespace like hexagony?
Yep
"Source code is read in the shape of the smallest triangle that the length of the code can fit into. Whitespace is ignored."
(emphasis mine) (text also mine lol)
       ,
      1 ,
     2 . .
    3 . . .
   4 . . . .
  5 . . . . .
 > . ( .%! / )
. > ( . . . . ]
What should that do?
No way, that's a quine??
Oh wait nvm haha
No its not
:p
21:33
It will push the values 1 2 3 4 5 to the stack, direct the IP east, uh... I think that's a bit messed up
> . ( .%! / )?
ah I see
thanks
Remove the . directly to the right of the (
Yeah
Changes pushed, it should be more TC now
P to pop ToS and store the popped value in memory, S to stash the ToS in memory without popping it, U to pull the memory onto stack
Should make stuff easier
           .
          \ .
         1 . .
        2 . . .
       3 . . . .
      4 . . . . .
     5 . . . . . .
    . . . . . . . .
   . . . . . . . . .
  / . . . . . . . . <
 . . p ~ * * 9 2 5 < .
. . . . . . . . . . . .
What should that do?
shouldn't it print Z ?
What is the 1 2 3 4 5 doing? it's never reached
Wait why not?
21:41
Wait nvm
whoops, sorry
I forgot the default IP moves by default lol
Just a second...
It seems to get stuck in an infinite loop, with no output
That's... strange
Looks like a bug
Try using the command-line options --verbose --display-code in that order
verbose will prettyprint the triangle, display-code will display the code as it reads it
            .
           \ .
          1 . .
         2 . . .
        3 . . . .
       4 . . . . .
      5 . . . . . .
     . . . . . . . .
    . . . . . . . . .
   / . . . . . . . . <
  . p ~ i * * 9 2 5 < .
 . . . . . . . . . . . .

.........<......../..54321\........<529**i~
21:45
so it does this: .........<......../..54321\........<529**~
hm....
very strange
It doesn't infinite-loop for me...
it reads a character and then exits
Oh
I didn't see that
same for me
~ reads a character
Oh you thought that was an infinite loop
21:46
Makes sense; that's more/less why I added --display-code
I'm dumb :p
Common mistake, np :P
if I change ~ to an @ I don't get any output sitll
Hm just a min
It prints a Z for me
21:48
try turning off --display-code :P
Its not on
And you don't see anything?
What character set is your terminal in?
character set?
ASCII, EBCDIC, etc
21:49
This is my --display-code: .........<......../..54321\........<529**@Zp..
the Z being the output
Huh then it should work
hm maybe I magically fixed a bug while not trying to fix a bug; pull maybe?
my display code is empty?
@WheatWizard It is??
I'm up to date
Hm
Is your display-code really empty?
Oh wait I forgot --verbose
21:51
Yeah sorry that's something I really need to fix
My display is the same
.........<......../..54321\........<529**@Zp..
Then it's working right
is it?
I'm not getting output
The Z is the output
but only when I put --display-code on?
21:53
I should use ANSI colors to make it possible to differentiate the output from the code
That's... quite strange
I get the same output without display-code, and display-code doesn't change anything in the interpreter
Ok well I'm going to try and ignore it
What system are you using?
OSX
My C compiler is super old if it makes any difference
Well for one thing OSX is trash... and what compiler?
21:55
Hm... version 4 or higher?
yes
Its not that old
Oh hey
it works in terminal
Yeah no difference when using gcc-4.8 for me
just not iTerm
Oh, what were you doing it in?
Oh
thats weird
21:57
Yeah. Freaking Apple...
actually it works in iTerm
just not fish
Never used fish
very nice
much better than bash imo
I prefer cmder for Windows and Zsh for Linux
I prefer fish for both OSX and Linux
21:59
Speaking of fish, is ><> 2-dimensional?
have you tested in ZSH?
If it doesn't work in fish it is likely to not work in Zsh
03:00 - 22:0022:00 - 00:00

  last day (483 days later) »