« first day (2 days earlier)      last day (1394 days later) » 

12:07 PM
@TheNumberOne yeah, it's not too difficult manually
+->< becomes )({} and then you just need to get the layout right to implement the loops. doing that automatically might be a bit trickier, but in essence it will be similar to the BF to MarioLANG conversion.
@Sp3000 I've had an idea for ': pop a value and push the character codes of its string representation. I'm not entirely sure how useful it would be though.
 
Er... wait how does that work?
 
say you've got -105 on the stack, then ' would push 53 48 49 45 onto the main stack (the 45 on top)
 
Considering there's output as num, I don't see much of a use case
 
hm, I thought one might want to read input with ? instead of . sometimes, because it gives a different EOF, but it's not too useful. alternatively, it gives you a simple base-10 converter although that shouldn't be too much of a pain to do yourself either
well I'll leave it until I actually come across a case where I want to use it
 
I think base 10 convert should just be something you do yourself
 
12:22 PM
yeah, fair point
hm, I've been trying to golf tac... I've got three 15-byte solutions now but can't seem to beat that
 
You could make ' push char code I guess, but with the *10+ thing it's probably not necessary
 
@Sp3000 I'm not sure what you mean
 
e.g. 'a -> 97, but that's only one shorter than _97 hence the "might not be necessary"
Not sure if it's any more readable though
 
oh right, well that's a problem, because with that I can no longer have unrecognised characters (i.e. letters) as walls
or rather, it depends on the current context if a cell is a wall or not
 
Does your 15 tac handle NULs?
 
12:30 PM
yes
it only ends at EOF (returned as -1)
I've got 4 variants now...
 
@MartinBüttner This pastebin has a mapping for each BF command: pastebin.com/q7SZaYFx
 
oh, cool
@TheNumberOne you don't need to make - so complicated. modulo should work correctly for negative numbers
 
% pops y, pops x, pushes x%y (modulo; the sign of the result is the same as the sign of x).
 
oh right, that's a typo
thanks
 
I haven't tested any of what I wrote, so use at your own risk :)
 
12:38 PM
I'm not sure it works correctly. wouldn't it enter any loop at least once?
 
Damn I thought I had 12, but it doesn't handle NULs at the start
 
The top two rows of lines are for jumps to other parts of the code.
 
@Sp3000 do you have 15?
 
Not yet, working on it
 
@TheNumberOne the top row is where the instruction pointer is initially though, right?
 
12:51 PM
:/ I'm having a lot of trouble getting this to work for starting NULs
 
@MartinBüttner Sorry, I meant bottom two.
 
@TheNumberOne right... but in the left bracked, you just pass straight through when first entering it, right?
 
Look at the character directly below the third "
 
ohh, that somehow looked like it was a row below
but doesn't that mean it enters the loop when the current cell is 0, and skips it otherwise?
@Sp3000 13!
 
:/ are you suuuure yours handles NULs right? :P
 
12:59 PM
I don't see why it wouldn't
it's a bit tricky in powershell to test though
might fire up my Ubuntu VM later
wait...
I think you have a point :/
I'm correctly reading NULs, but I stop printing at the first NUL in the reversed string... crap
 
@MartinBüttner Looks like I got the zero and non-zero mixed up for both brackets.
 
;)
I have 21 for NUL-handling, I believe
 
18, I think (based on my 13)
ah no, doesn't work
hm, I think I need to try a different approach
 
Still 21 - I can't seem to compress this 3x3 loop or it'll all turn funny :(
 
16
(untested on 0, but I think it should work now)
 
1:15 PM
Do you do any ><v^? I still don't get how to use those effectively
 
no I don't
I'm not sure they are useful in these small golfs
I just have very tight loops
 
Maybe with a logical not
 
hm no, not using that either
 
You don't have one though :P
 
oh, I thought you meant bitwise
I've got 4 lines, 2 spaces, 3 nops btw
 
1:17 PM
3 lines, 5 spaces, 5 nops
:/
@MartinBüttner Okay, I give up - what do you have? :)
 
1:49 PM
  (}
.)),
"{@
""
@Sp3000 ^
 
... I forgot I don't have to start on the top left :P
 
ohhh, right
 
Damn everything's so tight
So where does it start - the top (?
 
yes
first non-wall in reading order
going right
 
,)"";#@
(" " }
   "{.
Yeah I don't think I can adapt mine like that :P
 
1:59 PM
uh... now that I see yours I have no clue why I'm shifting everything to the auxiliary stack o.O
 
Er... I thought it was so you can do your fancy tight looping XD
 
haha no. for some crazy reason I initially thought I needed that to reverse the string. which is kinda stupid :D
 
:P
Does that actually help save anything though?
 
hm, I don't know
 
2:18 PM
@MartinBüttner Your cat needs more golfing :P
 
lol, I know :D
I thought it looked nice like this though ;)
also, I just discovered the () trick an hour ago :P
 
,)@
.(
But... 5 6 chars D:
 
"but"?
(this is nice :))
 
The "but" is in response to "I thought it looked nice like this though ;)"
 
haha, okay
 
2:23 PM
What are you two working on?
 
golfing in Labyrinth
 
golfing what?
 
tac and cat
 
ah, okay :)
 
@Sp3000 I've got 15 for tac when exiting with an error, but if we allow that we can probably golf it a lot further, because we don't need @ at all
 
2:24 PM
how do you tell when you hit end of input?
 
Ruby returns nil at EOF, which I translate to -1 in Labyrinth
 
NULL?
 
:P I've never been a fan of the error thing personally, but I guess
 
(actually only , returns -1. ? returns 0 instead)
@Sp3000 neither have I
 
btw the 12 byte which assumed no NULs was
,);""
(" ."@
NULs ruins everything though :/
(I think you could probably do better than that as well :P)
 
2:31 PM
Tac:
,){(.@
}" "{
12 bytes
 
Is that the no-NULs version or does it work with NULs?
 
should work with nulls
 
Hmm doesn't seem to...
Yeah NULs mess up the print loop
 
@TheNumberOne heh, I just started experimenting with a read loop that only increments but doesn't decrement
 
@Sp3000 Oh, I see :(
 
2:37 PM
Somehow, I feel like I'm programming in Half Broken Car in Heavy Traffic, except this is a lot easier
 
wow that looks terrifying :D
 
,)"{"@
}" .(
 
Infinite loops :(
 
how ?
 
it prints an infinite number of NULs at the end
once { moves a 0 over the instruction pointer heads back down
 
2:43 PM
:(
,)1"{@
}" .(
Maybe?
 
Outputs a single SOH when the input is a single NUL
:(
 
oh, I see the problem.
,)1{@
}".(
This time, just maybe?
Nevermind.
 
Fails same test case :/
@MartinBüttner Your Fibonacci takes a while to run :(
 
does it?
it's not a sequence generator
it takes an integer as input
 
Either that or I'm doing something wrong
 
2:54 PM
@MartinBüttner You need diodes, cells that can be passed through only one way.
 
Okay, seems to be like this
1) Works fine piping in a file with a trailing newline
2) Errors when piping in a file without a trailing newline
3) Kinda screwy when I enter a number via shell and end the number by hitting Enter for newline
 
cat:
,)@
.(
 
hm, I see... I only tested echo 5 | ruby ...
36 mins ago, by Sp3000
,)@
.(
 
hifive we both beat Martin
(bet he wasn't trying :P)
Actually, for 3) I need to hit Enter twice for it to run
 
@TheNumberOne hm, would probably be convenient, but I don't really want any control flow that depends on cell types (other than wall/non-wall)
 
2:58 PM
ok
 
finally...
tac in 15:
   ":
@;`),
 (.
 
where does it start?
 
at the nop
first non-wall in reading order
 
now let me try using the aux stack
 
3:02 PM
,);""@
"" .(
nvmind
,);""
"" (.@
Won't work for an empty input.
 
,)"";@
:" .(
 
1?){{=+
  "   "
  ((}:}
@!;
^^ Fib
 
10:
,)";@
:".(
2
 
Nice :D
That's... pretty screwy
 
Now, how can we get it shorter?
 
3:11 PM
it's not far from TNO's second to last attempt
 
@MartinBüttner It seems as if it would keep going straight after . is executed at end of stack.
 
@TheNumberOne nope, there's a positive copy on the stack as well
 
afk for a bit
 
Hmm ~ feels like it could be a good alternative to ) if you need left turns instead of right turns
1?){{"
  "  =
  ((}+
@!; :
I shaved a byte by doing something stupid with the colon o_O
 
3:29 PM
@Sp3000 interesting
 
Martin's Hello World looks funky
So many dead-end corridors
 
heh, I wrote that before starting to implement the interpreter
I was very happy that it worked exactly as intended :D
it's probably shortest without loops
just push the numbers and print them with 13 .s
 
Doing :P
(but I wrote it all backwards on my first try :/)
 
lol me too
 
33_100_108:}_114_111:}_87_32_44{{:_101_72.............@
Well... that's a start
 
3:44 PM
you can save 5 bytes on top of that
 
72.101.108::}..111:}.44.32.87.{.114.{.100.33.@
That was a bit more than 5
 
uhhh... right
and I thought I was really clever -.-
 
You know, without the _s, stack shifting doesn't save anything
Yeah 72.101.108:..111.44.32.87.111.114.108.100.33.@ same length
 
my idea was this:
33_100_108:}_114_111:}_87_32_44{{:_101_72.......
@
 
XD
 
3:50 PM
@Sp3000 that's kinda lame :D
 
Well too bad :P
 
my technique can be used to print palindromes though :D
 
What, palindromic in terms of code points?
 
ah wait yeah I forgot about that
 
You can print... drumroll... moo :D
And bee
 
3:58 PM
:D
and acc
 
Basically 99, 101, 111
 
you can probably do more with upper case letters
 
If you mix case, yeah maybe
67.79.77.
@
Good enough.
 
66.111.
.
@
Even length words not any better :/
So, unfortunately, not much of a use case for your neat trick :D
 
4:11 PM
T_T
 
Oh, there's a single 6 letter
67.79.99.
.
@
... yeah that's all I've got :P
Here's yes golfed a bit more:
12
.
01
 
neat :)
I really want to post some of these to the relevant challenges, but I'd prefer to kick it off with an answer to a current challenge where Labyrinth is a valid language :/
 
:(
 
let me figure out your fibonacci
 
It's pretty similar to yours
I'm still having trouble figuring out the best way to do loops
The junction thing is funky
 
4:28 PM
I'm glad it turned out to be an interesting mechanic :)
 
Well, it's more the fact that the first-recognised-char-is-the-starting-point that's screwing things over
e.g. I start off with 1? and I want to halt if zero, so that's going forwards
But for nonzero I turn right, and I need to somehow loop back to that junction again
I can't enter from the left because that's where the zero case (i.e. terminate) will be, so I can try and enter from the top...
... except that'll make the program start from a different place
Loop back here how
  |
  v     " <-- not going to work
1?";!@  "
  "     "
  """""""
 
yeah that's true
1?_";";!@
   1 "
   """
I guess that might work in principle, but it's expensive
1
?
1;";!@
" "
"""
 
Yeah, that's why I have a ) ( in there
 
hm, one longer than yours:
)?
_
1;(;!@
_ "
{ }
{ :
=+}
ah wait
 
Hmm I'm having trouble inputting two ints
 
4:41 PM
you need to consume the delimiter with ,
 
Oh... I was doing newlines :/
 
)?
"
"(";!@
{ }
{ :
=+}
 
Hmm this still doesn't seem to be working, weird...
 
1
?
)((;!@
{ }
{ :
=+}
 
So.. no need to cater for 0 input for Fib? :P
... oh you shifted it up one
 
4:44 PM
huh?
 
Before you had F(10) = 89, now you have F(10) = 55
(not that it matters :P)
 
oh, right
so now it's 1-based again
 
:P anyway I think I might need to catch some sleep, getting late
 
no problem, goodnight!
 
GL with the snippet, looking forward to HW :)
 
4:48 PM
the snippet is done, I think
I'll either post it around midnight UTC (in about 7 hours) or about 10 hours later
 
4:59 PM
@Sp3000 20 bytes, 0-based:
})?
}
{{(;!@
= }
+}:
and the sequence in 13 bytes:
1
:!\
{ :
=+}
 
5:35 PM
I have implemented (but not golfed) FizzBuzz:
 )::}_101-@
 "       {
 "       :
 "       }_5%122:_117_66
 "          "          "
 "          """"";{"""""
 "                :
 "                }_3%122:_105_70
 "                   "          "
 "                   """"""1_""""
 "                        ;
""""""""""""""""""""""\!{;``{
;                           ;
\""""""""""""""""""""""""""""
 ."
there's now an annotated version in the repo
 
 
2 hours later…
7:45 PM
@Sp3000 I guess it could be useful for quines
then again I'm not a massive fan of adding a feature that is mainly used to simply quines
 
8:58 PM
@MartinBüttner Have you used the code modification features yet?
 
only for random numbers
oh I have an idea how I could use them to shorten the quine
I've golfed the quine by about 50% without that now (haven't pushed to github yet, though)
yeah, using code modification makes it quite easy to put the data on a single line
 
That's what I'm doing right now.
 
here is the new base:
 101_100_99_98_97_>
_
3
2
.
_
`"
`}";{();@
  1 : _.
  " _
  " (}
5."  ":_10
9    "   :
_~{;"/"=%}
 ~  "
 !"_(
which can still be golfed a lot
372 bytes
I think it gets even shorter if I put a < at the front
 
9:38 PM
287, still very golfable
this could actually be a pretty solid technique for golfing in Labyrinth in general
 
9:54 PM
228
 
 
1 hour later…
11:22 PM
@MartinBüttner Nice! Did you take your Prelude idea again or something? :P
 
@Sp3000 it's fairly similar, yes. push character codes of decoder; then the decoder first reconstructs the string that pushes the data and then prints itself using the data
 
:)
 
and using grid rotation significantly shortened the code :)
and it might generally be a way to work around the "start at first character in reading order" issue
 

« first day (2 days earlier)      last day (1394 days later) »