Top Banner
ICM Class 9 Strings and Text
33

ICM Class 9

Dec 31, 2015

Download

Documents

colin-patton

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 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ICM Class 9

ICM Class 9

Strings and Text

Page 2: ICM Class 9
Page 3: ICM Class 9
Page 4: ICM Class 9
Page 5: ICM Class 9
Page 6: ICM Class 9

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.”

Page 8: ICM Class 9
Page 9: ICM Class 9
Page 10: ICM Class 9
Page 11: ICM Class 9

Eliza

• 1966 Joseph Weizenbaum invents Eliza - 1st chatbot- Used very simple scripts for compelling interaction

• Included in EMACS

Page 12: ICM Class 9

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

Page 16: ICM Class 9

Characters

• What is a character?• ‘a’• ‘1’• ‘@’

Page 17: ICM Class 9

Characters

• ‘a’ = 97• ‘1’ = 49• ‘@’ = 64

Page 18: ICM Class 9

Characters

• char class maps integers to alphanumeric representations

Page 19: ICM Class 9

Strings

• English characters represented by ASCII

Page 20: ICM Class 9

Characters

• All characters are unicode

Page 21: ICM Class 9

Strings

• Strings are collections of multiple chars: – Cat– Dog– !@#$RAT#@– 123

Page 22: ICM Class 9

Strings

• char[] string = {‘c’, ‘a’, ‘t’};

Page 23: ICM Class 9

Strings

• String s = “cat”;

Page 24: ICM Class 9

Strings

• charAt / indexOf• Length• equals• subString• +

Page 25: ICM Class 9

Strings

• Much much more online

Page 26: ICM Class 9

Text

• Displaying text

Page 27: ICM Class 9

Text

• text(<string>, x, y);

Page 28: ICM Class 9

Text

• PFont• textFont(<PFont>)

Page 29: ICM Class 9

Text

• To display Unicode text you need the codes

Page 30: ICM Class 9

Text

• PFont• textFont(<PFont>)

Page 31: ICM Class 9

Files

• loadStrings• printWriter

Page 32: ICM Class 9

Files

• loadStrings can take a URL instead of a local file

Page 33: ICM Class 9

Directories

• Paths• /Users/heatherdewey-hagborg/…