26
1
Challenge
Given a size s, print a cube net of that size made of hash symbols (#
) and spaces ().
Examples:
1:
#
# # #
#
#
2:
# #
# #
# # # # # #
# # # # # #
# #
# #
# #
# #
3:
# # #
# # #
# # #
# # # # # # # # #
# # # # # # # # #
# # # # # # # # #
# # #
# # #
# # #
# # #
# # #
# # #
The net can actually be any valid cube net that can fold into a cube, for example these:
# #
# #
# # # # # # # #
# # # # # # # #
# #
# #
# # # #
# # # #
# #
# #
# #
# #
# # # #
# # # #
Rules
- The resulting net must be geometrically valid (foldable into a cube)
- Standard loopholes forbidden
- Read the rules carefully
- This is code-golf, shortest answer wins, but will not be selected
1Can there be leading/trailing spaces/newlines? – user41805 – 2017-01-14T07:51:02.503
@KritixiLithos Yes – dkudriavtsev – 2017-01-14T07:54:10.577
13
For reference, all 11 cube nets.
– xnor – 2017-01-14T08:04:27.813Is it okay if we output it without the spaces? – user41805 – 2017-01-14T08:41:37.390
@KritixiLithos no – dkudriavtsev – 2017-01-14T10:20:43.273
Related – Digital Trauma – 2017-01-15T05:52:26.513
Will the input ever be 0? – FlipTack – 2017-01-15T12:12:10.073
3What if I don't read the rules carefully? – steenbergh – 2017-01-18T12:44:24.983
@FlipTack No. It will always be positive as well – dkudriavtsev – 2017-11-14T23:04:52.953
1@steenbergh Then your solution is invalid – dkudriavtsev – 2017-11-14T23:05:01.513