Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • \$\begingroup\$ @WeeingIfFirst Oh, of course, thank you very much! \$\endgroup\$ Commented Sep 18, 2016 at 14:22
  • \$\begingroup\$ 6 bytes shorter: z([1,b],1:a)=45;z(1:b,[1,a])=124;z=[z,''] \$\endgroup\$ Commented Sep 18, 2016 at 14:31
  • \$\begingroup\$ Even shorter: z(b,a)=' ';z([1,b],:)=45;z(:,[1,a])=124 \$\endgroup\$ Commented Sep 18, 2016 at 14:54
  • \$\begingroup\$ @LuisMendo Thanks! We still need the string tough, otherwise the array is converted to a numerical one. \$\endgroup\$ Commented Sep 18, 2016 at 14:55
  • \$\begingroup\$ @flawr z(b,a)=' ' initiallizes as char. After that you can fill with numbers and they are automatically cast to char. z maintains its original type \$\endgroup\$ Commented Sep 18, 2016 at 14:56