Free-form Challenge: Patterns


#1

How many ways can we produce patterns with just a few simple lines of code? This topic is about just that. Any code that one may come up with that produces a pattern in the output will qualify as interesting, so dream them up, and submit to this thread.

Any language that is taught here qualifies. Post the code and the output as illustrated below. Members viewing, please Like without commenting so the thread is allowed to contain individual entries only.

Python

>>> i = [1,2,3,4,5,6,7,8,9]
>>> for n in range(len(i)):
	print (i[n:] + i[:n])

	
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[2, 3, 4, 5, 6, 7, 8, 9, 1]
[3, 4, 5, 6, 7, 8, 9, 1, 2]
[4, 5, 6, 7, 8, 9, 1, 2, 3]
[5, 6, 7, 8, 9, 1, 2, 3, 4]
[6, 7, 8, 9, 1, 2, 3, 4, 5]
[7, 8, 9, 1, 2, 3, 4, 5, 6]
[8, 9, 1, 2, 3, 4, 5, 6, 7]
[9, 1, 2, 3, 4, 5, 6, 7, 8]
>>>

Of course there are also reflections of the above that amount to four different views. If these were further applied to colors, we'd get quite the pattern.