#title: Sheet Twisted-Tuck Cast-On (plain python)
# Casts on a sheet by knitting twisted tucks on all needles; slow!

#Write header:
print(';!knitout-2')
print(';;Machine: Kniterate')
print(';;Carriers: 1 2 3 4 5 6')

#Parameters:
min = 1 #needle number of left edge
max = 20 #needle number of right edge
carrier = "3" #carrier name

#Bring in carrier:
print(f"in {carrier}")

#Use a twisted tuck to cast on every stitch.
#Note: this requires a new pass for every stitch, so is pretty slow!
#There are both faster and fancier cast-ons.
#On Kniterate machines, carriers start on the left, so will start with leftmost needle.
for n in range(min, max+1, 1):
	#tuck alternating needles, making sure to do the left edge:
	print(f"tuck - f{n} {carrier}")

#knit two plain rows to allow cast-on stitches to relax and bring carrier to the right:
for n in range(max, min-1, -1):
	print(f"knit - f{n} {carrier}")
for n in range(min, max+1, 1):
	print(f"knit + f{n} {carrier}")

#...now can knit on [min,max].
