Official Dyalog APL 2016 Year Game
Hexagony, 888 bytes
Okay, first some ground rules for Hexagony, in case anyone wants to beat this:
- I'm interpreting "snippet" as a linear piece of code that can be dumped into any sufficiently large program, provided the current and adjacent memory edges are zero.
- The snippet has to be entered from the left and exited from the right. I'd be able to save quite a bunch of bytes without that (e.g.
2|016
for 22), but it seems most in the spirit of the challenge. - The snippet "produces" a given number, if any memory edge (not necessarily the current one) holds that value after execution.
- The rule forbidding any other numbers in the snippet affects both other digits as well as any letters, since they effectively act as integer literals in Hexagony. (Those would save a ton of bytes.)
So here is the list. I did test most of them but not all (some are trivial modifications of others), so I hope I didn't make any mistakes:
2016
20&1}6
2}016
2)}016
20{16'-
201}6(
201}6
201}6)
2}016":
2(0(}16
2(0}16
2(0)}16
)2}016
)2)}016
20}16((
20}16(
20}16
20}16)
20}16))
20(}16
20}16
20)}16
20))}16
20)))}16
20}1)6((
20}1)6(
20}1)6
20}1)6)
201{6)':
2)0(}16
2)0}16
2)0)}16
2{016'*
201{6':
2{016)'*
20}1))6(
20}1))6
20}1))6)
20}1))6))
2))0(}16
2))0}16
2))0)}16
2))0))}16
2))0)))}16
20)){1)'6*
2){016('*
2){016('*)
2){016'*(
2){016'*
2){016'*)
2)))0}16
2){016)'*
2){016)'*)
2{01)6)'*(
2{01)6)'*
2{01)6)'*)
2{01)6)'*))
2{01)6)'*)))
2))))0((}16
2))))0(}16
2))))0}16
2))))0)}16
2)0){1)'6*
2)){016'*(
2)){016'*
2)){016'*)
2)){016'*))
2)){016'*)))
2{01))6('*(
2{01))6('*
2{01))6'*((
2{01))6'*(
2{01))6'*
2{01))6'*)
2{01))6)'*
2){01)6('*
2){01)6'*((
2){01)6'*(
2){01)6'*
2){01)6'*)
20{1)))'6*
2){01)6)'*
2){01)6)'*)
2){01)6)'*))
2){01)6))'*
2){01)6))'*)
2){01)6))'*))
2){01)6)))'*
2{01)))6(('*
2{01)))6('*(
2{01)))6('*
2{01)))6'*(
2{01)))6'*
2{01)))6'*)
2{01)))6)'*
2{01)))6)'*)
2{01)))6))'*
2(01((((}16
2(01(((}16
2(01((}16
2(01(}16
I got a bit lazy towards the end, so I'm sure this isn't optimal. Might be interesting (and possible) to brute force these.
J, 1041 ... 838 bytes
981 961 952 860 859
I got a little lazy to the end, but it should be more fixed than less. I don't think I'll ever overtake Hexagony, but you never know! beating hexagony! Saved 9 bytes thanks to Zgarb! and so much more to Lynn!
20=16
*2016
2[016
2+01[6
20-16
p:2[016
201]6
2+0-1-6
-:20]16
2+01+6
-:20[16
p:20-16
+/2$01]6
<:20-1]6
20-1]6
<:20]16
20]16
p:201]6
2+016
20-1[6
20[16
20+1[6
20++~1[6
+/q:2016
20-(+:1)-6
<:20+1]6
20+1]6
20+1+6
+:20-1]6
p:2+01+6
-2-+:016
<:2*016
2*016
>.201%6
<.201%6
<:20+16
20+16
20+>:16
+~20-1[6
-20-p:16
+:20[16
p:2*01*6
>:p:2*01*6
<:<.%:2016
<.%:2016
>.%:2016
+/q:*:2016
p:20-1]6
>:p:20-1]6
*:2+0-1-6
+:20-1-6
20++:16
<.%:20^%:1+6
20+#i:i:16
*/2,01]$~-:6
<:<.o.2+016
<.o.2+016
>.o.2+016
<:p:20]16
p:20]16
>:p:20]16
2+p:016
<.o.20[16
<:2^01]6
2^01]6
>:2^01]6
<:p:2+016
p:2+016
>:p:2+016
>:>:p:2+016
<:p:20-1[6
p:20-1[6
+/+~20 16
p:20[16
>:p:20[16
>:>:p:20[16
-:+/2+i.016
<:<:p:20+1[6
<:p:20+1[6
20+p:16
20*.16
*:2+01+6
>:*:2+01+6
p:20++~1[6
<.o.20+1+6
>.o.20+1+6
>:>.o.20+1+6
<.o.+:20-1]6
>.o.+:20-1]6
p:+/q:2016
>:p:+/q:2016
<.o.p:2+01+6
>.o.p:2+01+6
(*:-:20)-1+6
>:(*:-:20)-1+6
<:(++:)2*016
(++:)2*016
p:20-(+:1)-6
2**~p:-:01]6
<:*:-:20[16
*:-:20[16
Highlights and Notes
I used prime numbers a lot in this. In fact, I used p:
(the Nth prime) function 37 times in this thing.
*:-:20[16
90 was made using a fork. Yay! It's approximate to this:
(*+&1)2+01+6
Translated as
inc =: + &1
mul =: *
nin =: 2 + 1 + 6
NB. since (f g) y = y f (g y):
(mul inc) nin = nin mul (inc y)
= 9 * 9+1
= 90
54 uses a shaping ravel!
*/2,01]$~-:6
Is equivalent to
*/ 2 , $~ -:6
*/ 2 , -:6 $ -:6
*/ 2 , 3 $ 3
*/ 2 , 3 , 3 , 3
2 * 3 * 3 * 3
54
JavaScript, 1021 bytes
Fixed and saved two bytes thanks to Charlie Wynn and ETHProductions.
201&6
-~!2016
2%016
201%6
20%16
2^0^1^6
2*0*1+6
2|0|1|6
2*01+6
2-~01+6
~2+016
~2+016
2^016
20-1-6
2|016
20+1-6
20&16
2-~016
2.0+16
20^1+6
20|16
-~20|16
20*1|6
20|1|6
-2*~01*6
20-1+6
20+1*6
20+1+6
2*016
-~(2*016)
2*-~016
~-(2.0*16)
2.0*16
-~(2.0*16)
2.0*-~16
~-20+16
20+16
-~20+16
-~-~20+16
-~2*~-016
20*-~1.6
~-(-~2*016)
-~2*016
~-~-(~2*~016)
~-(~2*~016)
~2*~016
20<<1|6
20*-~1-~6
~2*~-~016
-~(~2*~-~016)
~-~(~-~2*~-016)
~2*~-~-~016
-~-~2*~-016
20*-~-~1+~6
20*-~-~1-6
20*-~-~1-~-6
-~-~2*016
-~20*-~-~1-6
-~-~(-~-~2*016)
~-(20*~-~(1-6))
~-~2*~016
-~(20*~-~(1-6))
-~-~(20*~-~(1-6))
-~20*~-~(1-6)
~-~2*~-~016
20*-~-~1+~-6
20*-~-~1+6
20*-~-~1-~6
~-~2*~16
-~20*-~-~1+6
-~-~-~2*016
~-(~-~2*~-~16)
~-~2.0*~-~16
-~(~-~2*~-~16)
20*-~-~-~1-6
~-~-~2*~016
~-20*~(1-6)
-~(~-20*~(1-6))
~-~-(20*~(1-6))
~-(20*~(1-6))
20*~(1-6)
-~(20*~(1-6))
~-~-(~20*-~(1-6))
~-(~20*-~(1-6))
~20*-~(1-6)
20*-~-~-~1+~-6
20*-~-~-~1+6
20*-~-~-~1+-~6
20*-~-~-~1+-~-~6
~-(~-~-20*-(1-6))
~-~-20*-(1-6)
-~(~-~-20*-(1-6))
~-~-~-(~-20*-(1-6))
~-~-(~-20*-(1-6))
~-(~-20*-(1-6))
~-20*-(1-6)
-~(~-20*-(1-6))
~-~-~-(20*-(1-6))
~-~-(20*-(1-6))
~-(20*-(1-6))
20*-(1-6)