27
1
Challenge :
Given an integer n as input. Create a diamond that is 2x the given number n.
Input :
Input is integer n and 2 < n ≤ 3000.
Output :
Output will be a string and it will be in form of a diamond consisting of + with an addition line at the start showing n using +
Examples :
D(3) :
+++
+
+++
+++++
+++++
+++
+
D(5) :
+++++
+
+++
+++++
+++++++
+++++++++
+++++++++
+++++++
+++++
+++
+
D(6) :
++++++
+
+++
+++++
+++++++
+++++++++
+++++++++++
+++++++++++
+++++++++
+++++++
+++++
+++
+
Winning Criteria :
This is code-golf so shortest code in bytes for each programming language wins.
Related: Print this diamond and related: User Scored Code Golf - Drawing Diamonds – Kevin Cruijssen – 2018-04-19T06:58:15.060
@KevinCruijssen : Um so is this ok , or should I remove this ? – Muhammad Salman – 2018-04-19T06:59:36.750
No it's ok. It's related, not a duplicate. :) Related challenges are just linked as inspiration, but yours is different enough (imo) to not be closed as a dupe. – Kevin Cruijssen – 2018-04-19T07:00:02.947
@KevinCruijssen : Ok so it can stay ? – Muhammad Salman – 2018-04-19T07:00:44.517
@KevinCruijssen : I see , i'm still new so learning the rules , thanks for telling me. – Muhammad Salman – 2018-04-19T07:01:44.547
1May we take
nin unary? – Adám – 2018-04-19T07:16:09.0273
… using
– Adám – 2018-04-19T07:17:10.093+as tally mark?@Adám : I guess you can if you feel like the normal doesn't work – Muhammad Salman – 2018-04-19T07:32:10.120
1Can you add a test case where
nis even? – Shaggy – 2018-04-19T10:09:00.9432@Shaggy : sure why not. I will add that right away. Thanks – Muhammad Salman – 2018-04-19T10:11:02.880
@Shaggy : There implemented. – Muhammad Salman – 2018-04-19T10:12:23.000
1
@Adám here is the meta post on unary I/O
– Digital Trauma – 2018-04-19T17:45:48.3571This is a grenade. – Tamás Sengel – 2018-04-21T23:12:00.970