;!knitout-2
;;Machine: Kniterate
;;Carriers: 1 2 3 4 5 6

;title: Tube Cast-On (raw knitout)

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

;Bring in carrier:
in 3

;On Kniterate machines, carriers start on the left,
;so will start tucking onto needles left-to-right:
tuck + b1 3
tuck + b3 3
tuck + b5 3
tuck + b7 3
tuck + b9 3
tuck + b11 3
tuck + b13 3
tuck + b15 3
tuck + b17 3
tuck + b19 3

;...continue clockwise around the tube to the front bed:
tuck - f20 3
tuck - f18 3
tuck - f16 3
tuck - f14 3
tuck - f12 3
tuck - f10 3
tuck - f8 3
tuck - f6 3
tuck - f4 3
tuck - f2 3

;...continue clockwise around the tube to the back bed and fill in needles missed the first time:
tuck + b2 3
tuck + b4 3
tuck + b6 3
tuck + b8 3
tuck + b10 3
tuck + b12 3
tuck + b14 3
tuck + b16 3
tuck + b18 3
tuck + b20 3

;...finally, fill in the rest of the front bed:
tuck - f19 3
tuck - f17 3
tuck - f15 3
tuck - f13 3
tuck - f11 3
tuck - f9 3
tuck - f7 3
tuck - f5 3
tuck - f3 3
tuck - f1 3

;now knit one and a half rows of plain knitting to let the cast-on stitches relax (and because having the carrier on the right will be convenient for example code):
knit + b1 3
knit + b2 3
knit + b3 3
knit + b4 3
knit + b5 3
knit + b6 3
knit + b7 3
knit + b8 3
knit + b9 3
knit + b10 3
knit + b11 3
knit + b12 3
knit + b13 3
knit + b14 3
knit + b15 3
knit + b16 3
knit + b17 3
knit + b18 3
knit + b19 3
knit + b20 3
knit - f20 3
knit - f19 3
knit - f18 3
knit - f17 3
knit - f16 3
knit - f15 3
knit - f14 3
knit - f13 3
knit - f12 3
knit - f11 3
knit - f10 3
knit - f9 3
knit - f8 3
knit - f7 3
knit - f6 3
knit - f5 3
knit - f4 3
knit - f3 3
knit - f2 3
knit - f1 3
knit + b1 3
knit + b2 3
knit + b3 3
knit + b4 3
knit + b5 3
knit + b6 3
knit + b7 3
knit + b8 3
knit + b9 3
knit + b10 3
knit + b11 3
knit + b12 3
knit + b13 3
knit + b14 3
knit + b15 3
knit + b16 3
knit + b17 3
knit + b18 3
knit + b19 3
knit + b20 3

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