############################ No.1 Winding Ways ##########################

	
## Five color input, will be choose from the color library
def windingWays(color1, color2, color3, color4, color5):
	currentPos = turtle.pos() # remember the turtle's beginning position
	turtle.write("Winding Ways") # write the pattern's name on screen
	drawBlockSq() # Draw the basic block
	arcRepeat = 3 # Define how many time the sub block repeats
	
	## A single piece of the Arc Shape
	def drawArcPiece(color):
		turtle.begin_fill ()
		turtle.fillcolor(color)
		turtle.circle(glbBlockLength/arcRepeat, 360/12)
		turtle.right(360/6)
		turtle.circle(glbBlockLength/arcRepeat, -(360/12))
		turtle.right(360/6)
		turtle.circle(glbBlockLength/arcRepeat, 360/12)
		turtle.end_fill ()

	## A block of the arc shape
	def drawArcBlock(color):
		for i in range(0,2):
			drawArcPiece(color)
			turtle.right(90)
			drawArcPiece(color)
		gotoBlockCenter(-1,4)

	## Draw a sub block, based on the number of repetition
	def drawSubBlock(color):
		turtle.seth(0)
		turtle.begin_fill()
		turtle.fillcolor(color)
		drawSquare(glbBlockLength/arcRepeat)
		turtle.end_fill()

	## Go to the sub block's center, prepare for the arc shape
	def gotoSubBlockCenter():
		turtle.penup()
		turtle.forward(glbBlockLength/arcRepeat/2)
		turtle.right(90)
		turtle.forward(glbBlockLength/arcRepeat/2)
		turtle.pendown()

##    New Version Algorithm, can control the repetition number
##    and assign color using modulus
	currentColorList = [color1, color2]
	for j in range(0,arcRepeat):
		moveit(currentPos)
		y = turtle.ycor()
		for i in range(0,arcRepeat):
			x = turtle.xcor()
			turtle.pu()
			turtle.goto(x + i * glbBlockLength/arcRepeat, y - j * glbBlockLength/arcRepeat)
			turtle.pd()
			turtle.seth(0)
			drawSubBlock(currentColorList[0 + (i+j+1) % 2])
			gotoSubBlockCenter()
			drawArcBlock(currentColorList[0 + (i+j) % 2])
			moveit(currentPos)
		turtle.seth(0)
	
	#reset position
	gotoBeginPos()
