Post History
APL (Dyalog Classic), 20 18 17 16 bytes ⊢/,+.×⍣⎕⍨∘.+⍨⌽⍳2 Matrix implementation, requires ⎕IO←0. Thanks to @Razetime for the idea, -3 bytes by me Try it online! APL (Dyalog Classic), 19 18 byt...
Answer
#6: Post edited
# [APL (Dyalog Classic)], <strike>20</strike> <strike>18</strike> 17 bytes⊢/,+.×⍣⎕⍨⊢∘.+⍨⌽⍳2- Matrix implementation, requires `⎕IO←0`. _Thanks to @Razetime for the idea, -3 bytes by me_
[Try it online!](https://razetime.github.io/APLgolf/?h=e9Q31dP/UdsEAwA&c=e9S1SF9HW@/w9Ee9ix/1TX3Uu@JR16JHHTP0tEHMnr2PejcbAQA&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)- # [APL (Dyalog Classic)], <strike>19</strike> 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], <strike>20</strike> <strike>18</strike> <strike>17</strike> 16 bytes
- ⊢/,+.×⍣⎕⍨∘.+⍨⌽⍳2
- Matrix implementation, requires `⎕IO←0`. _Thanks to @Razetime for the idea, -3 bytes by me_
- [Try it online!](https://razetime.github.io/APLgolf/?h=e9Q31dP/UdsEAwA&c=e9S1SF9HW@/w9Ee9ix/1TX3Uu@JRxww9bRDds/dR72YjAA&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)
- # [APL (Dyalog Classic)], <strike>19</strike> 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
#5: Post edited
# [APL (Dyalog Classic)], 18 bytes- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
# [APL (Dyalog Classic)], 18 bytes⊢/,+.×⍣⎕⍨(∘.+⍨⌽⍳2)Matrix implementation, requires `⎕IO←0`. _Thanks to @Razetime for the idea, -2 bytes by me_[Try it online!](https://razetime.github.io/APLgolf/?h=e9Q31dP/UdsEAwA&c=e9S1SF9HW@/w9Ee9ix/1TX3Uu0LjUccMPW0g41HP3ke9m400AQ&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], <strike>20</strike> <strike>18</strike> 17 bytes
- ⊢/,+.×⍣⎕⍨⊢∘.+⍨⌽⍳2
- Matrix implementation, requires `⎕IO←0`. _Thanks to @Razetime for the idea, -3 bytes by me_
- [Try it online!](https://razetime.github.io/APLgolf/?h=e9Q31dP/UdsEAwA&c=e9S1SF9HW@/w9Ee9ix/1TX3Uu@JR16JHHTP0tEHMnr2PejcbAQA&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)
- # [APL (Dyalog Classic)], <strike>19</strike> 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
#4: Post edited
- # [APL (Dyalog Classic)], 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- ⊢/,+.×⍣⎕⍨(∘.+⍨⌽⍳2)
Matrix implementation _Thanks to @Razetime for the idea, -2 bytes by me_[Try it online!](https://razetime.github.io/APLgolf/?h=AwA&c=M3nU1ayjrXd4@qPexY/6pj7qXWGkYPSod4uRgiEQGgAA&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- ⊢/,+.×⍣⎕⍨(∘.+⍨⌽⍳2)
- Matrix implementation, requires `⎕IO←0`. _Thanks to @Razetime for the idea, -2 bytes by me_
- [Try it online!](https://razetime.github.io/APLgolf/?h=e9Q31dP/UdsEAwA&c=e9S1SF9HW@/w9Ee9ix/1TX3Uu0LjUccMPW0g41HP3ke9m400AQ&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
#3: Post edited
- # [APL (Dyalog Classic)], 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- ⊢/,+.×⍣⎕⍨(∘.+⍨⌽⍳2)
- Matrix implementation _Thanks to @Razetime for the idea, -2 bytes by me_
- [Try it online!](https://razetime.github.io/APLgolf/?h=AwA&c=M3nU1ayjrXd4@qPexY/6pj7qXWGkYPSod4uRgiEQGgAA&f=AwA&i=S@My4ErjMgRiUwA&r=tio&l=apl-dyalog&m=tradfn&n=f#)
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
#2: Post edited
# [APL (Dyalog Classic)], 19 bytes- <!-- language-all: lang-apl -->
{⍵<2:⍵⋄+/∇¨⍵-1 1 2}- Generic recursive implementation part 2
[Try it online!][TIO-kl9kntpy]- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 18 bytes
- <!-- language-all: lang-apl -->
- {⍵<2:⍵⋄+/∇¨⍵-1,⍳2}
- Generic recursive implementation part 2
- _-1 byte thanks to @Razetime_
- [Try it online!][TIO-kl9q3svq]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9q3svq]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqHOo97NRrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8Pw2kZbOhAQA "APL (Dyalog Classic) – Try It Online"
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1}
- Random fun implementation
- [Try it online!][TIO-kl9l43hh]
- # [APL (Dyalog Classic)], 26 bytes
- <!-- language-all: lang-apl -->
- {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a}
- Random fun implementation 2
- [Try it online!][TIO-kl9lfvbo]
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online"
- [APL (Dyalog Classic)]: https://www.dyalog.com/
- [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"
#1: Initial revision
# [APL (Dyalog Classic)], 19 bytes <!-- language-all: lang-apl --> {⍵<2:⍵⋄+/∇¨⍵-1 1 2} Generic recursive implementation part 2 [Try it online!][TIO-kl9kntpy] # [APL (Dyalog Classic)], 26 bytes <!-- language-all: lang-apl --> {×⍵:⌊0.5+(∇⍵-1)÷1-⍨2*÷2⋄1} Random fun implementation [Try it online!][TIO-kl9l43hh] # [APL (Dyalog Classic)], 26 bytes <!-- language-all: lang-apl --> {a←⍳⌈⍵÷2⋄(2*a)+.×⍵!⍨1+2×a} Random fun implementation 2 [Try it online!][TIO-kl9lfvbo] [APL (Dyalog Classic)]: https://www.dyalog.com/ [TIO-kl9lfvbo]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/qxOB1KPezY96Oh71bj283ehRd4uGkVaiprbe4elAEcVHvSsMtY0OT0@s/Z8GVtr3qKv5Ue@aR71bDq03ftQ2EWhWcJAzkAzx8Az@n6ZgDAA "APL (Dyalog Classic) – Try It Online" [APL (Dyalog Classic)]: https://www.dyalog.com/ [TIO-kl9l43hh]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@vD0R71brR71dBnomWprPOpoB3J1DTUPbzfUfdS7wkjr8HajR90thrX/0x61TXjU2/eoq/lR75pHvVsOrTd@1DbxUd/U4CBnIBni4Rn8P03BFAA "APL (Dyalog Classic) – Try It Online" [APL (Dyalog Classic)]: https://www.dyalog.com/ [TIO-kl9kntpy]: https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@/@lHvVhsjKyD5qLtFW/9RR/uhFUCOrqGCoYJR7f@0R20THvX2PepqftS75lHvlkPrjR@1TXzUNzU4yBlIhnh4Bv9PA@nYbGgAAA "APL (Dyalog Classic) – Try It Online"