Post History
C (gcc), 100 bytes i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)*p++&&printf("[%d,%d],",i,j);puts("\b]");} Try it online! Note that TIO console doesn't handle back...
Answer
#2: Post edited
# [C (gcc)], 104 bytes- <!-- language-all: lang-c -->
i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)p[y*i+j]&&printf("[%d,%d],",i,j);puts("\b]");}[Try it online!][TIO-kjsejfvx]- [C (gcc)]: https://gcc.gnu.org/
[TIO-kjsejfvx]: https://tio.run/##dVDdTsMgFL7vU5AuW6A9OmiXXUjnvVc@AHLhilWItmTrzJqmz14PmDm9MJDv/Hw/IdQ3r3U9L2xbv5/MC6mOvbHd7dv9bMHJhp5hAM9s22dejv7UH2mqUiab7kClrc7S5jkLg9tx6apBOpy9GjKbO71a@QM6G7QsDSyNhhQwlcnvnKe9xqRpRgn5eLYtoZ@dNSwZE0LWGcLDHVFKAAcRD9cal49hyXEAxCJiGXGD9B8Tbi@V/28XsRexL1AcRNk6JIV32dYLooRWW012ZBx/vWaa5FVUEFVqvFfRBD@VX@Sob6iALYRYFu34bVgiUUIZiAKJKUmS@Qs "C (gcc) – Try It Online"- Note that TIO console doesn't handle backspace properly.
- # [C (gcc)], 100 bytes
- <!-- language-all: lang-c -->
- i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)*p++&&printf("[%d,%d],",i,j);puts("\b]");}
- [Try it online!][TIO-kjsfkmv4]
- [C (gcc)]: https://gcc.gnu.org/
- [TIO-kjsfkmv4]: https://tio.run/##dVDdTsMgFL7nKUjNFmiPDlqzC@m898oHQC5csUqjLdk6s6Xh2esBM6cXBvKdn@8nhOb6tWnmK9c37wf7Quv9aN1w83Y/O@hUy45wAs9dP@ZeTf4w7lmmM67aYceUq4/KFQWPQ7cRqqtPqsM590WxXPodulqULywsrIEMMJGr74ynrcGUMKOEfjy7nrLPwVlOJkLpKkd4uKNaSxAg0xHG4PIxLgUOgFgmrBLeIv3HhNtzFf/bZepl6ksUR1G@iknxXa73kmpp9NrQDZ2mX68JQV1EJdWVwXsRBfip4ixHfcskrCHG8mTHL8OSiAqqSJRIBELI/AU "C (gcc) – Try It Online"
- Note that TIO console doesn't handle backspace properly.
#1: Initial revision
# [C (gcc)], 104 bytes <!-- language-all: lang-c --> i,j;f(x,y,p)int*p;{puts("[");for(;i<x;i++)for(j=0;j<y;j++)p[y*i+j]&&printf("[%d,%d],",i,j);puts("\b]");} [Try it online!][TIO-kjsejfvx] [C (gcc)]: https://gcc.gnu.org/ [TIO-kjsejfvx]: https://tio.run/##dVDdTsMgFL7vU5AuW6A9OmiXXUjnvVc@AHLhilWItmTrzJqmz14PmDm9MJDv/Hw/IdQ3r3U9L2xbv5/MC6mOvbHd7dv9bMHJhp5hAM9s22dejv7UH2mqUiab7kClrc7S5jkLg9tx6apBOpy9GjKbO71a@QM6G7QsDSyNhhQwlcnvnKe9xqRpRgn5eLYtoZ@dNSwZE0LWGcLDHVFKAAcRD9cal49hyXEAxCJiGXGD9B8Tbi@V/28XsRexL1AcRNk6JIV32dYLooRWW012ZBx/vWaa5FVUEFVqvFfRBD@VX@Sob6iALYRYFu34bVgiUUIZiAKJKUmS@Qs "C (gcc) – Try It Online" Note that TIO console doesn't handle backspace properly.