Post History
APL (Dyalog Unicode), 11 3 1 byte ⊥ Try it online! Anyone who can golf this further gets a cookie! Function submission which takes reversed coefficients as right argument and $x$ as left ar...
Answer
#5: Post edited
# [APL (Dyalog Unicode)], <sup><del>11</del></sup> 3 bytes- <!-- language-all: lang-apl -->
⊥∘⌽[Try it online!][TIO-khik693b]- [APL (Dyalog Unicode)]: https://www.dyalog.com/
[TIO-khik693b]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91LX3UMeNRz97/aUD@o96@R13Nj3rXPOrdcmi98aO2iUCVwUHOQDLEwzP4v6GFkUKagoahJpcJmNYx0uQy0DMFsY30TEE8QwjPUM9AxwiIjYHYRM9AEwA "APL (Dyalog Unicode) – Try It Online"Function submission which takes coefficients as right argument and \$x\$ as left argument.- -8 bytes from dzaima and rak1507([APL Orchard](https://chat.stackexchange.com/transcript/message/56155063#56155063)).
Uses a simple decode.
- # [APL (Dyalog Unicode)], <sup><del>11</del></sup> <sup><del>3</del></sup> 1 byte
- <!-- language-all: lang-apl -->
- ⊥
- [Try it online!][TIO-khiphjoa]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khiphjoa]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91Lf2fBmQ96u171NX8qHfNo94th9YbP2qbCFQTHOQMJEM8PIP/G1oYKaQpPOrZq2GoyWUCY@oYaXIZ6JlCuUZ6piABQ7iAoZ6BjhEQGwOxiZ6BJgA "APL (Dyalog Unicode) – Try It Online"
- Anyone who can golf this further gets a cookie!
- Function submission which takes reversed coefficients as right argument and \$x\$ as left argument.
- -8 bytes from dzaima and rak1507([APL Orchard](https://chat.stackexchange.com/transcript/message/56155063#56155063)).
- -2 bytes from Adám.
- Uses a mixed base conversion.
#4: Post edited
# [APL (Dyalog Unicode)], <strike><sup>11</strike></sup> 3 bytes- <!-- language-all: lang-apl -->
- ⊥∘⌽
- [Try it online!][TIO-khik693b]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khik693b]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91LX3UMeNRz97/aUD@o96@R13Nj3rXPOrdcmi98aO2iUCVwUHOQDLEwzP4v6GFkUKagoahJpcJmNYx0uQy0DMFsY30TEE8QwjPUM9AxwiIjYHYRM9AEwA "APL (Dyalog Unicode) – Try It Online"
- Function submission which takes coefficients as right argument and \$x\$ as left argument.
- -8 bytes from dzaima and rak1507([APL Orchard](https://chat.stackexchange.com/transcript/message/56155063#56155063)).
- Uses a simple decode.
- # [APL (Dyalog Unicode)], <sup><del>11</del></sup> 3 bytes
- <!-- language-all: lang-apl -->
- ⊥∘⌽
- [Try it online!][TIO-khik693b]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khik693b]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91LX3UMeNRz97/aUD@o96@R13Nj3rXPOrdcmi98aO2iUCVwUHOQDLEwzP4v6GFkUKagoahJpcJmNYx0uQy0DMFsY30TEE8QwjPUM9AxwiIjYHYRM9AEwA "APL (Dyalog Unicode) – Try It Online"
- Function submission which takes coefficients as right argument and \$x\$ as left argument.
- -8 bytes from dzaima and rak1507([APL Orchard](https://chat.stackexchange.com/transcript/message/56155063#56155063)).
- Uses a simple decode.
#3: Post edited
# [APL (Dyalog Unicode)], 11 [bytes](https://github.com/abrudz/SBCS)- <!-- language-all: lang-apl -->
{+/⍺×⍵*⍳≢⍺}[Try it online!][TIO-khh92dss]- [APL (Dyalog Unicode)]: https://www.dyalog.com/
[TIO-khh92dss]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/6u19R/17jo8/VHvVq1HvZsfdS4Ccmv/pwElH/X2PepqftS75lHvlkPrjR@1TQRqCw5yBpIhHp7B/zUMNRXSFAwtjLg0DHWMQGwTLg0jPVMI20DPFCiuZ6CjYAQijEGEiZ4BWIueKQA "APL (Dyalog Unicode) – Try It Online"Function submission which takes coefficients as left argument and \$x\$ as right argument.Assumes `⎕IO←0` (0-indexing)## Explanation```{+/⍺×⍵*⍳≢⍺}≢⍺ length of the coefficients⍳ range 0..length-1⍵* x to the power of each of those⍺× multiply that by the coefficients+/ and fold the list by addition(sum it)
- # [APL (Dyalog Unicode)], <strike><sup>11</strike></sup> 3 bytes
- <!-- language-all: lang-apl -->
- ⊥∘⌽
- [Try it online!][TIO-khik693b]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khik693b]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/x91LX3UMeNRz97/aUD@o96@R13Nj3rXPOrdcmi98aO2iUCVwUHOQDLEwzP4v6GFkUKagoahJpcJmNYx0uQy0DMFsY30TEE8QwjPUM9AxwiIjYHYRM9AEwA "APL (Dyalog Unicode) – Try It Online"
- Function submission which takes coefficients as right argument and \$x\$ as left argument.
- -8 bytes from dzaima and rak1507([APL Orchard](https://chat.stackexchange.com/transcript/message/56155063#56155063)).
- Uses a simple decode.
#2: Post edited
# [APL (Dyalog Unicode)], 22 [bytes](https://github.com/abrudz/SBCS)- <!-- language-all: lang-apl -->
- {+/⍺×⍵*⍳≢⍺}
- [Try it online!][TIO-khh92dss]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khh92dss]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/6u19R/17jo8/VHvVq1HvZsfdS4Ccmv/pwElH/X2PepqftS75lHvlkPrjR@1TQRqCw5yBpIhHp7B/zUMNRXSFAwtjLg0DHWMQGwTLg0jPVMI20DPFCiuZ6CjYAQijEGEiZ4BWIueKQA "APL (Dyalog Unicode) – Try It Online"
- Function submission which takes coefficients as left argument and \$x\$ as right argument.
- Assumes `⎕IO←0` (0-indexing)
- ## Explanation
- ```
- {+/⍺×⍵*⍳≢⍺}
- ≢⍺ length of the coefficients
- ⍳ range 0..length-1
- ⍵* x to the power of each of those
- ⍺× multiply that by the coefficients
- +/ and fold the list by addition(sum it)
- # [APL (Dyalog Unicode)], 11 [bytes](https://github.com/abrudz/SBCS)
- <!-- language-all: lang-apl -->
- {+/⍺×⍵*⍳≢⍺}
- [Try it online!][TIO-khh92dss]
- [APL (Dyalog Unicode)]: https://www.dyalog.com/
- [TIO-khh92dss]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/6u19R/17jo8/VHvVq1HvZsfdS4Ccmv/pwElH/X2PepqftS75lHvlkPrjR@1TQRqCw5yBpIhHp7B/zUMNRXSFAwtjLg0DHWMQGwTLg0jPVMI20DPFCiuZ6CjYAQijEGEiZ4BWIueKQA "APL (Dyalog Unicode) – Try It Online"
- Function submission which takes coefficients as left argument and \$x\$ as right argument.
- Assumes `⎕IO←0` (0-indexing)
- ## Explanation
- ```
- {+/⍺×⍵*⍳≢⍺}
- ≢⍺ length of the coefficients
- ⍳ range 0..length-1
- ⍵* x to the power of each of those
- ⍺× multiply that by the coefficients
- +/ and fold the list by addition(sum it)
#1: Initial revision
# [APL (Dyalog Unicode)], 22 [bytes](https://github.com/abrudz/SBCS) <!-- language-all: lang-apl --> {+/⍺×⍵*⍳≢⍺} [Try it online!][TIO-khh92dss] [APL (Dyalog Unicode)]: https://www.dyalog.com/ [TIO-khh92dss]: https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/6u19R/17jo8/VHvVq1HvZsfdS4Ccmv/pwElH/X2PepqftS75lHvlkPrjR@1TQRqCw5yBpIhHp7B/zUMNRXSFAwtjLg0DHWMQGwTLg0jPVMI20DPFCiuZ6CjYAQijEGEiZ4BWIueKQA "APL (Dyalog Unicode) – Try It Online" Function submission which takes coefficients as left argument and \$x\$ as right argument. Assumes `⎕IO←0` (0-indexing) ## Explanation ``` {+/⍺×⍵*⍳≢⍺} ≢⍺ length of the coefficients ⍳ range 0..length-1 ⍵* x to the power of each of those ⍺× multiply that by the coefficients +/ and fold the list by addition(sum it)