330 likes | 469 Views
ICM Class 9. Strings and Text. Text in the Arts. “Cut right through the pages of any book or newsprint… lengthwise for example, and shuffle the columns of text. Put them together at hazard and read the newly constructed message.”. Eliza. 1966 Joseph Weizenbaum invents Eliza
E N D
ICM Class 9 Strings and Text
Text in the Arts “Cut right through the pages of any book or newsprint… lengthwise for example, and shuffle the columns of text. Put them together at hazard and read the newly constructed message.”
Eliza • 1966 Joseph Weizenbaum invents Eliza - 1st chatbot - Used very simple scripts for compelling interaction • Included in EMACS
Racter 1983 A hot and torrid bloom Which fans wise flames And begs to be redeemed by forces black and strong Will now oppose my naked will And force me into regions of despair More than iron More than lead More than gold I need electricity I need it more than I need lamb or pork or lettuce or cucumber I need it for my dreams
Don Waber’s “Strings” • Brian Kim Stefans’ “Dreamlife of letters”
Characters • What is a character? • ‘a’ • ‘1’ • ‘@’
Characters • ‘a’ = 97 • ‘1’ = 49 • ‘@’ = 64
Characters • char class maps integers to alphanumeric representations
Strings • English characters represented by ASCII
Characters • All characters are unicode
Strings • Strings are collections of multiple chars: • Cat • Dog • !@#$RAT#@ • 123
Strings • char[] string = {‘c’, ‘a’, ‘t’};
Strings • String s = “cat”;
Strings • charAt / indexOf • Length • equals • subString • +
Strings • Much much more online
Text • Displaying text
Text • text(<string>, x, y);
Text • PFont • textFont(<PFont>)
Text • To display Unicode text you need the codes
Text • PFont • textFont(<PFont>)
Files • loadStrings • printWriter
Files • loadStrings can take a URL instead of a local file
Directories • Paths • /Users/heatherdewey-hagborg/…