Knit

The knit operation pulls a loop from one or more carriers through the existing loops on a needle, dropping these loops off the needle in the process. The result is that the existing loops will be wale-wise connected to the new loop.

Knitting on a front needle will result in the new loop passing through the existing loops from the back to the front. Knitting on a back needle will result in the new loop passing through the existing loops from the front to the back (also known as a back knit or purl).

Knitting without a yarn will drop the loops on a needle.

Knitting a needle with no loops is the same as tucking a needle (though it is reasonable for code to warn in this situation since it's not idiomatic).

Cloth made of all knits is called Single Jersey.

Resources & References

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

;title: Knit (raw knitout)
; Knit pulls a loop of yarn back-to-front (or front-to-back, in the case of a back-bed knit) through an existing loop and drops the loop.

x-loop-in + f2 1
x-loop-in + f6 2
x-yarn-in + f2 3
x-yarn-in + f4 4

; knitting pulls a loop of new yarn through the loops on a needle and drops those loops:
knit + f2 3

; knitting on an empty needle is the same as tucking that needle:
knit + f4 4

; knitting with no yarns (also called [drop](/drop/)) drops the loops on the needle:
knit + f6

x-yarn-out + f2 3
x-yarn-out + f4 4
x-loop-out f2
x-loop-out f4
// title: Knit (javascript with knitout module)
// Knit pulls a loop of yarn back-to-front (or front-to-back, in the case of a back-bed knit) through an existing loop and drops the loop.

// add required [headers](/knitout-headers/):
var knitout = require('./assets/knitout-frontend.js'); // include knitout module 
k = new knitout.Writer({
	carriers: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
});

// determine knitting parameters:
let bed = 'f'; // bed we will knit on
let carriers = ['1', '2', '3', '4']; // list with names of carriers we will use in the piece

// bring in [carrier](/carrier/)s:
/*
	* here, we use the knitout extensions [x-loop-in](/knitout-extensions/#x-loop-in) and [x-yarn-in](/knitout-extensions/#x-yarn-in) for visualization purposes 
	* note that we would use [inhook]() instead if we were knitting this on the machine
	* see [knitting-a-row]() for an example of machine-ready code
*/

// `x-loop-in` for first 2 carriers (get some existing [loop](/loop/)s started so we can visualize a [stitch](/stitch/))
k.loopIn('+', bed + '2', carriers[0]);
k.loopIn('+', bed + '6', carriers[1]);

// `x-yarn-in` for last 2 carriers (bring the yarn in so we can use it in operations below)
k.yarnIn('+', bed + '2', carriers[2]);
k.yarnIn('+', bed + '4', carriers[3]);

// knitting pulls a loop of new yarn through the loops on a needle and drops those loops:
/*
parameters:
----------
	* `'+'` (positive direction)
	* `bed + '2'`(knit on pre - defined bed 'f'[front - bed] and on needle number '2')
	* `carrier[2]` (use carrier #3 [recall that the carrier at index 2 is '3'])
*/
k.knit('+', bed + '2', carriers[2]);

// knitting on an empty needle is the same as tucking that needle:
k.knit('+', bed + '4', carriers[3]);

// knitting with no yarns (also called [drop](/drop/)) drops the loops on the needle:
k.knit('+', bed + '6'); // notice that carriers are not passed as a parameter here

// take out [carrier](/carrier/)s:
/*
	* here, we use the knitout extensions [x-yarn-out](/knitout-extensions/#x-yarn-out) and [x-loop-in](/knitout-extensions/#x-loop-in) for visualization purposes
	* note that we would use [releasehook](/inserting-hook/) and [outhook](/inserting-hook/) instead if we were knitting this on the machine
*/
k.yarnOut('+', bed + '2', carrier[2]);
k.yarnOut('+', bed + '4', carrier[3]);

k.loopOut(bed + '2'); // notice that direction and carriers are not passed as a parameter here
k.loopOut(bed + '4');

// write the output knitout to a file
k.write('knit.swgn2.k');
;!knitout-2
;;Machine: SWGN2
;;Carriers: 1 2 3 4 5 6 7 8 9 10

;title: Knit (raw knitout)
; Knit pulls a loop of yarn back-to-front (or front-to-back, in the case of a back-bed knit) through an existing loop and drops the loop.

x-loop-in + f2 1
x-loop-in + f6 2
x-yarn-in + f2 3
x-yarn-in + f4 4

; knitting pulls a loop of new yarn through the loops on a needle and drops those loops:
knit + f2 3

; knitting on an empty needle is the same as tucking that needle:
knit + f4 4

; knitting with no yarns (also called [drop](/drop/)) drops the loops on the needle:
knit + f6

x-yarn-out + f2 3
x-yarn-out + f4 4
x-loop-out f2
x-loop-out f4