« first day (2911 days earlier)      last day (1924 days later) » 

3:20 AM
hmmm
in a prefix language, what would be the syntax for foo.bar
since... if you make it get foo bar then wouldn't set be set get foo bar value
also, asked this before but worded badly: should the standard library use more advanced features (that require importing libraries) for conciseness/to show more examples of uses of the language?
oh, and... would there be any nice way to make special functions? (like... python uses global functions instead, JS uses symbols as keys (which is not a bad idea))
oh actually: is it a bad idea to make methods actually global functions for a prefix language? if so, what would the syntax be for some kind of... global static method i guess? as in a function where the argument of the enclosing type is not the first argument
oh. and... is there any possible nice syntax for conditional definitions
like... some functions require another module, but they're not important so only should be loaded if both modules are loaded
 
3:51 AM
also, should arrays of mixed type be treated as tuples if type unions are a thing (so... type_union[] vs tuple)? assume list destructuring is a thing, i.e. [foo a, bar b] = list would work from both types - would one make more sense over the other in this case?
 
0
Q: Generate password code golf

asmgxjust another way to create a password it is very hard to remember my password, so I came up with a way to create a password that i can generate The way i generate my password is from a word or a sentence and follow these steps 1- start from left to right 2- find the count of each letter 3- p...

 
Anonymous
4:05 AM
@ASCII-only Why not just set foo bar value?
 
@Mego what about 1. foo = value and 2. foo.bar.baz = value
hmm
i guess you could do set property [foo bar baz] (or get) or something
 
Anonymous
@ASCII-only 1. set foo value; 2. set get foo bar baz value
 
@Mego what if there are no overloads/variable arguments
 
Anonymous
@ASCII-only Then set foo value and setprop foo bar value
 
Anonymous
You can make setprop foo bar value === set get foo bar value under the hood, but setprop would be more useful
 
4:07 AM
hmm. i guess i should then rename get to getprop for consistency?
 
Anonymous
Sure
 
well, *remove get, add getprop
 
Anonymous
get could still be a useful name for references, like set foo bar (get baz) as foo.bar = &baz (C++-ish)
 
Pro-tip: Two spaces is the same as one space twice
 
 
2 hours later…
6:38 AM
@Veskah :O what? mind=blown
@Mego imo that's not obvious enough, for that i'd go with address_of/addr or something
btw @mego :
3 hours ago, by ASCII-only
also, asked this before but worded badly: should the standard library use more advanced features (that require importing libraries) for conciseness/to show more examples of uses of the language?
 
7:15 AM
 
@dzaima generators is why, as the answer explains
if you don't like it switch to python2 :P
but... yeah that really is very, very counterintuitive
 
@ASCII-only but the fact that one instance of array there references the original and the other, the replacement
 
7:29 AM
true
hmm
if every object has an AST type (e.g. 1 would be IntegerLiteral), and an actual type, what about ast nodes themselves?
would both be the same?
and... i wonder if there would ever be a case in which both types being the same would be bad, when you want to pattern match something based on type
ok. if functions are generics, what type would they be (since they also can have any number of args)
tuple type, i guess? or are haskell's type signatures a better idea? i.e. (a, b) -> result or a -> b -> result?? (i'm guessing the linked list/currying style of haskell isn't really useful if there is no partial application built into the syntax?)
 
8:06 AM
@ASCII-only yeah sure
 
@Downgoat but it would mean more dependencies. i guess that doesn't really matter that much?
 
 
6 hours later…
1:47 PM
0
A: Sandbox for Proposed Challenges

BMODrawing \$K_n\$ (complete graph with \$n\$ vertices) In graph theory the complete graph with \$n\$ vertices, often written as \$K_n\$, is the graph where every vertex is connected to every other vertex. For example, \$K_3\$ with \$V = \{A,B,C\}\$ has the edges \$\bigr\{\{A,B\},\{B,C\},\{C,A\}\bi...

 
2:06 PM
0
Q: Count the Closed Polygons

Kevin CruijssenInput: An NxM grid or multi-line string (or other reasonable input-format), containing only printable ASCII (unicode range [32,126]). Output: The amount of closed polygons of the same character that can be found, with two special rules: Spaces are wildcards and can be used (multiple times) f...

 
Anonymous
@ASCII-only The standard library should be as clean and performant as possible
 
Unwrapping a 3d cube array into a 1d array can be done with x * CubeSize * CubeSize + y * CubeSize + z right?
 
 
1 hour later…
3:41 PM
How do I write hidden text in a post?
 
@LuisfelipeDejesusMunoz if you're talking about the spoiler block, you need a >! in front of whatever text you want hidden.
If you want comments, the standard html comment syntax applies <!--- Text --->
 
BMO
4:15 PM
Why was this question put on hold?
Can we please reopen it..
 
I was going to hammer it, but I have a question that I feel should be answered first.
In what way should we sort uppercase and lowercase versions of the same letter? — Dennis ♦ 1 min ago
 
BMO
@Dennis: (5) Keep the case for the last letter
Or am I missing something?
 
OK, now I feel I didn't understand the challenge at all.
I don't understand how casing works. Could you please elaborate? — Dennis ♦ 9 secs ago
 
BMO
It's not about codepoints, maybe that's that?
 
Ah, I think I got it. We're supposed to group case-insensitively and use the case of the last occurrence of the letter in the output. That could definitely use some clearer wording.
 
BMO
4:29 PM
@Dennis I find that hard to believe, 11 people (12 counting me) understood.
@Dennis Yes
 
Well, I completely misunderstood it the first time I read it, hence my nonsensical for comment.
So given that 5 users voted to close, that makes at least six who were confused by something.
 
BMO
+12/-6 then
 
That's an unacceptable ratio of people who didn't understand the challenge.
 
BMO
But it clearly states letters and alphabetically and never goes on to say anything about some specific encoding.
Some challenges assume way more than "you need to know the alphabet", I don't think they need to explain how the alphabet works
 
Any objections to editing 5 to the following?
> Group letters ignoring case. In the output, use the case of the last occurrence in the input.
 
BMO
4:32 PM
No, sounds good to me
 
@BMO Believe it or not, I do know the alphabet.
 
BMO
@Dennis Hence, I did not believe you when you said you didn't understand how casing works.
 
For the challenge, not in general...
 
> "ab-ca-def-gi-jeckle-mi-nop-kwer-stoov-wix-iz" - Big Bird
 
 
2 hours later…
6:13 PM
Every time I see our Roomba move randomly around our house, I think: This could be a nice challenge!

Input: A matrix representing a house/room with 1=obstacles, 0=floor.
Challenge: You'll write a controller for the roomba. You start in a specified spot, and must cover the entire floor. The roomba can't see anything, so it doesn't know the size of the room, nor where obstacles are, until it crashes into it.
Score: Lowest traveled distance
 
hm... maybe already done?
 
What are your thoughts? I'm unsure about the scoring, and I'm not sure how to specify it.
 
is this not ?
because I'm pretty sure I can just brute-force my way to optimality
 
@StewieGriffin I'm pretty sure every submission would have lowest traveled distance, it's not . ahard algorthim
 
I guess there must be some "hidden boards". I'm not sure how to do this properly though.
 
6:16 PM
no, I'm not talking about hardcoding
it's pretty easy to brute-force starting from lowest and going to higher travel distance
 
I think it's quite hard, since you have no information about the room in advance.
 
oh, so you can't see the input?
 
No
You have the same information a roomba would have. I.e. nothing.
 
then I guess we would have to implement an algorithm for something similar to the Trace game
 
I'm fairly sure most algorithms would fail to cover all the floor space, if the room was made complicated enough.
 
6:18 PM
like, given a path, cover it in whole without visiting a space more than once... except that if you're at a dead end you can go back
 
... googling Trace game ...
 
oh, you won't have luck googling :P
 
But you can, and likely should cross your own path many times.
 
you might also know it as "fill in room" or something (I've forgotten its name)
(the app got flagged by Play Protect)
 
But I guess such a game has a known room layout in advance?
 
6:21 PM
yep
not knowing the room in advance does make it harder
 
Why I had this idea: The algorithm the Roomba uses can't be optimal, since it walks around pretty randomly, and it crosses its own path many many many times.
 
your roomba should also know its way around after the 50th time... :P
 
I always think: The people on PPCG could definitely create a better algorithm than this.
@EriktheOutgolfer but I might move a chair or something... Then it must start from scratch again.
 
yeah, thought about that
 
So, do you think it's a viable challenge idea?
 
6:25 PM
although then I guess it should use some sort of "threshold radius" system, that is, if it detects an object being moved from where it was in the past, or one being put where nothing was the in the past, delete all data in a circle with some radius r and the changed spot as its center
(r is ideally changeable)
@StewieGriffin definitely
although... how are you going to convince roomba manufacturers to put a better algorithm in there... and how much would you charge for it? ;) prepares lawsuit
 
I thought of that too! :)
 
@StewieGriffin so, is this basically a but with each bot taking its time alone? :P
 
 
3 hours later…
9:31 PM
unix.stackexchange.com/questions/495232/… perhaps the woman package installation set MANOPTthus causing too many arguments
 
> man: Terribly divorced
— The Future
 
 
2 hours later…
11:46 PM
Adding skip logic to a prompt-and-validate loop resulted in grosser code than I intended. Oh well
 

« first day (2911 days earlier)      last day (1924 days later) »