last day (427 days later) » 

7:09 AM
We need a command for draw(x,y,direction,length) and drawFromPointer(direction, length)
Also rectangle(x, y, height, width), and polygon(point1_x, point1_y ...), plus the pointer versions, and multi-segment lines
Possibly
Also for this one we need to be able to take a string as an argument, and do an char in string
 
That's a thought. My proof-of-concept has commands move(direction), turn(direction), and put(character), as well as write(string, moves) that takes a string of characters and interleaves them with a string of moves.
One thing to do early on, I think, is collect a representative sample of ASCII-art challenges that we can test our ideas on.
 
The most important commands are probably move(direction[, steps]), clone and destroy
The most recent one, can be done in two lines, a rectangle and some arithmetic with print-string
 
I also think reflect will be useful, with arguments that determine the direction of reflection, and flags or versions for 1) whether the axis of reflection gets duplicated or not, and 2) whether characters get intelligently changed in the reflected version (e.g. swapping > for <)
 
Flags? I'd think just having them as separate commands would be golfier
so basically reverse, vreverse (vertical), reflect, vreflect, maybe rotate for fun
 
@ASCII-only Yes, until we run out of single-byte commands.
(By flags I meant something like R is reflect and !R is reflect and translate characters.)
 
7:17 AM
Then I'd thing ! there would be flip
so have it as R!
reflect -> flip most recent area
 
Maybe, but only if ! as "translate < to >, [ to ], etc." was a useful command in any other contexts. If its usefulness is mainly limited to reflections, then ! could be a metacommand that could do something different when applied to other commands.
 
Hmm, maybe
I think we should see how many commands we need first
 
Sure.
Here's my current thought: it will save a lot of bytes if we don't use printable ASCII characters for commands.
 
Not a good idea
 
(Much less trouble with quoting/unquoting to distinguish commands from data.)
 
7:24 AM
Just use a different code pages
 
That's what I meant.
 
Wait
Actually, that won't work
 
?
 
How do you tell them apart if they're both one byte
 
Allow a string to be printed vertically or horizontally
 
7:26 AM
@DJMcMayhem yeah, I'm pretty sure that was gonna be a feature anyway
basically print(string, direction)
 
Oh OK
Diagonally?
 
Yeah
And backwards
 
@ASCII-only Any character that is one of the 95 considered "printable ASCII" is data; any other character in the codepage is available for a command.
 
@DLosc Oh, okay
 
Overwriting a previous string?
 
7:27 AM
@DJMcMayhem I'm not sure why you would ever want to have it off
i.e. not overwriting
 
Huh?
 
All operations will be overwriting
Unless there's a reason for any not to be
 
Oh. Wait what memory model will it have?
 
@ASCII-only I'm not an expert in codepages, but so far I like the Jelly codepage because it has all 10 decimal superscript digits, allowing for numbers in the code to be distinct from numbers in the data.
 
And what paradigm will it be?
 
7:30 AM
@DJMcMayhem I'm envisioning an infinite plane, with a cursor that has (x,y) coordinates and direction.
 
@DLosc I think it depends, if we have too many commands to fit in the other chars (e.g. if we have too many arithmetic commands) it's gonna be shorter to just have quoting I think
 
@DLosc that sounds a lot like V
 
@ASCII-only Yeah, that's definitely TBD after experimenting. I imagine there will be some use for quoting or escaping.
 
@DJMcMayhem I'd think infinite plane, auto-print non-empty area on exit, plus scoped variables probably?
 
@DJMcMayhem Oh, does it? I haven't looked into V--just assumed it was a golfier version of VimScript.
 
7:32 AM
No, it isn't like vimscript at all. It's like vim keys
 
@DJMcMayhem I'm... not sure I know the distinction there either. [embarrassed]
 
If we want ascii-art verification as well (less important, they can take two chars because this it's not the main goal), this is a good testcase
We also should have transliterate I think
And repeat rectangle for this
 
@ASCII-only Ugh, that thing. Tons of edge cases to exclude. But yes, good test case.
 
@DLosc Edge cases?
 
@DLosc Vimscript is a full blown language (and not a very good one IMO) where as V is like an automated text editor with a lot of keyboard shortcuts
 
7:35 AM
@ASCII-only See my answer in one of the 2D pattern-matching languages:
0
A: Hexagolf: Validagons

DLoscSnakeEx, 200 bytes The right language for the job... sort of. m:{v<>}{r<RF>2P}{r<R>2P}{h<RF>1P}{w<>}{l<RF>2P}{l<R>2P}{h<.>1} w:{u<>P}{v<>} v:{e<L>}{u<R>1} u:.*{e<>} e:.$ r:[^ ]+ h:([^ ] )+ l:({c<.>}[^ ])+{c<.>} c:{b<B>}(. )+{x<>LP}{s<>} b:.{s<>} s:[^\!-\~]*$ x:. SnakeEx is a language from the...

 
And a theoretically infinite plane, a cursor, implicit output of the text, etc. Lots of ascii-art oriented features
 
I'd imagine we'd have a builtin for onHexGrid, possibly hexDimensions/decomposeHex and the equivalent for triangles and rectangles
@DJMcMayhem ?
We shouldn't have a cursor
we should have cursors
 
Probably half of that is ensuring there's nothing but spaces before the hexagon, nothing but spaces after the hexagon, no extra lines above or below, etc, etc. It was a bit of a pain TBH.
 
really useful for multiple lines of different length from one point
@DLosc Yeah, but this isn't gonna be 2d regex, it's gonna be ascii art focused
 
Right, I'm just saying that particular challenge is tricky to get right.
 
7:38 AM
@ASCII-only Oh I was just rambling on about my own language, sorry. I'll stop now. It's just a little weird to me since this language sounds really similar. (Although yours sounds more advanced)
 
@DJMcMayhem Haha, I was really confused
 
@DJMcMayhem I'm interested to look at V now, though. At least, it can give us ideas for this project, and at best, if it is really good, why reinvent the wheel?
 
We need hexagon rotation support as well
 
@DLosc I'm glad to hear that!
I will say though, it really really sucks at edge cases. The number one weakness
 
@ASCII-only This feels to me like overengineering to fit a few unusual testcases. Most ASCII art is pretty rectangular, so I think we should start there.
 
7:41 AM
@DLosc Hmm, maybe
But IMO we need at least a hexagon namespace
 
Lol ^_^
 
meaning anything prefixed withe a certain char gives the equivalent command for hexagons
 
Maybe a command-line flag changes everything from rectangular to hexagonal.
(Only half joking)
 
Hmm. That's a good example of why we need diagonal directions.
 
7:44 AM
What about printing in multiple directions?
 
@DLosc Yeah, diagonal directions are vital, the tent one needs them as well
@DLosc It's less common (plus I'd prefer to have no flags because it's weird posting bytecount and sometimes might stuff up the leaderboard) so having the hexagon namespace character at the start of the program should be fine IMO
@DJMcMayhem That's actually possible with one byte
 
@ASCII-only If you've seen my Pip answers, you know I'm pretty fond of flags, but I'm willing to be persuaded.
@ASCII-only It is?
 
I mean having any combination of directions
since 1 byte = 8 bits
so as long as we set aside a mandatory char for direction, it would work
 
Interesting.
 
@DLosc Well, if you ever want to look into V more, or you're looking for inspiration, it's got a chat room where I'd be happy to answer any questions you have. It's pretty late, so I'm gonna go to bed now, but I'm really curious to see what you guys come up with!
 
7:48 AM
or have another command with mandatory direction
 
@DJMcMayhem Thanks! Yeah, I should turn in too. Good night!
 
@DLosc pls read tomorrow if you can
We will have rotate, and may want toroidal move for this‌​, but idk how to make the vertical toroidal move for the 3-face stack wrap to the far right face
I'm think we'll always need direction so print will be print(direction, length[, character=one of /\-|]), or print(direction, string), we may want print2d(direction, length[, character][, fill][, rhombus]) and print2d(direction, string[, fill][, rhombus])
This way we can do a string cube with back going up and to the right with print2d(0b01001010, 0x01000000, input) (assuming directions are every 45 degrees clockwise from north, the second arg will possibly be a mandatory argument with boolean command variations
We need to decide on the syntax, because I think we need string print with length as well for things like this
Not sure if we want to have intersections (i.e. an option for print to print + and X where two lines cross, IDK if there are appropriate characters for different combinations)
this one would need hexagon mode, print 4 with radius input, direction 0b11111100, print 3 with radius input, with flag corners_only, decrement input, print 6 with radius input
I think we should have a toggle char for box chars for fun
Like what we might do for hexagon mode
Definitely not gonna help for any challenge though
for this I can't think any good, general ways to do it, any builtins we introduce will probably just be a waste of characters
 
 
6 hours later…
1:51 PM
also random may be needed for bassdrop cumberwubwub's new challenge
 
 
6 hours later…
8:13 PM
Reactions:
The "print in multiple directions at once" idea is not something I had thought of, but I think it's promising, can be applied in multiple challenges.
The idea of multiple cursors is also intriguing--I'd say let's design it with one cursor first, and then see whether allowing multiple cursors ends up saving bytes (by simplifying algorithms) or costing bytes (by requiring more-complicated cursor management commands).
(And "print in multiple directions" seems more straightforward with multiple cursors.)
"Option for print to print + and X where two lines cross"--sounds cool but unnecessary in 95% of problems--low priority.
Hexagon mode: I'll stick to rectangular mode and let you work on that. :P It will be a useful feature if hexagon-themed challenges keep cropping up, but let's just say there's a reason I haven't tried to learn Hexagony.
Agreed: cool, optional, low priority.
 
8:49 PM
Random:medium-low priority. It seems like it should be a useful feature, but actually I can't recall a lot of ASCII-art challenges that use it.
 
9:33 PM
@DLosc I'd think duplicate/delete cursor are the only ones we really need
 
9:48 PM
This would need hexagon mode, write string, all six directions, fill (can also be applied to ractangle mode)
For this I think we can just do a triangle, reflect on the NE/SW axis, merging the edge, do the same for vertical and horizontal axes
The direction byte for reflect will have three bits for the 8 directions, the axis will be that way from the pointer, and perpendicular to the stated direction (I don't think we need multiple directions)
 
@ASCII-only Yeah, the Scrabble board will be really straightforward with reflections.
 
Oh, found a good one
 
@ASCII-only Re: cursors, if you have multiple cursors active at once, don't you need commands to switch between them? (Kinda like in Hexagony.)
 
@DLosc No, I'm thinking of having just one active at a time
Say you have one at the origin, right?
 
K
 
9:56 PM
Clone -> draw something
Then once you delete you still have the original one at the origin, which may save bytes you'd otherwise need to use to move it
 
Aw dammit, I was going to design a language like this :D
Well actually, I tried and then gave up quite soon after
 
@BetaDecay Wanna join us?
@ASCII-only Ah, I get it now.
 
@BetaDecay Do you have it on GH or something?
 
@DLosc I might add a few ideas here and there, but I won't be too involved in the process :)
@ASCII-only I didn't even get that far. I started on the interpreter and stopped soon after
 
Any ideas for the syntax? Prefix? Postfix?
 
10:07 PM
@ASCII-only Yes, I think these are the kind of decisions we need to make first
I have a slight preference for prefix, but it depends on the paradigm of the language, too.
Imperative? Stack-based?
 
@ASCII-only I prefer prefix because it makes more sense
And if this is going to be a golfing language, I imagine a stack will help
 
Stack of what?
 
Stack of 2D strings
And numbers and/or objects
 
When would a stack of 2D string be useful
And what do you mean by objects
 
Well like in Python 3, how zip() and range() return objects
But I'm just throwing ideas in here
 
10:14 PM
So
What memory model should we have
Stack vs Tape vs Scope
 
This does bring up a question: we've talked about writing stuff on an infinite plane (what I've been mentally calling a "canvas"). Do we want to have the ability to create multiple canvases, draw different stuff to each of them, copy/reflect/rotate them, and then stitch them together somehow?
@ASCII-only I don't know that a tape will produce very golfy code. Either stack or store-stuff-in-variables (I assume that's what you mean by "scope") for me.
 
@DLosc Maybe, but I don't imagine it would be too useful
@DLosc Wait I mean registers
No idea how variable names will work
 
@ASCII-only I think it might, particularly on that draw-an-intersection problem you linked. The vertical road section could be generated once, and then conditionally stitched above and/or below the center section based on input.
But I should probably apply my own label to the idea: "cool, not that useful, low priority" :P
 
@DLosc Oh, fair enough
But yeah, that can be done without generating twice anyway
 
Oh?
 
10:19 PM
Just make the lines go through the intersection if needed
If the dotted line can't do that, use reflect
(i.e. if the dotted line goes out the other side wrong
 
I suppose... I'd have to see it.
 
After that just draw a rectangle over the middle
 
Yeah. You'd have to draw spaces explicitly to cover up the dotted lines going through the intersection, but it'd be doable.
(BTW, that "hip roof" question is terrifying.)
 
@DLosc Yeah, that's why it makes a good PoC
 
... Piece of Code?
 
10:21 PM
@DLosc Just draw a filled rectangle of spaces first
@DLosc Proof of Concept (that this is good for even complex ascii art challenges)
 
@ASCII-only [adds "draw filled rectangle of single character" to wishlist]
 
@DLosc It should be rectangle -> flags are 'filled'
The other flag right now is corners only
 
What is corners only useful for?
 
rectangles with different corners
actually IDK
because the default rectangle will probably do this automatically
 
Another challenge to reference:
60
Q: Telescopic Parentheses

Martin EnderConsider a non-empty string of correctly balanced parentheses: (()(()())()((())))(()) We can imagine that each pair of parentheses represents a ring in a collapsed telescopic construction. So let's extend the telescope: ( )( ) ()( )()( ) () ()() ( ) ...

 
10:24 PM
The hexplosive one I linked earlier needs corners-only (that needs hexagon mode though)
 
If our language doesn't do this one in ~25 bytes or less, we're doing something wrong.
 
I think that should either use a move command (to move the rest of the input)
Or we need to iterate over the input and move accordingly
 
I'm thinking the latter. The former is interesting, but seems like it would take up too many bytes trying to describe what should be selected and moved at each step.
 
basically move(right);if(on('(')){draw();move(down);}else{move(up);draw();}
Move = move cursor
@DLosc I'd imagine just move any input not travelled over
 
@ASCII-only Except not quite that simple, because when going immediately from ( to ) it stays on the same line.
 
10:30 PM
idk, it's not much more complicated
I just have no idea how exactly to do it
That should work?
 
Coding it up with my Python proof-of-concept now...
We should have at least some basic regex support.
 
@DLosc For what
 
The parentheses problem, for one. Turns out you need to go down whenever you have two ( in a row, and up whenever you have two ) in a row. That's way easier with regex than any other method I've thought of yet.
 
@DLosc The thing I posted earlier doesn't work?
 
Well, first of all, by move(right) do you actually mean "set_direction(right) and move in that direction after every draw() call?"
 
10:42 PM
no
 
Because otherwise it only moves right once.
 
we may want to do that though
No wait
Imagine it's in a loop
 
Ok, not specified earlier, recalculating
 
And the move(right) is at the end
IDK how input would work
 
Ok, that does work now.
 
10:45 PM
we either have input_char, or just read input and have an input cursor
 
We need a good method for reading numbers, as a lot of ASCII art comes parameterized with one or more numbers.
c=Canvas()
for x in input():
 if")">x:c.write(x,"S");c.move("E")
 else:c.move("N");c.write(x,"E")
print(c)
 
11:03 PM
17 bytes in a theoretical language: Ḟċịİ⁼ċ(⁽ċṢẸ⁾⁽ṆċẸ⁾
 
Yay
@DLosc Just have a number input command/add a modifier byte to input?
 
Legend: is for loop, ċ is a variable, reads input, İ is if, is equality testing (prefix operator), ⁽⁾ are like curly braces, and ṆṢẸẈ are movement commands.
Could shave one byte with single-byte command for "move south-east," which seems probable.
This of course hand-waves the question of exactly how works--here, it evidently is able to read a multi-character string.
 
Ḟċịİ⁼ċ(
ċṢẸ
ṆċẸ
Two command chars freed and one byte saved this way (read next two lines for if loop body)
 
Hm, good point.
 
IDK how well that would work for multiple ifs though
 
11:09 PM
Yeah, and dangling-else will be a problem.
 
@DLosc dangling else?
 
The dangling else is a problem in computer programming in which an optional else clause in an if–then(–else) statement results in nested conditionals being ambiguous. Formally, the reference context-free grammar of the language is ambiguous, meaning there is more than one correct parse tree. In many programming languages one may write conditionally executed code in two forms: the if-then form, and the if-then-else form – the else clause is optional: if a then s if b then s1 else s2 This gives rise to an ambiguity in interpretation when there are nested statements, specifically whenever an if...
 
I'd just have an empty line for that
 
Meaning, every if statement has a mandatory (though possibly blank) else branch?
 
Yeah
 
11:12 PM
That'd be an unusual number of newlines for a golflang. ^^ But I'm not opposed to it.
The other possibility is two different if statements, one that has an else branch and the other that doesn't.
 
Maybe, but the mandatory else doesn't use that many bytes anyway
 
Depends. We can start with it that way and add another command if needed.
Oh, here:
Ḟċịİ⁼ċ(ċṢẸ
ṆċẸ
The condition expression of the if block is well-defined, so it doesn't need a newline to delimit it.
Just like the opening expression of the for loop.
 
Oh, fair enough
 
No, wait, this doesn't work. What if we want something in the for loop but after the if-then-else?
 
Yeah, it didn't work the previous way either
Still thinking about it
We might need a character to indicate a continuing loop body
 
11:17 PM
Let's just look at how existing languages do it and pick one of those strategies.
Probably don't want Python's indentation solution...
So there's curly braces (or ⁽⁾ here)...
Curly braces can be dropped when the block is a single statement. Thus why they're not needed for the body of the for loop.
 
I'd prefer something like a ternary statement
 
Definite possibility. But again, if you have multiple statements in each branch, you need some way to group them.
 
if <cond> <if_true> : <if_false> .
^ Isn't automatic grouping done this way?
Obviously we need some other chars
 
Yes, that works.
In fact: if <cond> <if_true> . <if_false> .
The only question, though, is what happens when we try to nest them?
 
Or we can do it Jelly's way, just have chains delimited by any niladic command or something
 
11:21 PM
I think it'll work... hm.
 
@DLosc The inner ifs get completed first
 
if <cond1> if <cond2> <true2> . <false2> . . <false1> .
 
You need another . after <false2>
 
Yeah. Edited.
This as opposed to if <cond1> if <cond2> { <true2> } { <false2> } { <false1> } if everything contains multiple statements...
... or if <cond1> if <cond2> <true2> <false2> <false1> if everything contains single statements.
 
11:24 PM
Think of something like this in C:
 
So if no . until end of line assume single statements?
 
if(x==1)
    return true;
else
    return false;
You don't need the curly braces here because each branch is a single statement.
But with ., you need it every time.
Anyway, G2G for now.
 
1 min ago, by ASCII-only
So if no . until end of line assume single statements?
 

  last day (427 days later) »