//title: Garter Sheet (javascript with knitout module)
//include knitout module:
const knitout = require('knitout'); //include knitout module
const K = new knitout.Writer({ carriers:['1', '2', '3', '4', '5', '6'] });
K.addHeader('Machine', 'Kniterate');
//Parameters:
let min = 1; //needle number of left edge
let max = 20; //needle number of right edge
let rows = 20; //number of rows to knit
let carrier = "3"; //carrier name
// ---- set up initial loops and yarn carrier ----
//Bring in carrier:
K.in(carrier);
//On Kniterate machines, carriers start on the left,
//so will start tucking onto needles left-to-right,
//and will be sure to tuck the leftmost needle in the first pass:
for (let n = min; n <= max; n += 1) {
//tuck alternating needles, making sure to do the left edge:
if ((n - min) % 2 === 0) {
K.tuck("+", 'f' + n, carrier);
}
}
//now, moving right-to-left, tuck the needles that were not tucked on the first pass:
for (let n = max; n >= min; n -= 1) {
if ((n - min) % 2 !== 0) {
K.tuck("-", 'f' + n, carrier);
}
}
//knit three plain rows to allow cast-on stitches to relax:
// three isn't set in stone here -- it's just convenient
// for this example code to have the carrier end up on the right.
for (let n = min; n <= max; n += 1) {
K.knit("+", 'f' + n, carrier);
}
for (let n = max; n >= min; n -= 1) {
K.knit("-", 'f' + n, carrier);
}
for (let n = min; n <= max; n += 1) {
K.knit("+", 'f' + n, carrier);
}
// ---- garter sheet ----
//Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for (let r = 0; r <= rows; r += 1) {
if (r % 2 === 0) {
//knit even rows as left-going, front-knits rows:
for (let n = max; n >= min; n -= 1) {
K.knit("-", 'f' + n, carrier);
}
} else {
//knit odd rows as right-going, back-knits rows:
//move loops to back bed:
for (let n = min; n <= max; n += 1) {
K.xfer('f' + n, 'b' + n);
}
//right-going, back-knits row:
for (let n = min; n <= max; n += 1) {
K.knit("+", 'b' + n, carrier);
}
//return loops to front bed:
for (let n = min; n <= max; n += 1) {
K.xfer('b' + n, 'f' + n);
}
}
}
// ---- take carrier out and drop remaining loops ----
//Send carrier back to its parking location:
K.out(carrier);
//drop loops:
for (let n = min; n <= max; n += 1) {
K.drop('f' + n);
}
K.write('garter-sheet.kniterate.k');
//title: Garter Sheet (plain javascript)
//Write header:
console.log(';!knitout-2');
console.log(';;Machine: Kniterate');
console.log(';;Carriers: 1 2 3 4 5 6');
//Parameters:
let min = 1; //needle number of left edge
let max = 20; //needle number of right edge
let rows = 20; //number of rows to knit
let carrier = "3"; //carrier name
// ---- set up initial loops and yarn carrier ----
//Bring in carrier:
console.log(`in ${carrier}`);
//On Kniterate machines, carriers start on the left,
//so will start tucking onto needles left-to-right,
//and will be sure to tuck the leftmost needle in the first pass:
for (let n = min; n <= max; n += 1) {
//tuck alternating needles, making sure to do the left edge:
if ((n - min) % 2 === 0) {
console.log(`tuck + f${n} ${carrier}`);
}
}
//now, moving right-to-left, tuck the needles that were not tucked on the first pass:
for (let n = max; n >= min; n -= 1) {
if ((n - min) % 2 !== 0) {
console.log(`tuck - f${n} ${carrier}`);
}
}
//knit three plain rows to allow cast-on stitches to relax:
// three isn't set in stone here -- it's just convenient
// for this example code to have the carrier end up on the right.
for (let n = min; n <= max; n += 1) {
console.log(`knit + f${n} ${carrier}`);
}
for (let n = max; n >= min; n -= 1) {
console.log(`knit - f${n} ${carrier}`);
}
for (let n = min; n <= max; n += 1) {
console.log(`knit + f${n} ${carrier}`);
}
// ---- garter sheet ----
//Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for (let r = 0; r <= rows; r += 1) {
if (r % 2 === 0) {
//knit even rows as left-going, front-knits rows:
for (let n = max; n >= min; n -= 1) {
console.log(`knit - f${n} ${carrier}`);
}
} else {
//knit odd rows as right-going, back-knits rows:
//move loops to back bed:
for (let n = min; n <= max; n += 1) {
console.log(`xfer f${n} b${n}`);
}
//right-going, back-knits row:
for (let n = min; n <= max; n += 1) {
console.log(`knit + b${n} ${carrier}`);
}
//return loops to front bed:
for (let n = min; n <= max; n += 1) {
console.log(`xfer b${n} f${n}`);
}
}
}
// ---- take carrier out and drop remaining loops ----
//Send carrier back to its parking location:
console.log(`out ${carrier}`);
//drop loops:
for (let n = min; n <= max; n += 1) {
console.log(`drop f${n}`);
}
#title: Garter Sheet (plain python)
#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
rows = 20 #number of rows to knit
carrier = "3" #carrier name
# ---- set up initial loops and yarn carrier ----
#Bring in carrier:
print(f"in {carrier}")
#On Kniterate machines, carriers start on the left,
#so will start tucking onto needles left-to-right,
#and will be sure to tuck the leftmost needle in the first pass:
for n in range(min, max+1, 1):
#tuck alternating needles, making sure to do the left edge:
if (n - min) % 2 == 0:
print(f"tuck + f{n} {carrier}")
#now, moving right-to-left, tuck the needles that were not tucked on the first pass:
for n in range(max, min-1, -1):
if (n - min) % 2 != 0:
print(f"tuck - f{n} {carrier}")
#knit three plain rows to allow cast-on stitches to relax:
# three isn't set in stone here -- it's just convenient
# for this example code to have the carrier end up on the right.
for n in range(min, max+1, 1):
print(f"knit + f{n} {carrier}")
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}")
# ---- garter sheet ----
#Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for r in range(0, rows+1, 1):
if r % 2 == 0:
#knit even rows as left-going, front-knits rows:
for n in range(max, min-1, -1):
print(f"knit - f{n} {carrier}")
else:
#knit odd rows as right-going, back-knits rows:
#move loops to back bed:
for n in range(min, max+1, 1):
print(f"xfer f{n} b{n}")
#right-going, back-knits row:
for n in range(min, max+1, 1):
print(f"knit + b{n} {carrier}")
#return loops to front bed:
for n in range(min, max+1, 1):
print(f"xfer b{n} f{n}")
# ---- take carrier out and drop remaining loops ----
#Send carrier back to its parking location:
print(f"out {carrier}")
#drop loops:
for n in range(min, max+1, 1):
print(f"drop f{n}")
#title: Garter Sheet (python with knitout module)
import knitout
K = knitout.Writer('1 2 3 4 5 6');
K.addHeader('Machine', 'Kniterate');
#Parameters:
min = 1 #needle number of left edge
max = 20 #needle number of right edge
rows = 20 #number of rows to knit
carrier = "3" #carrier name
# ---- set up initial loops and yarn carrier ----
#Bring in carrier:
K.ingripper(carrier)
#On Kniterate machines, carriers start on the left,
#so will start tucking onto needles left-to-right,
#and will be sure to tuck the leftmost needle in the first pass:
for n in range(min, max+1, 1):
#tuck alternating needles, making sure to do the left edge:
if (n - min) % 2 == 0:
K.tuck("+", 'f' + str(n), carrier)
#now, moving right-to-left, tuck the needles that were not tucked on the first pass:
for n in range(max, min-1, -1):
if (n - min) % 2 != 0:
K.tuck("-", 'f' + str(n), carrier)
#knit three plain rows to allow cast-on stitches to relax:
# three isn't set in stone here -- it's just convenient
# for this example code to have the carrier end up on the right.
for n in range(min, max+1, 1):
K.knit("+", 'f' + str(n), carrier)
for n in range(max, min-1, -1):
K.knit("-", 'f' + str(n), carrier)
for n in range(min, max+1, 1):
K.knit("+", 'f' + str(n), carrier)
# ---- garter sheet ----
#Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for r in range(0, rows+1, 1):
if r % 2 == 0:
#knit even rows as left-going, front-knits rows:
for n in range(max, min-1, -1):
K.knit("-", 'f' + str(n), carrier)
else:
#knit odd rows as right-going, back-knits rows:
#move loops to back bed:
for n in range(min, max+1, 1):
K.xfer('f' + str(n), 'b' + str(n))
#right-going, back-knits row:
for n in range(min, max+1, 1):
K.knit("+", 'b' + str(n), carrier)
#return loops to front bed:
for n in range(min, max+1, 1):
K.xfer('b' + str(n), 'f' + str(n))
# ---- take carrier out and drop remaining loops ----
#Send carrier back to its parking location:
K.outgripper(carrier)
#drop loops:
for n in range(min, max+1, 1):
K.drop('f' + str(n))
K.write('garter-sheet.kniterate.k')
//title: Garter Sheet (javascript with knitout module)
//include knitout module:
const knitout = require('knitout'); //include knitout module
const K = new knitout.Writer({ carriers:['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] });
K.addHeader('Machine', 'SWGN2');
//Parameters:
let min = 1; //needle number of left edge
let max = 20; //needle number of right edge
let rows = 20; //number of rows to knit
let carrier = "3"; //carrier name
// ---- set up initial loops and yarn carrier ----
//Bring in carrier:
K.inhook(carrier);
//Set stitch table entry for cast-on:
K.stitchNumber(101);
//On SWGN2 machines, carriers start on the right,
//so will start tucking onto needles right-to-left,
//and will be sure to tuck the rightmost needle in the first pass:
for (let n = max; n >= min; n -= 1) {
//tuck alternating needles, making sure to do the right edge:
if ((max - n) % 2 === 0) {
K.tuck("-", 'f' + n, carrier);
}
}
//now, moving left-to-right, tuck the needles that were not tucked on the first pass:
for (let n = min; n <= max; n += 1) {
if ((max - n) % 2 !== 0) {
K.tuck("+", 'f' + n, carrier);
}
}
//Set stitch table entry for knitting:
K.stitchNumber(105);
//knit two plain rows to allow cast-on stitches to relax:
// two isn't set in stone here -- it's just convenient
// for this example code to have the carrier end up on the right.
for (let n = max; n >= min; n -= 1) {
K.knit("-", 'f' + n, carrier);
}
//send out yarn inserting hook; it is no longer needed to hold the yarn in place:
K.releasehook(carrier);
for (let n = min; n <= max; n += 1) {
K.knit("+", 'f' + n, carrier);
}
// ---- garter sheet ----
//Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for (let r = 0; r <= rows; r += 1) {
if (r % 2 === 0) {
//knit even rows as left-going, front-knits rows:
for (let n = max; n >= min; n -= 1) {
K.knit("-", 'f' + n, carrier);
}
} else {
//knit odd rows as right-going, back-knits rows:
//move loops to back bed:
for (let n = min; n <= max; n += 1) {
K.xfer('f' + n, 'b' + n);
}
//right-going, back-knits row:
for (let n = min; n <= max; n += 1) {
K.knit("+", 'b' + n, carrier);
}
//return loops to front bed:
for (let n = min; n <= max; n += 1) {
K.xfer('b' + n, 'f' + n);
}
}
}
// ---- take carrier out and drop remaining loops ----
//Take carrier out with yarn inserting hook:
K.outhook(carrier);
//drop loops:
for (let n = min; n <= max; n += 1) {
K.drop('f' + n);
}
K.write('garter-sheet.swgn2.k');
//title: Garter Sheet (plain javascript)
//Write header:
console.log(';!knitout-2');
console.log(';;Machine: SWGN2');
console.log(';;Carriers: 1 2 3 4 5 6 7 8 9 10');
//Parameters:
let min = 1; //needle number of left edge
let max = 20; //needle number of right edge
let rows = 20; //number of rows to knit
let carrier = "3"; //carrier name
// ---- set up initial loops and yarn carrier ----
//Bring in carrier:
console.log(`inhook ${carrier}`);
//Set stitch table entry for cast-on:
console.log(`x-stitch-number 101`);
//On SWGN2 machines, carriers start on the right,
//so will start tucking onto needles right-to-left,
//and will be sure to tuck the rightmost needle in the first pass:
for (let n = max; n >= min; n -= 1) {
//tuck alternating needles, making sure to do the right edge:
if ((max - n) % 2 === 0) {
console.log(`tuck - f${n} ${carrier}`);
}
}
//now, moving left-to-right, tuck the needles that were not tucked on the first pass:
for (let n = min; n <= max; n += 1) {
if ((max - n) % 2 !== 0) {
console.log(`tuck + f${n} ${carrier}`);
}
}
//Set stitch table entry for knitting:
console.log(`x-stitch-number 105`);
//knit two plain rows to allow cast-on stitches to relax:
// two isn't set in stone here -- it's just convenient
// for this example code to have the carrier end up on the right.
for (let n = max; n >= min; n -= 1) {
console.log(`knit - f${n} ${carrier}`);
}
//send out yarn inserting hook; it is no longer needed to hold the yarn in place:
console.log(`releasehook ${carrier}`);
for (let n = min; n <= max; n += 1) {
console.log(`knit + f${n} ${carrier}`);
}
// ---- garter sheet ----
//Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for (let r = 0; r <= rows; r += 1) {
if (r % 2 === 0) {
//knit even rows as left-going, front-knits rows:
for (let n = max; n >= min; n -= 1) {
console.log(`knit - f${n} ${carrier}`);
}
} else {
//knit odd rows as right-going, back-knits rows:
//move loops to back bed:
for (let n = min; n <= max; n += 1) {
console.log(`xfer f${n} b${n}`);
}
//right-going, back-knits row:
for (let n = min; n <= max; n += 1) {
console.log(`knit + b${n} ${carrier}`);
}
//return loops to front bed:
for (let n = min; n <= max; n += 1) {
console.log(`xfer b${n} f${n}`);
}
}
}
// ---- take carrier out and drop remaining loops ----
//Take carrier out with yarn inserting hook:
console.log(`outhook ${carrier}`);
//drop loops:
for (let n = min; n <= max; n += 1) {
console.log(`drop f${n}`);
}
#title: Garter Sheet (plain python)
#Write header:
print(';!knitout-2')
print(';;Machine: SWGN2')
print(';;Carriers: 1 2 3 4 5 6 7 8 9 10')
#Parameters:
min = 1 #needle number of left edge
max = 20 #needle number of right edge
rows = 20 #number of rows to knit
carrier = "3" #carrier name
# ---- set up initial loops and yarn carrier ----
#Bring in carrier:
print(f"inhook {carrier}")
#Set stitch table entry for cast-on:
print(f"x-stitch-number 101")
#On SWGN2 machines, carriers start on the right,
#so will start tucking onto needles right-to-left,
#and will be sure to tuck the rightmost needle in the first pass:
for n in range(max, min-1, -1):
#tuck alternating needles, making sure to do the right edge:
if (max - n) % 2 == 0:
print(f"tuck - f{n} {carrier}")
#now, moving left-to-right, tuck the needles that were not tucked on the first pass:
for n in range(min, max+1, 1):
if (max - n) % 2 != 0:
print(f"tuck + f{n} {carrier}")
#Set stitch table entry for knitting:
print(f"x-stitch-number 105")
#knit two plain rows to allow cast-on stitches to relax:
# two isn't set in stone here -- it's just convenient
# for this example code to have the carrier end up on the right.
for n in range(max, min-1, -1):
print(f"knit - f{n} {carrier}")
#send out yarn inserting hook; it is no longer needed to hold the yarn in place:
print(f"releasehook {carrier}")
for n in range(min, max+1, 1):
print(f"knit + f{n} {carrier}")
# ---- garter sheet ----
#Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for r in range(0, rows+1, 1):
if r % 2 == 0:
#knit even rows as left-going, front-knits rows:
for n in range(max, min-1, -1):
print(f"knit - f{n} {carrier}")
else:
#knit odd rows as right-going, back-knits rows:
#move loops to back bed:
for n in range(min, max+1, 1):
print(f"xfer f{n} b{n}")
#right-going, back-knits row:
for n in range(min, max+1, 1):
print(f"knit + b{n} {carrier}")
#return loops to front bed:
for n in range(min, max+1, 1):
print(f"xfer b{n} f{n}")
# ---- take carrier out and drop remaining loops ----
#Take carrier out with yarn inserting hook:
print(f"outhook {carrier}")
#drop loops:
for n in range(min, max+1, 1):
print(f"drop f{n}")
#title: Garter Sheet (python with knitout module)
import knitout
K = knitout.Writer('1 2 3 4 5 6 7 8 9 10');
K.addHeader('Machine', 'SWGN2');
#Parameters:
min = 1 #needle number of left edge
max = 20 #needle number of right edge
rows = 20 #number of rows to knit
carrier = "3" #carrier name
# ---- set up initial loops and yarn carrier ----
#Bring in carrier:
K.inhook(carrier)
#Set stitch table entry for cast-on:
K.stitchNumber(101)
#On SWGN2 machines, carriers start on the right,
#so will start tucking onto needles right-to-left,
#and will be sure to tuck the rightmost needle in the first pass:
for n in range(max, min-1, -1):
#tuck alternating needles, making sure to do the right edge:
if (max - n) % 2 == 0:
K.tuck("-", 'f' + str(n), carrier)
#now, moving left-to-right, tuck the needles that were not tucked on the first pass:
for n in range(min, max+1, 1):
if (max - n) % 2 != 0:
K.tuck("+", 'f' + str(n), carrier)
#Set stitch table entry for knitting:
K.stitchNumber(105)
#knit two plain rows to allow cast-on stitches to relax:
# two isn't set in stone here -- it's just convenient
# for this example code to have the carrier end up on the right.
for n in range(max, min-1, -1):
K.knit("-", 'f' + str(n), carrier)
#send out yarn inserting hook; it is no longer needed to hold the yarn in place:
K.releasehook(carrier)
for n in range(min, max+1, 1):
K.knit("+", 'f' + str(n), carrier)
# ---- garter sheet ----
#Create a garter (alternating all-front-knits and all-back-knits rows) sheet:
for r in range(0, rows+1, 1):
if r % 2 == 0:
#knit even rows as left-going, front-knits rows:
for n in range(max, min-1, -1):
K.knit("-", 'f' + str(n), carrier)
else:
#knit odd rows as right-going, back-knits rows:
#move loops to back bed:
for n in range(min, max+1, 1):
K.xfer('f' + str(n), 'b' + str(n))
#right-going, back-knits row:
for n in range(min, max+1, 1):
K.knit("+", 'b' + str(n), carrier)
#return loops to front bed:
for n in range(min, max+1, 1):
K.xfer('b' + str(n), 'f' + str(n))
# ---- take carrier out and drop remaining loops ----
#Take carrier out with yarn inserting hook:
K.outhook(carrier)
#drop loops:
for n in range(min, max+1, 1):
K.drop('f' + str(n))
K.write('garter-sheet.swgn2.k')