Skip to main content
deleted 1 character in body
Source Link

Julia 0.2-0.7, bytes = 9859, versions = 6, score = 169.33833

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof=[4,0,3,0,5,2,6,7][endof(subtypes(AbstractArray))]-16]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

(Thanks @one-minute-more for almost halving the bytecount)

Julia 0.2-0.7, bytes = 98, versions = 6, score = 16.33

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Julia 0.2-0.7, bytes = 59, versions = 6, score = 9.833

f()=[4,0,3,0,5,2,6,7][endof(subtypes(AbstractArray))-16]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

(Thanks @one-minute-more for almost halving the bytecount)

formatting
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

Julia 0.2-0.7, bytes = 98, versions=6versions = 6, score = 16.33

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Julia 0.2-0.7, bytes = 98, versions=6, score = 16.33

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Julia 0.2-0.7, bytes = 98, versions = 6, score = 16.33

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

deleted 6 characters in body
Source Link

Julia 0.2-0.7, bytes = 9998, versions=6, score = 16.533

v=onesv=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
v[:]=7
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Julia 0.2-0.7, bytes = 99, versions=6, score = 16.5

v=ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
v[:]=7
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Julia 0.2-0.7, bytes = 98, versions=6, score = 16.33

v=7ones(99)
v[22]=2
v[19]=3
v[17]=4
v[21]=5
v[27]=6
f()=v[endof(subtypes(AbstractArray))]/10

Turns out each version of julia has had a different number of abstract array subtypes. So we use the number of subtypes to index into an array that contains the version number. The current nightly (0.7), currently has 25, but it is the fallback case anyway.

Julia 0.1 also has a different number of AbstractArray subtypes I would guess. However, julia 0.1 does not have the subtypes function. So I can't trivially retrieve them.

A significant improvement over my previous answer.

Source Link
Loading