@dzaima Not sure. Note that it also says that The tokens ⍺⍺⍺⍵⍵⍵ can be used anywhere in the function. For parsing purposes, ⍺ and ⍵ are treated as arrays while ⍺⍺ and ⍵⍵ are functions., so I'm not entirely sure how to write p(+⍤q)⍹ where p and q both are non-magic arrays.
@dzaima It's mostly annoying for classes, since those have to be declared next to each other in the same file with and to be mutually recursive as well
@dzaima Nah, it really isn't a big deal. Mutually recursive anything is rare, and F# tends to have much smaller classes than C#, consisting of a couple lines at most.
@ASCII-only another issue is if two global vars depend on each other one will get undefined value. I'll have to implement some algorithm to identify these cases
@dzaima Here's how most class definitions look like in F#: type A = { b: B } and type B = { a: A }
The code snippet earlier was the "long form" for full classes that can have methods and constructors and whatnot, but record types which are literally just a couple of values thrown together are more common.
Creative limitation is the concept of how purposely limiting oneself can actually drive creativity. At a 2013 TED conference, artist Phil Hansen made several remarks concerning the value of limitations, among them that "We need to first be limited in order to become limitless,” and “If you treat the problems as possibilities, life will start to dance with you in the most amazing ways.”Creative limitation can also be thought of as a way to achieve a novel effect or goal that is not otherwise possible using conventional, readily accessible, methods. Igor Stravinsky used what he called creativ...
By stochastic I meant that the internal behaviour of the program would be random (even if you can still write a program that gives deterministic output for a given input - it would get there a different way each run)
I didn't mean creative limitation to narrow down just that one choice. I was thinking if you place some arbitrary restrictions on yourself then it may spark creativity
Yes I was imagining something like a grid, where you move a certain number of squares in one direction, or turn 90 degrees, or read the value of the current square, or write a value to the current square, but without the grid. So you move an arbitrary distance in the current direction, or turn an arbitrary angle from the current direction. Reading and writing would not be to a well defined area like a grid square, but could be an area about the current arbitrary point. Perhaps a Gaussian blur
No idea how you deal with arbitrary numbers (floats/rationals/irrationals), so you'd have to have a fairly tightly defined spec to keep implementations matching
@dzaima Calculated from the surrounding area in a way that's different for each program?
@ASCII-only Yes similar to smoothlife. Also, I think smoothlife is approximated by progressively finer grids, so that might be a hint to a way of implementing something like this with only a square grid and floats, but with area of effect when reading and writing being blurred over a large number of squares
@ASCII-only The other option would be only reading/writing at the current precise point, but that would mean a written point would have no effect on subsequent execution unless you get the pointer back to exactly the same point again
@dzaima I don't have any justification for thinking this is a good idea, just:
oh yeah, @trichoplax would the value of a point on the grid be, say, the total amount of value in a square from (point.x - .5, point.y - .5) to (point.x + .5, point.y + .5)
I was thinking that each time you write, that specific point gets the exact amount you specify, and the points nearby get gradually decreasing amounts as you get further away, that add onto whatever value each point already has (or subtract, if you specify a negative amount)
Or (perhaps equivalently?) you could just write to that exact point, but when you read you get a weighted sum of all the points within some small range
Something like a Gaussian blur applied to the point you've just written to smear it out over the plane, with highest values at the centre and fading out with distance
In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function (named after mathematician and scientist Carl Friedrich Gauss). It is a widely used effect in graphics software, typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a smooth blur resembling that of viewing the image through a translucent screen, distinctly different from the bokeh effect produced by an out-of-focus lens or the shadow of an object under usual illumination. Gaussian smoothing is also used as a pre-processing...
You could even make it time based, so each program tick a small amount of Gaussian blur is applied to the entire plane. Each time you write, you write a specific value to the exact point, but each program tick that point spreads out until eventually it has faded to nothing. More recent points are sharper, older points more faded and larger
@ASCII-only Yes it does. If you have a finite plane that won't matter too much, but on an infinite / arbitrarily large plane you'd probably want to limit calculation to some maximum radius, or minimum value before writing it off as zero
Hmm, I've pondered this a bit. 6 piece types, 2 colors, castling, en passant, taking, promotion, checking, and mate. There's a good deal of Opcodes in there
the obvious thing to do from my point of view would be to have an infinitely board that repeats, with the repeat patterns specified by the program, and an area that's an exception to the base pattern (especially as you'd need somewhere to put the Kings!)
and the interpreter just tries to find the optimal move, or at least a move that doesn't immediately lose
this sort of construction normally ends up Turing-complete, but not always
anyway, my advice for creating an esolang: 1. Think of an interesting feature. 2. Create a language with *just* that feature. Remove anything that you'd "expect" to go into a normal programming language, you might not need it. 3. Work out what the language is missing to make it usable for programming (if anything). Then attempt to sketch out a few programs in it (or actually write them if needed). 4. If the language doesn't have infinite memory, give it infinite memory in whatever way is most compatible with the programs you wrote in step 3.
I'd argue that the hardest steps are 1 and 3; 1 requires creativity, 3 requires programming ability (often I've had to get better at programming to be able to work on a language idea of mine)
2 requires discipline but is not all that difficult, so to speak
also, I didn't put "write an interpreter/compiler" anywhere on this list, and it's a step I often forget or fail at in practice, but obviously you'll need that to be able to use the language on PPCG/TIO too
AFAICT with a few experiments, if a method is overriden, which overriding version of the method is selected is done virtually
but method overloads are done in a non-virtual manner
so Swift sees two different methods f, neither of which overrides the other, and does overload resolution as is appropriate to an A rather than to a B (because overload resolution is presumably done statically by the compiler)
fwiw, I believe the only "correct" response to that program in a compiled language would be a compile-time error
FWIW, Rust gives the same result as Swift here: Try it online!
I guess that isn't surprising, though, Rust doesn't really have inheritance
ABC triples
Three positive integers A, B, C are ABC-triple if they are coprime,
with A < B and satisfying the relation : A + B = C
Examples :
1, 8, 9 is an ABC-triple since they are coprime, 1 < 8 and 1 + 8 = 9
6, 8, 14 is not because they are not coprime
7, 5, 12 is not because 7 > 5
You c...
@ngn Which lets you drink more beer, to "rehydrate".
Big Beverage has it all figured out.
@FrownyFrog Many substances can do either X or the opposite, depending on the dosage, whether you're getting high or coming down, and the frequency of use.
Is there something fishy with this utf-8 (I don't show the actual string, because tio refuses to). Because I can get it on to my clipboard, and I can have it do what I want in a terminal application, but when I paste it into a text box online, including tio's I don't get what I want.
Using FTP's ASCII mode to transfer binary files is a bad idea. It is likely to corrupt your data. Badly. Let's simulate this corruption!
Your task is to write a program which takes a file as input and outputs the corrupted version of the file. Because how exactly your file gets corrupted is depe...
My point (!) is: if I define a topological space where the elements are functions (with some suitable definition of openness and closedness for functions), is that still point-set topology?
Then the name "point-set" is nonsensical to me. If everything can be considered a point (vector of R^n, function of C(R,R), ...), why not just drop "point-set" from the name "point-set topology"? It's just topology
@LuisMendo Most concepts just use the nme that fits R^3 with the Euclidean distance. Open balls, for example, are intervals in R, disks in R^2, and cubes with the maximum distance, but we still call them balls.
@LeakyNun Spaces which can be approximated by curves for, e.g., optimization problems.
i am writing a code to create a phonebook using c language. This project has: display, save, load, modify, delete, add , search, exit functions . I stuck with the modify one and this is the required
Modify function will prompt the user for last name and then you should list all matching contacts...
Front lines go front! code-golf array-manipulation
Given two lists of positive integers, bring the elements in the first one that are in the second to the far left, keeping their order intact. You can assume that the second list's elements will all be unique.
These approaches are forbidden.
Fo...
I shutdown my machine every time I'm done with it. With modern SSDs so blazingly fast, what's the point of hibernation when it takes a half second longer to fully startup?
Except for my home server. That only reboots for patches as necessary.
obviously, I don't want the screen open and on while I'm sleeping, and the standby isn't all that trusted with W10 (especially if it's got updates to install, it's then that it wakes up a few seconds after it goes into standby), and stuff tends to be quite lagging after a few days even with hibernation in-between
@EriktheOutgolfer That's not really a concern for a desktop machine. I've run 8-thread simulations for weeks at a time, during summer, without overheating.
@EriktheOutgolfer I might have mined Primecoins with a closed laptop for a few months.
@wizzwizz4 It's not really because of the SSD. Between having a program crash because it doesn't get enough RAM and having everything freeze because all 16 GiB of RAM are getting swapped to the disk, I choose the former.
Longest Descent
code-golf grid
Your task is to determine the length of the longest descent down a "mountain" represented as a grid of integer heights. A "descent" is any path from a starting cell to orthogonally adjacent cells with strictly decreasing heights (i.e. not diagonal and not to the...