What I really like from JavaScript et al. is the ability for functions to be stored in variables very easily, and the ability to attempt to call any variables as a function (and closures)
> I don't know whether it "counts" for badge and rep report purposes... but you will lose the 2 rep. Of course, it only takes one upvote to get you back on track, even if you've had up to 5 downvotes. But it sucks for the last vote of the day to be a downvote...
Lets define a class of functions. These functions will map from the positive integers to the positive integers and must satisfy the following requirements:
The function must be Bijective, meaning that every value maps to and is mapped to by exactly one value.
You must be able to get from any p...
Question: how is capture implemented in compilers? Do you add a global variable? that is not thread safe though so do you create a struct of a bitfield of fields and pass that to child functions?
I think you're ignoring the first part of what @WheatWizard is saying. First turn 0, 1, 2, 3, 4, ... into 0, 1, -1, 2, -2, ...; then add one, then reverse the transformation.
@LeakyNun Remember that CMC from several days ago about applying a wave ([1,0,-1,0,1]) to an array? I posted that to main in case you want to dig up your answer and post it.
Your task today is to apply a wave to an array of numbers. A wave looks like this: [1, 0, -1, 0, 1, 0, -1] Applying it to a given array means adding together the first elements, the second elements, etc.
More precisely:
Your program or function will recieve an array of integers. It must print o...
CMC: Create a pull request for Mathics implementing the Tr command, because it's currently the number 1 feature that breaks Mathics compatibility in Mathematica solutions.
A repeating or recurring decimal is decimal representation of a number whose decimal digits are periodic (repeating its values at regular intervals) and the infinitely-repeated portion is not zero. It can be shown that a number is rational if and only if its decimal representation is repeating or terminating (i.e. all except finitely many digits are zero). For example, the decimal representation of ⅓ becomes periodic just after the decimal point, repeating the single digit "3" forever, i.e. 0.333…. A more complicated example is 3227/555, whose decimal becomes periodic after the second digit following...
In mathematics, the repeating decimal 0.999… (sometimes written with more or fewer 9s before the final ellipsis, for example as 0.9…, or in a variety of other variants such as 0.9, 0.(9), or
0.
9
Ë™
{\displaystyle 0.{\dot {9}}}
) denotes a real number that can be shown to be the number one. In other words, the symbols "0.999…" and "1" represent the same number. Proofs of this equality have been formulated with varying degrees of mathematical rigor, taking into account...
Yeah... the only reason I'm not is because I hate name-changing in general. There are probably about a thousand instances of @MDXF in comments, and if I changed my name those would all look weird
65. Fortran (GFortran), 371 bytes, A000152
function A000152(n)
integer :: n, i, a, sum, index, A000152
integer, dimension(n+1) :: gf
gf(1) = 1
do i=2,n+1
gf(i) = 0
end do
do a=1,16
do i=n+1,2,-1
sum = 0
index = 1
do while (index * index < i)
sum = sum + 2 * gf(i - index * ...
ASCII quine quine we-really-need-an-ascii-tag
Your challenge is to write a program that produces output which has an ASCII value sum identical to the program source.
An example of an ASCII quine would be if the source code was ABC and the output was !!!!!!. This is because the sum of the the AS...