« first day (2793 days earlier)      last day (2049 days later) » 

12:14 AM
@Pavel , @JoKing, Console app complete. Probably, there's always the possibility that I didn't do something right for TIO and have no way to know. github.com/Draco18s/RunicEnchantments/tree/Console
 
0
Q: Programmable Bots

FireCubezGame In this challenge you will play a made-up turn-based game. The game is made up of the following elements: A 8x8 grid with each spot containing nothing (space), a robot (*), a wall (#), or HP (@) A public stack Robots In this challenge, you will be playing as a robot. Each robot has h...

 
 
3 hours later…
3:13 AM
0
A: Sandbox for Proposed Challenges

dylnanIs a three dimensional text chiral? (in progress) Two dimensional chiral objects are not chiral in three dimensional space. This is because you can flip them over unlike in two dimensions where only rotations in the plane of the object are allowed. You can define an object as chiral if there exi...

 
 
1 hour later…
4:35 AM
@NathanMerrill I don't think so. You'll notice that the mechanics of my algorithm and Prim's algorithm are completely different. My algorithm yields a grid of tiles, each of which can either be a gap or a wall. Prim's algorithm yields a spanning tree of a lattice graph, which basically means that all tiles are blanks and any two tiles may or may not have a wall between them. Moreover, Prim's algorithm favors expanding on newly-added vertices (since these are more-likely to have low-valued edges),
whereas mine picks from all available gap tiles randomly.
 
4:58 AM
> File.ReadAllText(args[1]);
C# args don't include the program name, should be args[0]
 
 
2 hours later…
7:21 AM
Are there any OSes (except Android & iOS) which don't want the exit button in-app?
Is Blackberry on the list?
 
 
2 hours later…
9:21 AM
Open question: should we have an 'Algorithm tips' topic to describe concise forms of common algorithms (in terms of number of statements), regardless of the implementation language?
This one is very close, but it's focused on generic golfing tricks such as "use > and < instead of >= and <=" rather than algorithms.
 
9:40 AM
@NewMainPosts What a train wreck.
Let's hope the problems in that post get fixed quickly and effectively, as it seems like a pretty good idea, fundamentally.
 
10:22 AM
0
Q: Ordinary Least Squares

Andreï KostyrkaI am quite surprised that a variant of linear regression has been proposed for a challenge, whereas an estimation via ordinary least squares regression has not! For details, check out the Wikipedia page on OLS. To keep things concise, suppose one has a model: where all right-hand side varia...

 
 
2 hours later…
12:49 PM
0
Q: Every positive integer can be written as the sum of 3 palindrome integers. Wha'ts the largest possible palindrome integer for each integer n?

xiaodaiLet n be a positive integer then n = a + b + c for some a, b, and c that are palindrome integers. What is the largest possible integer a for k = 1 to 1_000_000?

 
1:24 PM
I've found I oddly enjoy doxing (at least, finding out the information, not necessarily revealing it) people. Is that bad?
 
 
1 hour later…
2:43 PM
0
Q: Nested forcefields don't belong!

Redwolf ProgramsIn this code-golf challenge, your task is to design the shortest function or program to list every conflicting forcefield. Every forcefield has a radius of 1, and is circular. The coordinate points at the center of the forcefields have been compiled into a large file. So, if FF A was 0.7 away fr...

 
 
2 hours later…
4:48 PM
@Pavel 👍 Easy fix. Anything else?
 
5:12 PM
@xnor This is a bit off-topic, but since you've analyzed A316975 you may also be interested in the conjecture I made in the comments of A316976. I have to admit that I didn't even really try to prove (or disprove) it myself, but I'm kinda interested in the result.
 
5:49 PM
@EsolangingFruit the difference between a maze that uses squares as walls and uses line walls is irrelevant (assuming the square walls only exist at the lines where (n%2==0)
 
@NathanMerrill That assumption isn't true. If you look at the generated maze you see that walls can occupy any space, and gaps are placed anywhere as long as they would not have a different part of the maze in the Moore neighborhood.
 
it's hard to tell with that image :)
but fair enough
regardless, it's still the prim algorithm: weblog.jamisbuck.org/2011/1/10/maze-generation-prim-s-algorithm
 
The maze contains dead-ends that have length 1.
 
if you look at the diagram below, you can see that it follows what you are saying
Given, you don't keep the frontier in memory, so technically, each square of the frontier doesn't have the exact same chance
but I think that's a small enough difference it doesn't matter
 
6:26 PM
Interesting. The version of Prim's algorithm that selects a random vertex from the frontier is essentially what I'm using, but the version that selects the lowest-weighted edge would seem to have different characteristics.
 
Anonymous
@Zacharý Yes, because that's a violation of privacy
 
@Zacharý It can be very fun, but, as Mego says, it's a massive violation of privacy, even if you don't reveal anything
 
It's more-or-less finding the information that's fun. Somebody leaves a link in one place, I keep going ... then I realize I've gone too far.
Most of it is just following links aimlessly
 
The person posting the information themselves violated privacy. Putting information together by following links isn't a violation of privacy imo. After all, Google's bots essentially do that automatically. Google is allowed to consolidate a huge amount of data, but nobody accuses them of violating privacy.
Oh wait...
 
7:00 PM
@EsolangingFruit If I have a Facebook account that I only share with my friends, I wouldn't expect someone on PPCG to randomly go "Hi @cairdcoinheringaahing, I know your real name", which is what Zachary seems to be treading the line towards
 
@cairdcoinheringaahing Of course, if you find information like that, don't share it publicly! But if someone privately alerted me to the fact that my personal stuff could be linked to my online accounts, I would be grateful.
 
7:17 PM
Even following online tracks can still be considered invading privacy because following tracks takes effort. At one end of the spectrum, you have tracking somebody via following a link on their profile. I don't think anybody can really complain about that. At the other end, you have correlating activity times, public cameras, etc
 
Definitely fall on the "link" side.
 
Mooo
 
Moo to you too (heh)
 
i just realised how fun a SIMD language could be for codegolf.
Time to make one! (In x86-64, just for fun)
 
s/fun/traumatizing/
 
7:30 PM
heh
4 32bit values manipulated at once with each instruction. >:D
 
ngn
@moonheart08 c compilers know how to do that
 
i know.
But i like doing x86-64
 
@moonheart08 Possibly related, but not a golflang
 
ngn
@moonheart08 i wish i knew how to do that too, but it seems to complicated :(
 
it is
i have to have an instruction reference open at all times haha
theres so many o_O
golfing in it is even worse
sometimes it's shorter to work with bytes, sometimes halfwords, and othertimes words
i'm genuinely glad that some common operations, like setting up the stackframe, can be done in only 3 bytes if you need to do it.
 
ngn
7:36 PM
@moonheart08 the "call" instruction?
 
no, call doesn't handle stackframes
ENTER does
 
ngn
i'm totally ignorant...
 
ngn
@moonheart08 why would you need a stack frame if you're not calling a function?
 
You dont
but if you are doing function calls, into, say, C land, setting it up is essential
also, it's a shame some incredibly useful instructions that would be awesome for codegolf are literally locked away because they're 6+ bytes large. i.e. all SIMD instructions
 
ngn
7:43 PM
@moonheart08 by the way, we already have simd languages - the apl family, only not (completely) written in x86_64
 
good point
but i'm doing this for fun, so why do i care if it already exists :P
 
ngn
@moonheart08 sure, you needn't care :)
@moonheart08 but if you beat the performance of my language, I will care :)
 
what language?
 
ngn
@moonheart08 it's called k, the language of kdb+, I'm trying to reimplement it from scratch
 
Well, my interpreter is going to be hand optimized, so it should be pretty fast
we'll see
 
ngn
7:50 PM
@moonheart08 what syntax will you use?
 
i dunno, FORTHlike maybe?
i'm still thinking about it as i write the "framework" assembly to build it on.
 
ngn
@moonheart08 what would be a good test for performance?
 
i dunno.
:P
 
ngn
@moonheart08 i've got a few, one of the simplest is: generate 20000000 random integers between 0 and 999 and sum them 100 times
 
There are so many factors that go into the speed of a language: Creating a stack, math and binary operations, file and network I/O, memory storage, retrieval, and deletion. Then you get into the world of optimizing out code (such as tail recursion optimization, reordering code, etc)
 
ngn
8:06 PM
@NathanMerrill file and network i/o are handled by the os, there isn't much I can do about them :(
@NathanMerrill I'm relying mostly on nice memory access patterns and vector instructions (at the compiler's mercy). What do you mean by "creating a stack"?
 
@ngn I assume Dyalog takes advantage of SSE?
 
wait, you aren't writing a compiler?
 
ngn
@quartata it does
 
@NathanMerrill It's a K interpreter
 
ngn
@NathanMerrill no, it's an interpreter, or to put it more correctly: semi-compiler-semi-interpreter with internal bytecode
but it doesn't matter much because it's a vector language
 
8:13 PM
so, like CPython
you have a interpreter that runs bytecode
 
ngn
@NathanMerrill python, java, c#, js... I think they are all like that nowadays
@NathanMerrill yes
 
JS doesn't have a bytecode, right?
 
@NathanMerrill I know V8 does
 
ngn
@NathanMerrill I think the popular js engines use bytecode internally
they even have counters to identify which functions are the "hottest" and worth spending time for compilation
 
...this bytecode is generated everytime I load a script, though right?
 
ngn
8:17 PM
but my bytecode is extremely simple, nowhere near the complexity of what v8 does - i don't want to create the wrong impression
 
or does chrome/NodeJS cache bytecode somewhere?
 
You can invoke node with --print-bytecode to get a dump.
 
@NathanMerrill it seems to generate all the bytecode of an expression I feed it since I can view it all
it doesn't re-print it though if the same expression is entered in the REPL twice (though a single space will make it redisplay; no idea if that's optimization or niceness of the REPLs interface)
 
@NathanMerrill It's cached
Although V8 leaves it up to the application to decide where/how to store it for persistance.
 
"the application"?
my JS script can decide where to store the JS cache?
or V8 leaves it up to chrome?
 
8:22 PM
the latter
 
Maybe i should write a code generation script for this instead of writing this all out by hand. imgur.com/vCt9CfNl.png
--Wait shoot that means i have to learn python.--
 
ngn
@moonheart08 what is this and why do you need it?
 
aaaa
@ngn
instruction table
Numbers are "instructions" too
Hm
moves EXIT instruction to instruction 65 and simply writes a mask check function
 
what instructions are these?
 
for a thing i'm making
golf lang
instructions 1 through 64 are the numbers -31 through 31, respectively.
 
ngn
8:31 PM
@moonheart08 can't you just say something like: if (opcode<=64) { value = opcode-30; ... }
 
thats basically what i'm doing now
because putting all of them in the table is just a pain
 
@moonheart08 Why those specific bounds?
 
well, i only have so much space to work with. what i chose fits in a signed 6 bit integer
 
Why not choose more important numbers?
like, powers of 2, and other common numbers like 1000 and similar numbers
 
There will be macros for more important numbers as well, but this simple range can represent some pretty big numbers easily
 
ngn
8:37 PM
@moonheart08 is your goal code size or performance?
 
size.
i'm using 10 bit instructions, so i got space to spare, but i don't want to use everything in one fell swoop either
 
ngn
in that case you are not a competitor to ngn/k :)
 
hm, 1024 - 256 isn't a huge space drop, so maybe i should do -127 to 127 instead
nah
 
ngn
why bother with custom bytecode then?
 
ngn
8:42 PM
I mean, if your goal is not speed, you could transpile to another language, or maybe evaluate by walking the parse tree (if there is one)
 
uh, this is a golflang. Goal is size
 
ngn
those are simpler strategies than compiling to an intermediate bytecode format and then executing it
 
this isn't compiling :P
 
ngn
oh... ok, I misunderstood then
 
9:23 PM
@ngn and I thought I read all of the comments...
@EriktheOutgolfer see Jonathan Allan's comment and the response to it — ngn 11 mins ago
hah
 
ngn
@EriktheOutgolfer hehe, I was about to post a similar comment to yours (and Jonathan's) but just before I pressed enter I decided to read what was above it :)
 
@ngn my case is more...embarrassing, since I parsed Jonathan's comment and its reply as something entirely different >_>
 
ngn
@EriktheOutgolfer you know, you can delete it?
 
@ngn I don't really want to delete it, it looks like many people would trip
 
9:47 PM
-1
Q: Can we print "Hello world" using 7 cosine functions?

huseyin tugrul buyukisikHere is 8 cosines version: #include <iostream> #include <math.h> using namespace std; int main(){ auto helloWorld = [&](int i) { double element = 0; element +=255.0*std::cos(5.19498+3.27249*i); element +=255.0*std::cos(2.11106+3.22588*i); element +=255...

 
@NewMainPosts 6.8k over SO...
 
 
2 hours later…
11:23 PM
I_Range1toN00 = 178, // Returns a list of a number between 1 and 8 bit constant N (First 2 bits are 00)
I_Range1toN01 = 179, // Returns a list of a number between 1 and 8 bit constant N (First 2 bits are 01)
I_Range1toN10 = 180, // Returns a list of a number between 1 and 8 bit constant N (First 2 bits are 10)
I_Range1toN11 = 191, // Returns a list of a number between 1 and 8 bit constant N (First 2 bits are 11)
By extension, this means that the program to return a a list of numbers between 1 and 10 (inclusive) is 1 7/8 bytes large. Watch out jelly, i'm coming for your t
For reference, the program for 1 to 10 would be: 00010 0010110100
(I haven't decided on a more readable format that can be encoded to it, so binary dumps are the only way to represent it right now)
 

« first day (2793 days earlier)      last day (2049 days later) »