RosettaCodeData/Task/Sierpinski-carpet/00-TASK.txt

45 lines
1.2 KiB
Plaintext

;Task
Produce a graphical or ASCII-art representation of a [[wp:Sierpinski carpet|Sierpinski carpet]] of order   '''N'''.
For example, the Sierpinski carpet of order   '''3'''   should look like this:
<pre>
###########################
# ## ## ## ## ## ## ## ## #
###########################
### ###### ###### ###
# # # ## # # ## # # #
### ###### ###### ###
###########################
# ## ## ## ## ## ## ## ## #
###########################
######### #########
# ## ## # # ## ## #
######### #########
### ### ### ###
# # # # # # # #
### ### ### ###
######### #########
# ## ## # # ## ## #
######### #########
###########################
# ## ## ## ## ## ## ## ## #
###########################
### ###### ###### ###
# # # ## # # ## # # #
### ###### ###### ###
###########################
# ## ## ## ## ## ## ## ## #
###########################
</pre>
The use of the &nbsp; # &nbsp; character is not rigidly required for ASCII art.
The important requirement is the placement of whitespace and non-whitespace characters.
;Related task:
* &nbsp; [[Sierpinski triangle]]
<br><br>