Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Comments on Draw shapes: E1 - Square/Rectangle

Post

Draw shapes: E1 - Square/Rectangle

+0
−0

Challenge

Take input of a non-whitespace character and a positive integer $n$, and print out a square (or rectangle) of size $n$ using the inputted character. Shortest program wins!

Test Cases

n = 1, c = $
$$$
$ $
$$$

n = 3, c = ^
^^^^^
^   ^
^   ^
^   ^
^^^^^

n = 10, c = L
LLLLLLLLLLLL
L          L
L          L
L          L
L          L
L          L
L          L
L          L
L          L
L          L
L          L
LLLLLLLLLLLL
History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

Those shapes look like they're of size `n+2` to me ;) (2 comments)
Those shapes look like they're of size `n+2` to me ;)
Shaggy‭ wrote over 2 years ago · edited over 2 years ago

Those shapes look like they're of size n+2 to me ;) Also, I don't personally see this as being significantly different enough to your "build me a house" challenge; others may have different opinions, of course.

General Sebast1an‭ wrote over 2 years ago

Shaggy‭ Eh, there'll be triangles soon.