« first day (4326 days earlier)      last day (65 days later) » 

12:01 AM
Q: CGAC2022 Day 3: \$n\$-dimensional Chocolate Pyramid

alephalphaPart of Code Golf Advent Calendar 2022 event. See the linked meta post for details. I've got an infinite supply of \$n\$-dimensional chocolate for some positive integer \$n\$. The shape of the chocolate is not important. You may assume that they are just \$n\$-dimensional hypercubes with side le...

1:01 AM
> If at first you don't succeed, reduce your expectations until you have.
1:13 AM
Q: Generate an image containing lots of random dots

trejderIntroduction I need a piece of code that is either fairly easily compliable to Windows .exe or fairly easy to be run under Windows that will accept only one parameter -- number of dots. At the output we're getting an black & white image (be it .bmp, .gif, .png, .jpg, .tiff) in any prefixed / rand...

i wanna say something like "this isnt a site where we code for you" but i just cant phrase it
that's a close vote reason IIRC
maybe the community-specific > go to SO one
although I think "no winning criterion" would probably be more accurate for this, as technically it could be a challenge. that or details and clarity, cuz idk what it's asking for
technically there is no rule against getting CGCC to write code for you but it needs to be a valid challenge and follow topic rules
(well, I guess the exception is homework/ongoing contests or similar)
1:33 AM
@hyper-neutrino yea ik but those just tick me off
2:24 AM
wtf did randall munroe do to this person
wait, that's satire
this one is legit
3:16 AM
@Ginger "Hello, World!"∈O works now :P
also this
ofc theres a billion todos
3 hours later…
5:57 AM
@emanresuA when will you test my PR?
6:07 AM
Sorry forgot, will do now
On the off-chance that stdin works, what's the stdin command?
there is no stdin
Ah okay
Also, did you test it yourself? All you really need to do is clone the repo and (depending on browser CORS stuff) run a localhost server (npx http-server is a good one)
no i did not
@emanresuA tried running npx it doesn't work
node just doesnt work for me
Hmm, probably wouldn't be too hard for me to set up a gitpod instance...
dso-staging-pr-21.surge.sh if you wan to test suff
@emanresuA yes IO works
just i can't use any flags (li need to change flax's code to handle that)
1 hour later…
7:24 AM
@PyGamer0 Merged and deployed
8:01 AM
@Ginger In math notation this would be Cartesian product
1 hour later…
9:11 AM
does vba autoformat has some sort of inconsistence?
I have Cells.row and Cells.Column, apparently there is a discrimination against the word row by forcing lowercase on it
also Rows which is uppercase for some reason, I guess microsoft hate row specifically
and the autocomplete also shows Row(and does auto complete with Row instead of row), but the autoformat reverse it back to row when I move to other line
10:13 AM
LDQ What should happen if you use iterator functions, like map, filter, reduce on a number?
Rangify from 1
Why from one opposed to 0?
More useful
Very rarely is 0 to n exclusive needed
1 to n inclusive has proven to be good 99% of the time
I've probably ever needed 0 to n exclusive a handful of times
10:39 AM
Hmm I was thinking decimal representation so things like count and index would do something useful
10:51 AM
Well for those you treat as list of digits
Basically, if list of digits makes more sense it takes priority, else rangify
I don't really want to make it inconsistent
Yes you do
If you go consistent, there'll always be cases where applying an operation on something isn't doing the most useful thing
Plus, it works just as well if you do it based on what would be the most intuitive option given context
If I go inconsistent I'd need builtins for everything that is not done implicitly
Not necessarily
Just have a range built in and a to digit list built-in and use those in the 1% of cases where the default behaviour isn't needed
11:05 AM
Yes, but that wastes a built in slot and I have 1 too many built ins already
Well if you use a consistent method, you'd need those built-ins anyway
Plus, if you have overloads, you just place digit list on flatten
I won't have overloads
Why not
Overload is basically the same thing as inconsistent behavior
So you're just going to have errors when types of arguments to a built in don't make sense?
11:12 AM
There is going to be type coersion but that's different
Then list of digits can still be placed onto flatten
It just coerces the number to a list of digits first
Yes, so I won't need a builtin for number to string
@mousetail but then what about when type coercion doesn't make sense? How do you take the range of a string?
How do you lowercase a number?
It vecotriez
I won't have a difference between arrays and strings
or between chars and numbers
So then there's no type coercion at all then
11:20 AM
Maybe technically not in this case
Then you want to make sure you have good list handling built-ins because you don't have the usual string manipulation functions you usually have
Yea I have a lot of list and string built ins. A lot of standard string built ins like replace, split, and join seem like they would be very useful even for non-string arrays
That's true, but make sure you have other useful list stuff too like transpose, flatten, that sort of thing
This is my current thought btw: github.com/mousetail/Cerebellum Very early draft still I might change everything
What language are you using to implement?
11:29 AM
Probably Rust
Shame. If you were using python, I'd mention that the multiple copies of lazy evaluated containers problem is easily fixed with itertools.tee
I don't know if there's a rust equivalent of that
Managing many shared references to a list is going to be a bit of pain in Rust which is why I'm still unsure. The match syntax makes it very easy to write parsers though
Scala could be of interest then. It does lazy evaluated stuff really nicely + has really good pattern matching
+ JVM for speed
also, have you considered digraphs
also also, no multi-digit literals?
Nope, I'll have a base 255 number representation
It's in the quotes section
Or maybe base 128? Actually that's probably better since I can avoid needing a closing quote
Are iterator commands actual commands or modifiers?
11:37 AM
I guess modifiers, they will return a copy
modifiers being that they operate on tokens, not data
Would lambda be a modifier? They all include a implicit lambda
like how +/ modifies the + in Jelly and makes it reduce a list. Or how ~₂ modifies the in Vyxal and filters by it
They are commands
11:39 AM
Splat and it's variants are the only modifier currently
what happens if I give them two numbers or a number and a list?
You can't give them two numbers, they implicitly start a new function so it's impossible to pass any parameter other than a function as the second argument.
aha I think I know what you mean now
so they're "structures" in a sort of a fashion
got it
8 mins ago, by lyxal
also, have you considered digraphs
also also also, ternary conditional/if statements?
I might need digraphs if I discover a significant amount of extra commands I want to add
good, because there's currently some stuff you really don't want single byte when there's limited command space
11:43 AM
@lyxal There is a ternary, also a short circuiting "and" and "or" for providing default value
"and" and "or" don't allow me to do if x then y else z though
You would use the ternary
also, "Parent list"? What's that?
Inside a map you can get the list you are mapping over
anyhow, I can see 9 things you would want to move into digraph space
meaning you would have 9 more command slots for doing stuff with
plus you get to remove a few string-specific things for a few extra free spaces
11:48 AM
@Seggan oh yeah that didn't go very far
but now i have minecraft java
Don't hold me in suspense, what things?
Current Time (Unix Time)
Current Time (ISO)
Current Time [year, month, day, hour, minute, second, millisecond]
Source Code
Read file
Write to file
string to number (base 10)
String to number, n decimal places (base 10)
stirng to number (base 16)
string to number (base N)
because some of those string base conversions can just be special cases for number to base whatever
wow I'm incredibly inconsistent in my spelling of "string"
didn't notice that, but lol
also, Recurse File and None could probably be moved to digraph space too
11:51 AM
Also, None and True in a golfing language?
Just let numbers be booleans
They are
I know, but exclusively numbers
For some specific cases there is a isNone check, otherwise they behave identically
also, what happens if you give something like SortByKey a non-function argument?
It also implicitly opens a function
Everything that takes a function does except the callFunction builtin
11:53 AM
what closes a function?
nothing. Functions have a arity of 1 so I always know when it ends
oh yeah this is prefix lol
I forgor
finally, any plans for the codepage yet?
Not yet, I might just copy a codepage from something else
at least to get started
I can modify some things as I go
fair enough
well that's all the questions I think I have for now
Thanks a lot for your feedback
11:57 AM
I'll make sure to bombard you with 20000 more questions when you make some more progress :p
I'd love that
12:14 PM
@Seggan ._.
You say that like it's a bad thing
I wasn't expecting that so quickly
I'm impressed
2 hours later…
1:46 PM
@Ginger yeah i also implemented it half wrong, with the set contains adding the element instead of trying to make it true, so i gotta rewrite that
also bear in mind that in the context of an expression that function should check if the element is contained within the set!
yeah ik that behavior was for the out set
ok cool
2 hours later…
3:40 PM
please help me
Oh no, TVTropes
The site you can enter but never leave
3 hours later…
6:46 PM
My new PC is finally shipped, should be here in a few days. Only 15 days after they promised
7:37 PM

« first day (4326 days earlier)      last day (65 days later) »