« first day (2658 days earlier)      last day (2178 days later) » 

12:20 AM
Does resetting the canvas in Charcoal clear all the variables?
 
@Zacharý Yes (well, it should)
 
Two questions: is there a quick way to clear the canvas w/o clearing the variables? And is there a way to seperate tokens>
 
@Zacharý 1. :| no. i really should implement that shouldn't i 2. ¦, but it's automatically inserted when converting from verbose
 
I'm not using verbose ... should I?
 
well, actually clearing shouldn't clear variables right >_>
@Zacharý up to you. there's no real downside to using verbose mode IMO
 
12:29 AM
Guess I'll just have to use an oblong of whitespace ...
One final question: is there a way to just move in the direction of the cursor?
 
@Zacharý direction of the cursor?
if you mean what i think you mean then shouldn't the right arrow do
hmm. @Neil would it be better for Clear not to clear variables
 
Don't break backwards compatibility!
Wait ... how would anyone use Clear in the current way?
 
@Zacharý the thing is, nobody's probably used half of Charcoal's features before though lol
@Zacharý yeah exactly
For most purposes Multiprint works fine
 
I'm trying to pivot () then move.
 
@ASCII-only it does?
 
12:35 AM
@Neil yeah :/
 
Yeah, I just figured that out.
 
@Zacharý best I can do is pivot left, print "\n", pivot right
 
@Zacharý yeah :Right will move the cursor in the appropriate direction (well, it should >_>)
 
no, it moves right
if you've been pivoting then who knows which direction is appropriate
 
hmm
 
12:37 AM
to print a diamond I think I had to do for (4) { pivotright(1); ;print(q); pivotright(1); print("\n"); }
 
don't remember if this was intended behavior or not >_>
 
I also used that approach in a couple of light ray questions somewhere
 
I don't know how to verbose
 
@Zacharý see the wiki
 
I figured it out now... I have to use ...(...), not [].
Derp
 
12:46 AM
@Zacharý :| did you think it was attache
 
Maybe ... or maybe mathematica or somethinig.
 
@Zacharý just because it has some wolfram functions doesn't instantly make it matchematica :P
also because in non-verbose mode you call python functions with arguments wrapped in lists >_>
 
I haven't programmed Attache, so it's mathematica
How do you do diagonals in verbose? The "syntax" page says nothing
 
@Zacharý diagonals?
 
NE, NW, SE, SW.
 
12:53 AM
> Up/Down and/or Left/Right
"and" being the key part here
@Zacharý alternatively, ctrl+f -> direction here: github.com/somebody1234/Charcoal/wiki/Reference-sheet
 
Ah
I'm going to have to abuse PeekDirection ... blech, that doesn't look good.
 
@Neil hmm. would there be any advantage to making moves affected by Pivot too?
 
@ASCII-only I would just want a move(num), that would work perfectly
 
@Zacharý what would num do
 
Wait, are arrows affected by pivots?
 
1:00 AM
@Zacharý nope
 
I can see the potential, although it could get confusing
 
@Zacharý this?
@Neil hmm. so maybe hold it off until there's another challenge that needs pivot?
 
Except the direction being determined by the pivot... I don't know how to explain it.
 
CMC: Find the message hidden in my profile description.
 
@ASCII-only Does this really take 18 bytes?
 
1:03 AM
@H.PWiz Yes. the backtick is escaped
 
Why so many bytes
 
@WhatWizard :| steganography?
@H.PWiz because it's not smart (the deverbosifier doesn't try to build it with commands at all). you can just slice the alphabet and that would take a lot fewer bytes
 
@ASCII-only No I mistyped.
 
@WhatWizard I wouldn't be surprised if it was 1. ASCII picture of cat or 2. Brain-flak encoding
 
You might be surprised then.
 
1:12 AM
:| sadly it's not a valid TIO link when converted to base64, nor is it base64/some kind of base32/binary/7-bit ascii
@WhatWizard :O it must be this
 
Uh, what. I don't know how you got that.
 
@WhatWizard see the third screenshot
 
Have you tried base36 ?
 
Hm ok. Not the intention
 
My first thought was the swapping cases were some sort of delimiter
If it's unary however there's too many 1s
[1, 3, 11, 2, 9, 1, 1, 1, 6, 1, 2, 2, 9, 1, 1, 1, 6, 2, 5, 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 1, 2, 1, 6, 1, 1, 1, 2, 1, 2, 12, 7, 3, 2, 1, 5, 2, 1, 1, 1, 2, 7, 1, 2, 1, 6, 1, 1, 1, 2, 1, 6, 12, 3, 3, 7, 2, 5, 3, 7, 2, 8, 1, 10, 1, 4, 2, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 1, 1, 1, 2, 8, 1, 9, 3, 8, 1, 3, 1, 2, 1, 11, 2, 8, 1, 2, 1, 6, 1, 2, 1, 4, 1, 7, 1, 1, 1, 1, 2, 8, 1, 9, 3, 7, 2, 3, 1, 2, 3, 7, 16, 8, 3, 5, 1, 9, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 1, 1, 1, 2, 8, 1, 9, 3, 8, 1, 3, 1, 2, 1, 11, 2, 4, 1, 3, 1, 17, 1, 6, 1, 2, 1, 10, 1, 2, 8, 6, 1, 1, 1, 1, 2, 8, 1, 9, 3, 8, 1, 3, 1, 2, 1, 11,
 
1:27 AM
@Zacharý oh yeah. forgot to say: someone else is using Charcoal :D
 
What does GetVariable do? I'm confused
 
@Zacharý gets variables with ASCII names
 
1
Q: Sign-Swapping Sums

Esolanging FruitGiven a nonempty list of positive integers [X, Y, Z, ...], your job is to determine the number of unique values of ± X ± Y ± Z ... For example, consider the list [1, 2, 2]. There are eight possible ways to create sums: + 1 + 2 + 2 → 5 + 1 + 2  - 2 → 1 + 1  - 2 + 2 → 1 + 1  - 2  - 2 → -3  - 1 +...

 
@Zacharý example
 
I found out what I needed, I still don't get Charcoal though
 
1:40 AM
@Zacharý :| why not
it's basically like a C-derived language with ASCII-art functions. and functions instead of operators
 
I get the general idea, just some specific things just throw me off entierely
 
@Zacharý :| like what
 
Question: does charcoal sometimes just do nothing as a bug-like error
 
@Zacharý yes. like e.g. Actually, it sometimes silently fails
it's useful for polyglots, although it might not be the best idea
also, protip: the AST is really helpful
 
"Test case 1 failed" ... yeah, it's helpful alright /s
 
1:46 AM
@Zacharý :| that's not AST
@Zacharý you're probably getting your command line flags mixed up
 
@Zacharý --, not -
-a also works if you want to execute it too
 
How are ~50 backslashes helpful? I feel as if I'm missing something
 
@Zacharý :| you do have -v as an argument right
 
Sorry, I is noob. (I accidentally deleted it when I put in the ASTify.
 
1:53 AM
@Zacharý :||||||
 
@Zacharý protip: just use an existing answer as boilerplate for something that works :P then just change the code
@Zacharý yeah TIO args don't work like that. you need them in two separate boxes
 
CRAP, I put two -'s before the v.
 
or -va
 
I'm used to APL. Not much command lines there. Just a top line of <QUAD>IO<STORE>0
How does while work? It's silently failing there...
OH MY GOD
I FORGOT A BRACE
Still doesn't work, but I missed that
 
1:58 AM
@Zacharý link pls
@Zacharý :| I should probably add syntax errors for verbose mode
 
Does Move(Cast(b),Direction(d)) even work, assuming string b and number d?
I am a total n00b at Charcoal
 
@Zacharý protip: you can Direction a string (and direction actually) too (although it's super useless)
@Zacharý yes
 
While(Not(Equals(Cast(b),0))) {
	Assign(Peek, b)
	Assign(
		Add(d, 2),
		d
	)
	Move(
		Cast(b),
		Direction(
			d
		)
	)
}
I have no idea. It seems that section isn't working to me.
Hey, it's down sheep goat
 
@Zacharý where's the rest of it
 
It's for that arson's lullaby challenge
 
2:13 AM
@Zacharý also can't condition just be while (Cast(b))
 
I was being pedantic since it didn't work.
 
@ASCII-only what would a Charcoal answer to this look like codegolf.stackexchange.com/questions/84050/print-a-lego-piece
 
Short
That's what it would look like. Charcoal's entire purpose is ASCII-art.
 
@quartata The naive way (string operations) seems like it would be almost optimal
 
can I see it
or just a rough byte count
 
2:16 AM
@quartata yeah hang on
 
hm 27 bytes
pretty short
 
canvas is probably shorter lol
 
was trying to scope out the competition in case I ever start developing cinnamon gum again
I love its execution model so much but am less interested in doing the little things necessary to shave off bytes
this was its best attempt back when the challenge came out, it beat V: codegolf.stackexchange.com/a/86667/45151
 
@quartata cinnamon gum's?
 
32
 
2:22 AM
but yeah SOGL and Canvas often outgolf Charcoal
 
It's self-modifying, in essence
It essentially just followed from extending Bubblegum to compress a lookup table
But I love the direction it was going
 
:O nice
clearly a practical language where basically every operator is user-defined is nicer
 
if I can ask you for another sample: how would it do on this? codegolf.stackexchange.com/questions/59934/…
This is not really ASCII-art, a bit different
maybe not something it's suited for
 
it'd probably do ok, brb trying
 
ignore the bonus
it's probably not going to make things shorter
 
2:27 AM
I'll just wait until Neil destroys the challenge
 
@quartata :| generate mode. it sounds like it was made specifically for that challenge lol
 
It wasn't actually, it's come in handy in other challenges
The concept follows from the philosophy IMO. Modes generate strings from a template, in a sense
 
@quartata first try: it does terribly (and terribly slowly too)
 
Is Actually or Seriously newer, I forgot already.
 
@Zacharý Actually
@quartata 27 and less slow, but still terrible
 
2:38 AM
perhaps not its forte then
Since you have actual drawing primitives and what not the Lego piece challenge was a bit more of a fair fight :p
 
@quartata :P
 
Perfection
 
Oh right the bonus
 
2:57 AM
@quartata wait actually that doesn't specialcase 1,1
:| so it'd actually be longer
oh well
 
3:32 AM
@Zacharý ok so how does this not work exactly
 
3:54 AM
@quartata i thought it would be shorter with the bonus because there would be no need to call StringReplace. apparently not though
 
 
5 hours later…
8:27 AM
@LeakyNun Is it a problem that our student competition claims 孔子 was born in the year of the dog?
 
@Adám eh... which year was he born in instead?
 
@LeakyNun According to the (simplified) algorithm of the competition, it comes out like that, so our example says:
      your_solution ¯551 ⍝ Confucius b. 551 BC
Dog
 
so it's dog then?
you're confusing me lol
 
@ASCII-only Charcoal, 28 bytes: ¿⁼1×θIηo«UBo F_-«×⊗⊕θι↷²ιIη↷ includes special case
 
@LeakyNun Well, afaict, the animal year system wasn't used back then. I'm just worried that the way it is stated would be an insult, as calling someone a dog in China is… questionable.
 
8:30 AM
@Adám I don't know if it is an insult
I don't have much emotional attachment to Confucius lol
 
@Neil It seems like the first cast isn't needed
@Adám well zodiac year != calling someone a dog IMO. so as long as that's clear it should be fine
 
@ASCII-only fails for height 1
 
@ASCII-only Right, but the way it is stated could be read as: What is Confucius? — a dog
 
:/ it does. oops
@Neil hmm. I wonder if this would be valid
 
I guess so... I keep forgetting about that
(also your ipv6 answers would print the last line twice)
 
8:46 AM
>_> yes they would. oops
 
 
1 hour later…
10:07 AM
Can moderators spam-hammer posts?
 
@user202729 I'm sure they can. They can do almost anything.
 
10:40 AM
hi all
I have an idea for a challenge which is a generalized version of gray codes
but maybe it has been asked
 
then post sandbox it?
 
@Anush What is it?
 
it is simply this... you are given an array n_0, n_1, ... n_k-1
you must iterate over all arrays S of length k where the values in S_i are in the range 0 to n_i
by only incrementing or decrementing values by one
so if all the n_i equal 1 that is exactly gray codes
 
intriguing
is that actually the same problem?
 
10:56 AM
@Anush Yes it's identical (although not on this site)
 
0
A: Sandbox for Proposed Challenges

AnushGeneralized Gray codes Input: An array I of k positive integers. Output: Your code must output all possible arrays O of non-negative integers of length k with the restriction that 0 <= O_i <= I_i. To get from one array to the next you may add or subtract 1 to one value in the array. Your cod...

 
@user202729 it's intriguing.. is there some way to see what was submitted to that competition?
or if anyone managed to do it?
 
@Anush No you can't. But I have a solution.
 
@user202729 nice! I look forward to seeing it for my challenge :)
I did look at en.wikipedia.org/wiki/Gray_code but it seems not to be covered there
 
I didn't actually submit it, just have the idea.
 
10:59 AM
oh cool. Could you possibly do me a favor
I need examples for my question
if you have a quick way to make any
 
If it's code golf then nobody would do the smart way.
Anyway, my solution is -- (should I just say it here or move to somewhere else to avoid spoiler?)
@Anush Make it by hand :/
 
ah.. well can I make the challenge require a smart way?
@user202729 good point
@user202729 can we get a private chat room?
I don't know how this works
 
@user202729 that's not the same, right?
 
 
1 hour later…
12:18 PM
@user202729 that's how mods delete spam
unilateral spam flag
 
The annoying thing is that it doesn't work on deleted posts.
 
yeah, having to undelete the spam
 
12:49 PM
I hope my examples are correct
 
@Anush Does the output have to be how you have ordered it? Or, alternatively, does it have to be ordered at all?
 
@AdmBorkBork it does not have to be ordered, but they do mention a restriction
 
In fact, due to the restriction, it can't be ordered lexicographically.
 
@AdmBorkBork I think the output has to be ordered but not according my the order I gave
if it isn't ordered, it's rather simple
 
I think the order you have given for the test cases is correct
 
1:04 PM
@EriktheOutgolfer thanks.. I was worried I might have missed out a case
 
btw, I think the challenge is still simple with the ordering, but for fewer languages
that said, your challenge isn't bad
 
@EriktheOutgolfer How can ordering works? ...
 
however, a few remarks to be made
 
9 mins ago, by Dennis
In fact, due to the restriction, it can't be ordered lexicographically.
 
@user202729 it's described in the challenge
no, not lexicographical ordering
 
1:09 PM
@EriktheOutgolfer I don't see it described anywhere.
 
@Anush 1) even though I kind of disagree with it, there's a policy that says you have to specify the winning criterion in the post (e.g. not just with a tag)
note: I don't think many people will VTC over that, but anyway
 
@EriktheOutgolfer aha! What is the standard wording for code-golf?
 
well, you want a code golf challenge, right? there's no "standard wording", you can just say "This is a challenge, the submission with the source code with the shortest length wins." (you can even shorten it a bit, just be sure to include who wins)
 
do I need to say if it is in bytes or characters?
 
in bytes.
 
1:13 PM
most common tie-breaker is earliest post, but you don't need to accept an answer (and are not recommended to anyway)
you don't need to say if in bytes or chars, the default is bytes
 
ok thanks
 
If you want, you can add the "Don't let the short answers in golfing languages discourage you from posting an answer in other languages. Try to come up with the shortest answer in any language.". A similar variant can be found on many of KevinCruijssen's challenges.
 
let me add those
 
I also add it when I post a challenge
and I think Martin Ender also does, it's mostly something to encourage you to post your solution regardless if the language you use won't ever be competing compared to other submissions
 
@Dennis I actually do want to add a more dramatic time constraint
if we change the output format to be (index, +-) which tells you which index should be changed and if it is incremented or decremented, we can restrict the time complexity to be constant for each output
but is that too hard?
 
1:23 PM
@Anush I'd say not time constraint, but if you'd like to restrict it
 
What do you mean by constant for each output? Complexity is asymptotic.
 
@Dennis O(1)
@Dennis so the time to give each output doesn't increase with k
@EriktheOutgolfer thanks
 
@Dennis So O(output size).
 
that's O(1)...
 
@EriktheOutgolfer That's not O(1).
 
1:25 PM
O(1) per output is O(output size) over all the outputs
 
@user202729 what do you mean then? if the output size is 6, as in the first case, the code would be O(6), therefore O(1)
 
@Anush There can't be any O(1) or O(k) solutions.
 
maybe you mean O(N)?
but that's not constant anymore
 
@Dennis "doesn't increase with k" means "independent of k", not "O(k)".
@EriktheOutgolfer How can that explanation make sense!? That's like saying "if the input is 5, O(n) is O(5), which is just O(1)"...
 
@EriktheOutgolfer O(6) == O(1) And O(N) is meaningless unless you tell us what N is.
 
1:29 PM
well, N here is actually the output's length, which makes it kind of confusing
 
@Dennis Sorry if I am being confusing. The time to give each new output (which will be of constant size) should be constant. That is it shouldn't increase when k increases. Recall that the input array is of length k
 
So O(size of output)?
 
@Dennis Yes exactly. In this case each output is of constant size
so O(1)
 
Measuring in bit complexity, outputting each "index" takes O(log k)...
 
ah yes.. constant words
not bits
 
1:31 PM
0
Q: How to design a tree from an emmental cheese?

Marine1TL;DR : code an algorithm that could transform an hierarchical display of a tree in an xlsx file into a tree data structure. The shortest code would win the challenge. If two code are as short the one with the other, the best answer would be the most self-explainable one. Plot : Once upon a tim...

 
@Dennis but the problem is that I am not 100% sure it is possible :)
it clearly is for standard Gray codes
 
@Anush Ok, it is possible.
 
@user202729 cool!
so now I am sure it is possible :)
 
(note that I edited your challenge a bit, it is not completely equivalent to Gray code)
 
thanks.. I saw
 
1:32 PM
To be honest, I'm not a big fan of restricted complexity challenges. Many of us (myself included) don't know how to compute the complexity of their own code, especially not with all the unreasonable assumptions (e.g., arithmetic takes constant time) that are commonplace in CS.
 
:(
 
yeah, that, and restricted time is even worse
 
@Dennis Addition and subtraction takes logarithmic time in bit complexity.
 
All arithmetic?
 
@EriktheOutgolfer Restricted time is measurable, but I don't like it. It involves all kiinds of "on which machine" problems.
 
1:33 PM
with restricted time, you have to test all submissions on the same host, which can be tedious
and then what if the host's owner goes away from PPCG and then who does the test
 
I hope it won't be confusing. I just want the time per new output not to increase when k increases
nothing fancier than that
 
the issue with restricted-complexity challenges is that, for example, what is one statement in a language can really be O(N) behind the scenes
 
After some more thoughts. If it's measured in bit complexity, the output size is O(number of arrays × log(k)), so it should not be a problem anyway.
@EriktheOutgolfer Check out the implementation.
 
well, good luck bothering with that
 
forget bit complexity :) that's too annoying
 
1:36 PM
@user202729 what if the languages only interpreters are online (aka no source access?)
 
@EriktheOutgolfer Empirically measure the runtime is an option.
 
@dzaima I don't know.. this is a good place to ask :)
chat room ^^^ ?
 
It's the answerer's work to prove the time complexity, not us.
 
I really don't think the time complexity should be a problem. I mean assume that all arithmetic on 64 bit numbers is constant time and then just measure the number of operations
 
@dzaima Closed source is a thing.
 
1:38 PM
@dzaima well a lot of languages are closed source too. what about those
 
I remember a Mathematica solution being disputed on because no one can prove the time complexity. Too bad?
 
@ASCII-only those at least have the assembly viewable
 
@dzaima that usually is nowhere near helpful
 
@user202729 but in this case it has to be O(1)
 
especially for e.g. 100MB executables
 
1:39 PM
if someone really comes up with an answer where we can't tell if it is O(1) or not, that's basically the same as an answer that we can't tell is correct to me
 
@Anush No, for a different challenge.
 
@user202729 got you
 
@ASCII-only 100 millibits? That's one small executable.
 
@ASCII-only I'm saying that it's theoretically possible, not that anyone should go trough the pain of actually proving that
 
@dzaima it's theoretically possible to find the actual time complexity of an online interpreter by running it repeatedly (i think)
@Dennis yeah it's from the ultimate golflang
 
1:42 PM
@Dennis ...which doesn't even need one whole bit to fit anywhere
 
@ASCII-only That's to estimate the time complexity empirically. That's not "proof".
 
@user202729 that's true
 
@Anush by O(1) I'm assuming you mean each subarrays outputting time? So doesn't just returning the array take O(k)?
 
@ASCII-only How? Any interpreter will only allow you to test a finite (and thus, insignificant) portion of all possible inputs.
 
well, you may be able to exploit server vulnerabilities to find the executable/source :P
 
1:43 PM
uh, I'm not sure about it being repeatedly possible to find the time complexity by "repeatedly running", even empirically, there is other stuff going on between you and the server on e.g. TIO, and, if the interpreter is client-side, running it repeatedly could simply be so fast that the naked eye can't capture the difference
 
@Dennis well, for a very small subset of challenges that 1. have a single integer input and 2. where the runtime doesn't vary by a lot
 
and, if it's closed-source, you have to deal with the actual executable
 
@dzaima oh sorry there is a part you are missing. This is for a new version of the question where the output is (index, +-) which tells you which index to modify and whether to add or subtract
 
@ASCII-only Any integer that can be represented on an actual computer basically rounds down to 0.
 
well, not if the only supported inputs are integers within a certain range (but yeah i guess arbitrary precision is basically everywhere nowadays)
 
1:47 PM
If the only supported inputs are integers within a certain range, all implementations are O(1).
 
0
Q: Heuristic function in "cave puzzle"

Branislav KramárI want to solve Cave puzzle (https://www.gmpuzzles.com/blog/cave-rules-and-info/) using A* algorithm in R programming language. I have already implemented Breadth-first algo. This is part of my code: v1 = c(2,0,0) v2 = c(0,0,3) v3 = c(0,4,0) v4 = c(1,0,0) v0 = c(0,0,0) arr <- array(c(v1,v2,v3,v...

 
So implementations on a FSM are always O(1). Big Oh notation only makes sense for algorithms, really.
 
@user202729 yes spam flags cast by a moderator are binding
 
@Dennis :| this is actually a very good point.
so basically all you can do is 1. look for documentation/in source or 2. assume the most reasonable choice i guess?
 
@ASCII-only You can't assume the most reasonable choice. Haskell nub and Jelly Q takes O(n²).
 
1:51 PM
@Dennis True. An FSM solution would be awesome though
 
@user202729 well, haskell explicitly states in the docs it's O(n^2) so that's fine
 
@Anush "Finite state machine"?
 
@user202729 yes
 
@user202729 yes
Is it reasonable to always start with the all zeros array for my challenge?
 
@Anush Computers are finite state machines...
 
1:56 PM
@Dennis in some sense
 
In what sense are they not?
 
A Turing machine isn't
if the tape is infinite
 
@Anush state != memory.
 
actually even if the tape is finite
 
Finite memory implies a finite number of states.
 
1:58 PM
 
@Dennis I don't think so.
By "state" I meant the "program state". Looks like people meant something else.
 
Whatever state you're talking about, it has to be represented in memory, no?
 
What makes you think program state is infinite
 

« first day (2658 days earlier)      last day (2178 days later) »