120
PHOTO: LISA COCKBURN KNIT ONE COMPUTE ONE Kris Howard @web_goddess YOW! Sydney 2016

Knit One, Compute One - YOW! 2016

Embed Size (px)

Citation preview

Page 1: Knit One, Compute One - YOW! 2016

PHOTO: LISA COCKBURN

KNIT ONE COMPUTE ONE

Kris Howard @web_goddess YOW! Sydney 2016

Page 2: Knit One, Compute One - YOW! 2016
Page 3: Knit One, Compute One - YOW! 2016

ENCRYPTION

Page 4: Knit One, Compute One - YOW! 2016

for i in [1..5] if i % 15 is 0 console.log "FizzBuzz" else if i % 3 is 0 console.log "Fizz" else if i % 5 is 0 console.log "Buzz" else console.log i

Page 5: Knit One, Compute One - YOW! 2016

1 2 FIZZ 4 BUZZ

Page 6: Knit One, Compute One - YOW! 2016

Worked over a multiple of 24 stitches.

Row 1 (RS): Knit Row 2: Purl Row 3: *(k2tog) 4 times, (yo, k1) 8 times, (k2tog) 4 times; rep from * to end. Row 4: Purl

Repeat rows 1-4 until desired length.

Page 7: Knit One, Compute One - YOW! 2016

FEATHER & FAN STITCH

Page 8: Knit One, Compute One - YOW! 2016
Page 9: Knit One, Compute One - YOW! 2016

Programming Knitting

Page 10: Knit One, Compute One - YOW! 2016
Page 11: Knit One, Compute One - YOW! 2016

Programming Knitting

Page 12: Knit One, Compute One - YOW! 2016

Programming Knitting

Me

Page 13: Knit One, Compute One - YOW! 2016

FLICKR: LORNA MITCHELL

Page 14: Knit One, Compute One - YOW! 2016

FLICKR: SBRISTOW

Page 15: Knit One, Compute One - YOW! 2016

KNITTING IS BINARY

FLICKR: STEPHANIEASHER

Page 17: Knit One, Compute One - YOW! 2016

“BINARY SCARF” BY HEYCARRIEANN

Page 21: Knit One, Compute One - YOW! 2016

FLICKR: JACQUELINE-W

Page 25: Knit One, Compute One - YOW! 2016
Page 26: Knit One, Compute One - YOW! 2016

“SCOREBOARD” BY MICHELLE HUNTER

FLICKR: TONY & WAYNE

Page 27: Knit One, Compute One - YOW! 2016
Page 28: Knit One, Compute One - YOW! 2016

Cast on 24 stitches.

Page 29: Knit One, Compute One - YOW! 2016

FOR LOOP

Page 30: Knit One, Compute One - YOW! 2016

let stitchCount = 24;

for (let i = 0; i < stitchCount; i++) { stitch.castOn() }

Page 31: Knit One, Compute One - YOW! 2016

let stitchCount = 24;

for (let i = 0; i < stitchCount; i++) { stitch.castOn() }

Page 32: Knit One, Compute One - YOW! 2016

let stitchCount = 24;

for (let i = 0; i < stitchCount; i++) { stitch.castOn() }

Page 33: Knit One, Compute One - YOW! 2016

K2 P2

Page 34: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 2; i++) { stitch.knit() }

for (let i = 0; i < 2; i++) { stitch.purl(): }

Page 35: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 2; i++) { stitch.knit() }

for (let i = 0; i < 2; i++) { stitch.purl(): }

Page 36: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 2; i++) { stitch.knit() }

for (let i = 0; i < 2; i++) { stitch.purl(): }

Page 37: Knit One, Compute One - YOW! 2016

Repeat rows 1 – 4 ten times.

Page 38: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 39: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 40: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 41: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 42: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 43: Knit One, Compute One - YOW! 2016

for (let i = 0; i < 10; i++) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 44: Knit One, Compute One - YOW! 2016

Repeat to end of row.

Page 45: Knit One, Compute One - YOW! 2016

WHILE LOOP

Page 46: Knit One, Compute One - YOW! 2016

while ( !thisrow.atEnd() ) { stitch.knit(); }

Page 47: Knit One, Compute One - YOW! 2016

while ( !thisrow.atEnd() ) { stitch.knit(); }

Page 48: Knit One, Compute One - YOW! 2016

while ( !thisrow.atEnd() ) { stitch.knit(); }

Page 49: Knit One, Compute One - YOW! 2016

Repeat rows 1-4 until scarf is 80in long or

desired length.

Page 50: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 51: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 52: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 53: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 54: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 55: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 56: Knit One, Compute One - YOW! 2016

let desiredLength = 80;

while ( scarf.length < desiredLength ) { nextRow.row1(); nextRow.row2(); nextRow.row3(); nextRow.row4(); }

Page 57: Knit One, Compute One - YOW! 2016

Row 3: *(k2tog) 4 times, (yo, k1) 8 times, (k2tog) 4 times; rep from * to end.

Page 58: Knit One, Compute One - YOW! 2016

while ( !thisRow.atEnd() ) { stitch.k2tog(4); for (let i = 0; i < 8, i++) { stitch.yo(); stitch.knit(); } stitch.k2tog(4); }

Page 59: Knit One, Compute One - YOW! 2016

while ( !thisRow.atEnd() ) { stitch.k2tog(4); for (let i = 0; i < 8, i++) { stitch.yo(); stitch.knit(); } stitch.k2tog(4); }

Page 60: Knit One, Compute One - YOW! 2016

while ( !thisRow.atEnd() ) { stitch.k2tog(4); for (let i = 0; i < 8, i++) { stitch.yo(); stitch.knit(); } stitch.k2tog(4); }

Page 61: Knit One, Compute One - YOW! 2016

while ( !thisRow.atEnd() ) { stitch.k2tog(4); for (let i = 0; i < 8, i++) { stitch.yo(); stitch.knit(); } stitch.k2tog(4); }

Page 62: Knit One, Compute One - YOW! 2016

while ( !thisRow.atEnd() ) { stitch.k2tog(4); for (let i = 0; i < 8, i++) { stitch.yo(); stitch.knit(); } stitch.k2tog(4); }

Page 63: Knit One, Compute One - YOW! 2016

Cast on 242 (256, 270, 284) sts.

Page 64: Knit One, Compute One - YOW! 2016
Page 65: Knit One, Compute One - YOW! 2016

SWITCH STATEMENT

Page 66: Knit One, Compute One - YOW! 2016

let size = 38;

switch (size) { case 38: stitch.castOn(242); case 41: stitch.castOn(256); case 43: stitch.castOn(270); case 45: stitch.castOn(284); }

Page 67: Knit One, Compute One - YOW! 2016

let size = 38;

switch (size) { case 38: stitch.castOn(242); case 41: stitch.castOn(256); case 43: stitch.castOn(270); case 45: stitch.castOn(284); }

Page 68: Knit One, Compute One - YOW! 2016

let size = 38;

switch (size) { case 38: stitch.castOn(242); case 41: stitch.castOn(256); case 43: stitch.castOn(270); case 45: stitch.castOn(284); }

Page 69: Knit One, Compute One - YOW! 2016

SUBROUTINES

Page 70: Knit One, Compute One - YOW! 2016
Page 71: Knit One, Compute One - YOW! 2016
Page 72: Knit One, Compute One - YOW! 2016

function twistedRib(stitchCount) { //row 1 stitch.purl(); stitch.knit(); for (let i = 3; i < stitchCount; i++) { stitch.ptbl(); stitch.knit(); } stitch.purl(); needles.swap(); // row 2 stitch.knit(); stitch.purl(); for (let i = 3; i < stitchCount; i++) { stitch.ktbl(); stitch.purl(); } stitch.knit(); needles.swap(); }

Page 73: Knit One, Compute One - YOW! 2016

function twistedRib(stitchCount) { //row 1 stitch.purl(); stitch.knit(); for (let i = 3; i < stitchCount; i++) { stitch.ptbl(); stitch.knit(); } stitch.purl(); needles.swap(); // row 2 stitch.knit(); stitch.purl(); for (let i = 3; i < stitchCount; i++) { stitch.ktbl(); stitch.purl(); } stitch.knit(); needles.swap(); }

Page 74: Knit One, Compute One - YOW! 2016

function twistedRib(stitchCount) { //row 1 stitch.purl(); stitch.knit(); for (let i = 3; i < stitchCount; i++) { stitch.ptbl(); stitch.knit(); } stitch.purl(); needles.swap(); // row 2 stitch.knit(); stitch.purl(); for (let i = 3; i < stitchCount; i++) { stitch.ktbl(); stitch.purl(); } stitch.knit(); needles.swap(); }

Page 75: Knit One, Compute One - YOW! 2016

function twistedRib(stitchCount) { //row 1 stitch.purl(); stitch.knit(); for (let i = 3; i < stitchCount; i++) { stitch.ptbl(); stitch.knit(); } stitch.purl(); needles.swap(); // row 2 stitch.knit(); stitch.purl(); for (let i = 3; i < stitchCount; i++) { stitch.ktbl(); stitch.purl(); } stitch.knit(); needles.swap(); }

Page 76: Knit One, Compute One - YOW! 2016

function twistedRib(stitchCount) { //row 1 stitch.purl(); stitch.knit(); for (let i = 3; i < stitchCount; i++) { stitch.ptbl(); stitch.knit(); } stitch.purl(); needles.swap(); // row 2 stitch.knit(); stitch.purl(); for (let i = 3; i < stitchCount; i++) { stitch.ktbl(); stitch.purl(); } stitch.knit(); needles.swap(); }

Page 77: Knit One, Compute One - YOW! 2016
Page 78: Knit One, Compute One - YOW! 2016

COROUTINES

Page 79: Knit One, Compute One - YOW! 2016
Page 80: Knit One, Compute One - YOW! 2016

Row 1: Side,O,*D,C,F,X,F,O,F,X*,

D,B,D,A,E,B,E,**X,F,O,F,X,F,X,E**,

O,Side,O,rep from * to * once,

pm,F,O,F,X,F,C,F,W,F,O,F,pm,

rep from ** to ** once, O.

Page 81: Knit One, Compute One - YOW! 2016
Page 82: Knit One, Compute One - YOW! 2016

PATTERN LANGUAGES

Page 83: Knit One, Compute One - YOW! 2016
Page 84: Knit One, Compute One - YOW! 2016
Page 85: Knit One, Compute One - YOW! 2016
Page 86: Knit One, Compute One - YOW! 2016
Page 87: Knit One, Compute One - YOW! 2016
Page 88: Knit One, Compute One - YOW! 2016
Page 89: Knit One, Compute One - YOW! 2016
Page 90: Knit One, Compute One - YOW! 2016

stitch-maps.com

Page 91: Knit One, Compute One - YOW! 2016

Rows 1 and 3 (WS): Purl.

Row 2: K1, *k2tog, k2, yo, k1,

yo, k2, ssk, repeat from *.

Row 4: *K2tog, k2, yo, k1, yo,

k2, ssk, repeat from * to last

st, k1.

Page 92: Knit One, Compute One - YOW! 2016
Page 93: Knit One, Compute One - YOW! 2016
Page 94: Knit One, Compute One - YOW! 2016
Page 95: Knit One, Compute One - YOW! 2016
Page 96: Knit One, Compute One - YOW! 2016
Page 97: Knit One, Compute One - YOW! 2016

knitml.com

Page 98: Knit One, Compute One - YOW! 2016

<pattern:pattern xmlns:pattern="http://www.knitml.com/schema/pattern" xmlns="http://www.knitml.com/schema/operations" xmlns:common="http://www.knitml.com/schema/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knitml.com/schema/pattern http://www.knitml.com/schema/pattern-0.7.xsd http://www.knitml.com/schema/operations http://www.knitml.com/schema/operations-0.7.xsd http://www.knitml.com/schema/common http://www.knitml.com/schema/common-0.7.xsd" version="0.7" xml:lang="en"> <pattern:directives> <pattern:instruction-definitions> <inline-instruction id="cross-2-over-2" label="2/2 LC"> <cross-stitches first="2" next="2" type="front" /> <knit>4</knit> </inline-instruction> <inline-instruction id="cross-2-behind-2" label="2/2 RC"> <cross-stitches first="2" next="2" type="back" /> <knit>4</knit> </inline-instruction> </pattern:instruction-definitions> </pattern:directives> <pattern:general-information> <pattern:name>Color Sampler Swatch</pattern:name> <pattern:description>A basic 2-color swatch sampler</pattern:description> <pattern:dimensions /> <pattern:gauge type="stockinette"> <pattern:stitch-gauge unit="st/in">5</pattern:stitch-gauge>

Page 99: Knit One, Compute One - YOW! 2016

Pattern "en" { Directives { InstructionDefinitions { InlineInstruction 'cross-2-over-2' [label:"2/2 LC"] { cross 2 inFrontOf 2, k4 } InlineInstruction 'cross-2-behind-2' [label:"2/2 RC"] { cross 2 behind 2, k4 } } } GeneralInformation { Name: "Color Sampler Swatch" Description: "A basic 2-color swatch sampler" Dimensions Gauge 'stockinette' { StitchGauge: 5 stitchesPerInch RowGauge: 7 rowsPerInch } Techniques { Technique: "stranded knitting" Technique: "cabling"

KnittingEL

Page 100: Knit One, Compute One - YOW! 2016

sourceforge.net/projects/knitter/

Page 101: Knit One, Compute One - YOW! 2016

https://xkcd.com/927/

Page 102: Knit One, Compute One - YOW! 2016
Page 103: Knit One, Compute One - YOW! 2016
Page 104: Knit One, Compute One - YOW! 2016
Page 105: Knit One, Compute One - YOW! 2016

Knitty: Know It All Bag

Page 106: Knit One, Compute One - YOW! 2016
Page 107: Knit One, Compute One - YOW! 2016
Page 109: Knit One, Compute One - YOW! 2016

FLICKR: MAR CANET

Page 111: Knit One, Compute One - YOW! 2016

knityak.com

Page 112: Knit One, Compute One - YOW! 2016
Page 113: Knit One, Compute One - YOW! 2016
Page 114: Knit One, Compute One - YOW! 2016

KNITTING AS COMPUTATION

Page 115: Knit One, Compute One - YOW! 2016
Page 116: Knit One, Compute One - YOW! 2016

FLICKR: KATEMONKEY

Page 118: Knit One, Compute One - YOW! 2016

FLICKR: CHRISTIAAN COLEN

Page 119: Knit One, Compute One - YOW! 2016