45 lines
1.2 KiB
Plaintext
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 # character is not rigidly required for ASCII art.
|
|
|
|
The important requirement is the placement of whitespace and non-whitespace characters.
|
|
|
|
|
|
;Related task:
|
|
* [[Sierpinski triangle]]
|
|
<br><br>
|
|
|