https://upload.wikimedia.org/wikipedia/commons/a/af/Turkey_map_with_30._%26_45._meridians.png 30° is UTC+2 and 45° is UTC+3. We were using UTC+2 with DST, now it's UTC+3 all year. wtf
Design and implement an application that reads a sentence (at least 4 words) from the user and store them in a link list, and then prints the sentence with the characters of each word backwards. Use a stack to reverse the characters of each word.(using java)
@Neil People were well aware that it sucked. There just weren't other options that didn't also suck, and it was bundled with Windows (which had somewhere around 80% usage).
Remove the Accept feature
This feature is likely way too integral to how SE instances work for this to be possible without forking the software, but I don't think the concept of accepted answers is useful on PPCG.
The most fundamental pillar of this community is that every single question needs...
Background (skip to definitions)
Euler proved a beautiful theorem about the complex numbers: eix = cos(x) + i sin(x).
This makes de Moivre's theorem easy to prove:
(eix)n = ei(nx)
(cos(x) + i sin(x))n = cos(nx) + i sin(nx)
We can plot complex numbers using the two-dimensional Euclidean plane...
Change the rules of Life
Life-like cellular automaton are cellular automaton that are similar to Conway's Game of Life, in that they operate on a (theoretically) infinitely large square grid, where each cell has exactly 8 neighbours, and is one of 2 states, namely alive and dead.
However, these...
Made this the other day, super fun to just see a picture and do a build: https://steamcommunity.com/sharedfiles/filedetails/?id=1134084490 It's like dang legos.
CMC: Given N return an (N+1)×N boolean matrix where the first row is all true, and the last is all false and each row has one more true than its predecessor in a pseudo-random position.
¬TXṬo Helper Link; add another 1 somewhere pseudorandom
¬ Vectorizing Logical NOT; 0s become 1s and vice versa
T Get indices of truthy values (formerly 0s)
X Pick a random index
Ṭ Make a list with a 1 at that index
o Vectorizing Logical OR them together to put the 1 back in the list
0ẋÇÐĿ Main Link
ẋ Repeat by the argument
0 0
ÐĿ While the results are unique (that is, while they're not all truthy)
Ç Place a random 1
@Mego are those sunglasses to help you keep cool in that hot weather over there?
:P
hi can I have ideas for a name for my new programming language? I've decided that its syntax will kind of resemble APL's a bit in that functions are pre/in fix and operators are postfix, and I'll have brackets like [...] for a nilad, (...) for a monad, and {...} for a dyad (essentially link separators but easier to use)
also it focuses on numbers and lists but does have a few string functions too
@HyperNeutrino Dyalog uses curly braces for both monadic and dyadic functions, and also for monadic and dyadic operators. Operators are disambiguated by the presence of ⍺⍺ and optionally ⍵⍵.
@Adám Is the term n-adic for describing the number of arguments coming from APL? I think in all other languages I've come across this it was called n-ary.
Monadic may refer to:
In logic and mathematics, a predicate, a relation or a function having an arity of one is called monadic
In category theory, an adjunction is called monadic if and only if it is equivalent to the adjunction given by the Eilenberg–Moore algebras of its associated monad
In chemistry, monadic is a synonym for univalent
== See also ==
All pages with a title containing Monadic
Monad (disambiguation)...
APL, 10 bytes
{⍺⍺[⍵⍵⍳⍵]}
This is an APL operator. In APL, ⍵ and ⍺ are used to pass values, while ⍵⍵ and ⍺⍺ are usually used to pass functions. I'm abusing this here to have 3 arguments. ⍺⍺ is the left argument, ⍵⍵ is the "inner" right argument, and ⍵ is the "outer" right argument.
Basically: ...
Dyalog APL, 104 81 79 93 75 bytes
Edit: Now handles 4342343 -M 34 → 43423 correctly.
M←{⍎(5|⌊⍺⍺2)⊃'⍺×M⍣(⍺≠1)⍎⊃b'(b⎕R(⍵⍴'&')⊢a)'10⊥⍺⍵'(('(.*)',b←⍕⍵)⎕R'\1'⊢a←⍕⍺)}
Background
This extends APL to include the Manhattan operator. An operator in APL terminology is a modifier of functions (e.g. ÷). ...
Life and Death of Trees
code-golf polyglot ascii-art
The Challenge
Write a program that takes an integer N as input, and outputs the stage of life or death that a tree is currently in. N will always be between 0 and 10.
The Stages of Life and Death
Life: To draw a stage of life, simply draw...
The answer I have now is based on a piece of code I wrote a while ago, but this was optimized for exactness and efficiency, and I think I can sacrifice efficiency.
Haskell, 128 bytes
(h:t)%q|all(==0)t=[]|1>0=h:zipWith(\x y->x-h*y)t q%q
f n=foldl(%)(1:(0<$[2..n])++[-1])[tail$f k++repeat 0|k<-[1..n-1],mod n k<1]
Try it online!
No imports.
Enter the x and y (comma seperated) for every square (indexed 0-7) on a checkerboard, followed by a "r" or "b" (for red or black) where the top of the board (closer to y=0) is red and the bottom is black. newlines between squares and no spaces.
Desired output:
0,0r
0,2r
0,4r
0,6r
1,1r
1,3r
1,5r...
@LeakyNun Is it ok if it only works up to input 20 or so, due to floating point errors? What's the requirement for maximum input that should be supported?
Given a positive integer nesting level n and string s of printable ascii characters( to ~, output a program which, when run in the same language, outputs a program which outputs a program . . . which outputs the string s.
A total of n programs should be generated, all of which should be run in t...
I find it interesting that leaving a chat room from one computer causes all other computers with that chat room open to navigate to the SE chat homepage
In mathematics, an iterated function is a function X → X (that is, a function from some set X to itself) which is obtained by composing another function f : X → X with itself a certain number of times. The process of repeatedly applying the same function is called iteration. In this process, starting from some initial number, the result of applying a given function is fed again in the function as input, and this process is repeated.
Iterated functions are objects of study in computer science, fractals, dynamical systems, mathematics and renormalization group physics.
== Definition ==
The formal...
code-golf geometry
Like a path-segment; touched for the very first time
Given an ordered list of 2 or more 2D cartesian points, output a truthy value if the path touches itself or self-intersects, or a falsy value if it does not touch itself or self-intersect.
You may assume that consecutive p...
If there is a non-recursive solution to a problem, should one take it to avoid overflowing the call stack, or take the recursive solution because it's cleaner, and (in this particular hypothetical case) easier to understand?