Post History
JavaScript (Node.js), 160 bytes (r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=...
Answer
#5: Post edited
# [JavaScript (Node.js)], 247 bytes- <!-- language-all: lang-javascript -->
g=(r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=>p(n,i-2*l-n))f=(r,l,i,h=s=>[...s].map(x=>x=='+'?1:0))=>g(h(r),h(l),i).reduce((a,c)=>a+'-+'[c],'')[Try it online!][TIO-kw2k3s91]- [JavaScript (Node.js)]: https://nodejs.org
[TIO-kw2k3s91]: https://tio.run/##tVRta9swEP5c/Qoh1lmKZGM3/ZRNCfsyGAw22EdjVmMriYdmG0seGcW/PTvLzksZDUnbyMjI9/I8d@fT/Ur/pCZritr6ZZWr7XYlaSNyUQotm0CrcmXXwsh8d6wlLUXB5LxckDCKItghie8nNfV9UPgR43fw0dvwaDjwiCWzYi7D98VHs8jjIpk1MS1uNdfsVieAFQdB8Klp0r/0fqK5AYSSJcHvtKb0pyNzOP7dRPslY2jZh6hFIdbSDM5msN7I@UZKj3uLaBYy8FvRNW2YWFPNACdoVN5mitJUZKBMuedzL84S4Xlsm1WlsbhptYKMsMRLhAaRVcYaEMQIw3p0736ROrVWNSWZYeITcZDrKkt1Lz0WFmCa2gIQQRMeKdSmVplVuYOBRZyqExez8RfQ8Vfw@S9K7xw@/laEvE8QNj8nSf5WWfLxOSfTy/omOlXYV1T2YkK@X1do1@ez5Pw6F2R6ipGfX1z/wvJOny0vEP@3r3Fzpic6yv3fJ62FEoSWVYNpPxNxtRxmI4Ng0M04P5VptYVpOQ5SZxmMEQpnH7iwxvMhGPZhBKm0ApMVfUDfBzc8w@8ej3E69LWHOMgdYoe@7MEOqgNBh761tm6t0w1xdmh3wlIOAe2KgBeY/GizTBlDwIN8TgutcoH3eoL5U4/uAd1AEt32Hw "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], 160 bytes
- <!-- language-all: lang-javascript -->
- (r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=>p(n,i-2*l-n))
- [Try it online!][TIO-kw3406t4]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-kw3406t4]: https://tio.run/##tVVba9swFH62foUw6yxHsombPqVVwl4Kg40V@mjMamwlc1FlI8klI/i3Z7Js58JoSNpGQSCdy/edcyKf85y@piqTRaUDUeZss6AbJElOBOFUhpyJpf5DFM2HY0WRIIVPZ2LujqMoMnvsxjejCgWBUQSRj6/NpbXBUXfAkZ9Mixkdfy3u1DyPi2QqY1Rcccz9K54YrDgMw29Spn/RzYhjZRCEn4QvaYXQb0tmcYLrEQ@E72@yUigNZc2ZIYcUoirVmklBIC@zlBNYmFuqC2PmQzqDa@AsapG1Amh8X5nU97J8eeC1@lmIWj1qWYglMsbG0pFM11LANibVBbGisxWlHvbm0XTsA6cBg9ECHcHro/IJcOCwjpjb2A@M99LYSkPJ8jpjCKUks8mlEEMvwF6cJQR6nn8LGgC6CmmmtDL1iUHruQYDrttH5k6hG7hkJ7chtNJ94S4KoxnvKdiqYplmuYUxy7WqhpzNht9Bhz/AF7wrvVP48GcR4jZBs/EpSeLPyhL3v1MyPe/dRMcK@4HKnk2It@sCz/XtLDG@zAcyOcaITy9ucGZ5J2@W1xD/ty/x5UyOvCj7/x48LZAAsCglRG1PhOWi641twwdOP06Yqrk23bKfK9Yy3E4We@vHiz3vNefbHqTkzJgs0RN46NzgFH5Z7@M04EcLsZNbxAZ834LtVDuCBvyqdVVrq@vibMBwgpR2AQ1FgHPoPtZZxpRyjYd7nxac5QRu9a6ZGAcezRNw2rmx@Qc "JavaScript (Node.js) – Try It Online"
#3: Post edited
# [JavaScript (Node.js)], 243 bytes- <!-- language-all: lang-javascript -->
- g=(r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=>p(n,i-2*l-n))
f=(r,l,i,h=s=>[...s].map(x=>x=='+'))=>g(h(r),h(l),i).reduce((a,c)=>a+'-+'[c],'')[Try it online!][TIO-kw2jzi64]- [JavaScript (Node.js)]: https://nodejs.org
[TIO-kw2jzi64]: https://tio.run/##tVTfa9swEH6u/gph1lmKZBM3fcqmhL0MBoMN9mjMamwl8dBsI8kjo/hvz86yE6eMhqRtZGTk@/F9d@fT/Ur/pCbTRW2DssrlbrcWRPOcl1wJHSpZru2GG5Hvj7UgJS@oWJRLbxpFEeypF99PahIEoAgiyu7go7NhUX9gEU3mxUJM3xcfzTKPi2SuY1LcKqborUoAKw7D8JPW6V9yP1HMAEJJk/B3WhPy05E5nOBuooKSUrTqQlS84BthemfTW2/FYiuEz3wKPmuyIZryDVEUMEIt8yaThKQ8A2XK/ID5cZZw36e7rCqNxbpRErLBAq8Q6kVWGmtAECMM69G9u@XVqbVSl94ce4HHR7mqslR10mNhAaapLQARNNMjhdzWMrMydzCwPKdq@cVs7AV07BV8wYvSO4ePvRUh6xKEzc5Jkr1Vlmx4zsn0sr6JThX2FZW9mJAd1hXa9fksGbvOBZmdYmTnFze4sLyzZ8sLxP/ta9yc2YmOcv/3SWuhBKFVpTHpZiKuVv1spBAMuhnmpzSNsjAth0HqLMMhQu7sQxfWcB6DoR8GkEpJMFmTB/S9d8Nz/O7xGKdFXzuIUe4QW/TlADaqRoIWfWts3Vin6@Ns0f6EhegD2hcBL7H3o8kyaYwHHt7ntFAy5/ig9zB76tE@oBtIot39Aw "JavaScript (Node.js) – Try It Online"
- # [JavaScript (Node.js)], 247 bytes
- <!-- language-all: lang-javascript -->
- g=(r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=>p(n,i-2*l-n))
- f=(r,l,i,h=s=>[...s].map(x=>x=='+'?1:0))=>g(h(r),h(l),i).reduce((a,c)=>a+'-+'[c],'')
- [Try it online!][TIO-kw2k3s91]
- [JavaScript (Node.js)]: https://nodejs.org
- [TIO-kw2k3s91]: https://tio.run/##tVRta9swEP5c/Qoh1lmKZGM3/ZRNCfsyGAw22EdjVmMriYdmG0seGcW/PTvLzksZDUnbyMjI9/I8d@fT/Ur/pCZritr6ZZWr7XYlaSNyUQotm0CrcmXXwsh8d6wlLUXB5LxckDCKItghie8nNfV9UPgR43fw0dvwaDjwiCWzYi7D98VHs8jjIpk1MS1uNdfsVieAFQdB8Klp0r/0fqK5AYSSJcHvtKb0pyNzOP7dRPslY2jZh6hFIdbSDM5msN7I@UZKj3uLaBYy8FvRNW2YWFPNACdoVN5mitJUZKBMuedzL84S4Xlsm1WlsbhptYKMsMRLhAaRVcYaEMQIw3p0736ROrVWNSWZYeITcZDrKkt1Lz0WFmCa2gIQQRMeKdSmVplVuYOBRZyqExez8RfQ8Vfw@S9K7xw@/laEvE8QNj8nSf5WWfLxOSfTy/omOlXYV1T2YkK@X1do1@ez5Pw6F2R6ipGfX1z/wvJOny0vEP@3r3Fzpic6yv3fJ62FEoSWVYNpPxNxtRxmI4Ng0M04P5VptYVpOQ5SZxmMEQpnH7iwxvMhGPZhBKm0ApMVfUDfBzc8w@8ej3E69LWHOMgdYoe@7MEOqgNBh761tm6t0w1xdmh3wlIOAe2KgBeY/GizTBlDwIN8TgutcoH3eoL5U4/uAd1AEt32Hw "JavaScript (Node.js) – Try It Online"
#1: Initial revision
# [JavaScript (Node.js)], 243 bytes <!-- language-all: lang-javascript --> g=(r,d,n,l=r.length,s=d.length,p=(n,i)=>n?"01110110"[4*p(--n,i-1)+2*p(n,i)+1*p(n,i+1)]:i>=0&i<s?d[i]:r[(i%l+l)%l])=>[...Array(4*l+s+2*n)].map((_,i)=>p(n,i-2*l-n)) f=(r,l,i,h=s=>[...s].map(x=>x=='+'))=>g(h(r),h(l),i).reduce((a,c)=>a+'-+'[c],'') [Try it online!][TIO-kw2jzi64] [JavaScript (Node.js)]: https://nodejs.org [TIO-kw2jzi64]: https://tio.run/##tVTfa9swEH6u/gph1lmKZBM3fcqmhL0MBoMN9mjMamwl8dBsI8kjo/hvz86yE6eMhqRtZGTk@/F9d@fT/Ur/pCbTRW2DssrlbrcWRPOcl1wJHSpZru2GG5Hvj7UgJS@oWJRLbxpFEeypF99PahIEoAgiyu7go7NhUX9gEU3mxUJM3xcfzTKPi2SuY1LcKqborUoAKw7D8JPW6V9yP1HMAEJJk/B3WhPy05E5nOBuooKSUrTqQlS84BthemfTW2/FYiuEz3wKPmuyIZryDVEUMEIt8yaThKQ8A2XK/ID5cZZw36e7rCqNxbpRErLBAq8Q6kVWGmtAECMM69G9u@XVqbVSl94ce4HHR7mqslR10mNhAaapLQARNNMjhdzWMrMydzCwPKdq@cVs7AV07BV8wYvSO4ePvRUh6xKEzc5Jkr1Vlmx4zsn0sr6JThX2FZW9mJAd1hXa9fksGbvOBZmdYmTnFze4sLyzZ8sLxP/ta9yc2YmOcv/3SWuhBKFVpTHpZiKuVv1spBAMuhnmpzSNsjAth0HqLMMhQu7sQxfWcB6DoR8GkEpJMFmTB/S9d8Nz/O7xGKdFXzuIUe4QW/TlADaqRoIWfWts3Vin6@Ns0f6EhegD2hcBL7H3o8kyaYwHHt7ntFAy5/ig9zB76tE@oBtIot39Aw "JavaScript (Node.js) – Try It Online"