Skip to main content
fun version
Source Link
Sundar R
  • 6.6k
  • 19
  • 33

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

And just for fun, here's a function using bit shifting and arithmetic instead of using character codepoints (depends on this being Julia version 0.6, which seems an appropriately golf-y hack):

Julia 0.6, 5047 bytes

(l=length("$VERSION")l=VERSION.minor,o=true)->o<<(l+l+ol+l-o)-o<<lo<<~-l-o-o

Try it online!Try it online!

Here, o=true evaluates as 1 during arithmetic. VERSION is an inbuilt stringconstant containing "0.6.2" (orthe current Julia version, and "0.6VERSION.0"minor on TIO), so has length 5is 6 in this case. We left shift 1 by 5+5+1=116+6-1=11, giving 2048, then subtract 1<<51<<(6-1)=32 and 1 and 1 from it, to give 2014.

2018 version would be:

(l=length("$VERSION")l=VERSION.minor,o=true)->o<<(l+l+ol+l-o)-o<<l+o+oo<<~-l+o+o

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

And just for fun, here's a function using bit shifting and arithmetic instead of using character codepoints (depends on this being Julia version 0.6, which seems an appropriately golf-y hack):

Julia 0.6, 50 bytes

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l-o-o

Try it online!

Here, o=true evaluates as 1 during arithmetic. VERSION is an inbuilt string containing "0.6.2" (or "0.6.0" on TIO), so has length 5. We left shift 1 by 5+5+1=11, giving 2048, then subtract 1<<5=32 and 1 and 1 from it, to give 2014.

2018 version would be:

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l+o+o

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

And just for fun, here's a function using bit shifting and arithmetic instead of using character codepoints (depends on this being Julia version 0.6, which seems an appropriately golf-y hack):

Julia 0.6, 47 bytes

(l=VERSION.minor,o=true)->o<<(l+l-o)-o<<~-l-o-o

Try it online!

Here, o=true evaluates as 1 during arithmetic. VERSION is an inbuilt constant containing the current Julia version, and VERSION.minor is 6 in this case. We left shift 1 by 6+6-1=11, giving 2048, then subtract 1<<(6-1)=32 and 1 and 1 from it, to give 2014.

2018 version would be:

(l=VERSION.minor,o=true)->o<<(l+l-o)-o<<~-l+o+o
fun version
Source Link
Sundar R
  • 6.6k
  • 19
  • 33

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

And just for fun, here's a function using bit shifting and arithmetic instead of using character codepoints (depends on this being Julia version 0.6, which seems an appropriately golf-y hack):

Julia 0.6, 50 bytes

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l-o-o

Try it online!

Here, o=true evaluates as 1 during arithmetic. VERSION is an inbuilt string containing "0.6.2" (or "0.6.0" on TIO), so has length 5. We left shift 1 by 5+5+1=11, giving 2048, then subtract 1<<5=32 and 1 and 1 from it, to give 2014.

2018 version would be:

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l+o+o

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!

And just for fun, here's a function using bit shifting and arithmetic instead of using character codepoints (depends on this being Julia version 0.6, which seems an appropriately golf-y hack):

Julia 0.6, 50 bytes

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l-o-o

Try it online!

Here, o=true evaluates as 1 during arithmetic. VERSION is an inbuilt string containing "0.6.2" (or "0.6.0" on TIO), so has length 5. We left shift 1 by 5+5+1=11, giving 2048, then subtract 1<<5=32 and 1 and 1 from it, to give 2014.

2018 version would be:

(l=length("$VERSION"),o=true)->o<<(l+l+o)-o<<l+o+o
Source Link
Sundar R
  • 6.6k
  • 19
  • 33

Julia 0.6, 9 bytes

Int('ߞ')

Try it online!

Just for completeness' sake. Here's 2018 (same trick, different character):

Int('ߢ')

Try it online!