Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
4 added 297 characters in body
source | link

Matlab/Octave, 69 6565 64

y=ones(4*input[2,4].*input(0)+1);y(1:42:end,:)=y(3:4:end,1:4:end)=4;char(y+31)

Thanks to DLosc for pointing out issues that led to -1

Takes input as [1 1] and outputs:

#####
 
#   #
 
#####

You can also just input '1' and get 1x1. If the input really needs to be 1 1, the size goes up to 88 8585 84:

y=ones(4*eval[2,4].*eval(["["['[',input(0,"s"'s'),"]"]']'])1+1);y(1:42:end,:)=y(3:,1:4:end)=4;char(y+31)

Note: Matlab doesn't allow Octave's chaining or input(integer), but here is the Matlab version (67):

y=ones([2,4].*input('')+1);y(1:2:end,:)=4;y(:,1:4:end)=4;char(y+31)

Matlab/Octave, 69 65

y=ones(4*input(0)+1);y(1:4:end,:)=y(3:4:end,1:4:end)=4;char(y+31)

Takes input as [1 1] and outputs:

#####
 
#   #
 
#####

If the input really needs to be 1 1, the size goes up to 88 85:

y=ones(4*eval(["[",input(0,"s"),"]"])1);y(1:4:end,:)=y(3:4:end,1:4:end)=4;char(y+31)

Octave, 69 65 64

y=ones([2,4].*input()+1);y(1:2:end,:)=y(:,1:4:end)=4;char(y+31)

Thanks to DLosc for pointing out issues that led to -1

Takes input as [1 1] and outputs:

#####
#   #
#####

You can also just input '1' and get 1x1. If the input really needs to be 1 1, the size goes up to 88 85 84:

y=ones([2,4].*eval(['[',input(0,'s'),']'])+1);y(1:2:end,:)=y(:,1:4:end)=4;char(y+31)

Note: Matlab doesn't allow Octave's chaining or input(integer), but here is the Matlab version (67):

y=ones([2,4].*input('')+1);y(1:2:end,:)=4;y(:,1:4:end)=4;char(y+31)
3 deleted 10 characters in body
source | link

Matlab/Octave, 69 65

y=ones(4*input(0)+1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char=4;char(y+45y+31)

Takes input as [1 1] and outputs:

00000#####
.....
0...0#   #
.....
00000#####

If the input really needs to be 1 1, the size goes up to 88 85:

y=ones(4*eval(["[",input(0,"s"),"]"])1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char=4;char(y+45y+31)

Matlab/Octave, 69 65

y=ones(4*input(0)+1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Takes input as [1 1] and outputs:

00000
.....
0...0
.....
00000

If the input really needs to be 1 1, the size goes up to 88 85:

y=ones(4*eval(["[",input(0,"s"),"]"])1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Matlab/Octave, 69 65

y=ones(4*input(0)+1);y(1:4:end,:)=y(3:4:end,1:4:end)=4;char(y+31)

Takes input as [1 1] and outputs:

#####

#   #

#####

If the input really needs to be 1 1, the size goes up to 88 85:

y=ones(4*eval(["[",input(0,"s"),"]"])1);y(1:4:end,:)=y(3:4:end,1:4:end)=4;char(y+31)
2 added 28 characters in body
source | link

Matlab/Octave, 6969 65

y=ones(4*(input4*input(0)-1)+5+1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Takes input as [1 1] and outputs:

00000
.....
0...0
.....
00000

If the input really needs to be 1 1, the size goes up to 8988 85:

y=ones(4*(eval4*eval(["[",input(0,"s"),"]"])-1)+5);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Matlab/Octave, 69

y=ones(4*(input(0)-1)+5);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Takes input as [1 1] and outputs:

00000
.....
0...0
.....
00000

If the input really needs to be 1 1, the size goes up to 89:

y=ones(4*(eval(["[",input(0,"s"),"]"])-1)+5);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Matlab/Octave, 69 65

y=ones(4*input(0)+1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)

Takes input as [1 1] and outputs:

00000
.....
0...0
.....
00000

If the input really needs to be 1 1, the size goes up to 88 85:

y=ones(4*eval(["[",input(0,"s"),"]"])1);y(1:4:end,:)=y(3:4:end,1:4:end)=3;char(y+45)
1
source | link