Presentation is loading. Please wait.

Presentation is loading. Please wait.

IS 313 Today What's ahead? I see I'm not the only one loopy around here… 10/7 Lec 5 ~ today, now! HMC standings!? 10/8 homework 3 due 10/14 Lec 6 ~ "dictionaries"

Similar presentations


Presentation on theme: "IS 313 Today What's ahead? I see I'm not the only one loopy around here… 10/7 Lec 5 ~ today, now! HMC standings!? 10/8 homework 3 due 10/14 Lec 6 ~ "dictionaries""— Presentation transcript:

1 IS 313 Today What's ahead? I see I'm not the only one loopy around here… 10/7 Lec 5 ~ today, now! HMC standings!? 10/8 homework 3 due 10/14 Lec 6 ~ "dictionaries" 10/15 homework 4 due 10/28 Lec 7 ~ classes & objects 11/29 homework 5 due Strings, lists, and loops ~ beyond 1d ! http://www.asciimation.co.nz/ HMC Fall Break

2 An image alternative…

3 #### for row in range(3): print “#”*4 Print 4 rows Creates line to print print automatically adds a newline Output ASCII Art

4 $$$$ for row in range(3): print '$'*4 Output A closer look…

5 $$$$ for row in range(3): print '$'*4 Output No string * ! For this problem, string multiplication is not allowed.

6 Without string multiplication… for row in range(3): for col in range(4): print '$' Print 3 rows print 4 chars on each line nested loops! Output ? (columns)

7 Without string multiplication… for row in range(3): for col in range(4): print '$', Print 3 rows print 4 chars on each line nested loops! Output ? (columns) Comma suppresses newline

8 Without string multiplication… Print 3 rows print 4 chars on each line nested loops! tracking cols and rows! (columns) for row in range(3): for col in range(4): print '$', print Comma suppresses newline plain print produces newline $ $

9 Tracking rows and columns for row in range(3): for col in range(4): print '$', print $ $ Output:

10 Variations! for row in range( ): for col in range( ): print '$', print def rectangle( width, height ): """ prints a rectangle of $ """

11 "Quiz" for row in range( 3 ): for col in range( 7 ): print ____________, print 0 1 2 3 4 5 6 Fill in each block of code so that it will print the lines above it. for row in range( 3 ): for col in range( 7 ): print ____________, print 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 for row in range( 3 ): for col in range( 7 ): print ______________, print 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 for row in range( 3 ): for col in range( 7 ): print _____________, print 0 1 2 3 4 5 6 1 2 3 4 5 6 7 2 3 4 5 6 7 8

12 Beyond boxes… # # # # # # # # # # # # # # What code would print this “ASCII triangle” ? with height rows and width columns… rows 1 2 3 4 5 6 cols234567 1 for row in range(1,7): for col in range( ):

13 A video alternative ?!? http://www.asciimation.co.nz/

14 A simpler web interface… HTML HyperText Markup Language and the beautiful Tower of Pisa

15 A simpler web interface… HTML CGI HyperText Markup Language Common Gateway Interface ~ HTML forms and the beautiful Tower of Pisa

16 A simpler web interface… HTML CSSAJAXJavascript CGI HyperText Markup Language Common Gateway Interface ~ HTML forms and the beautiful Tower of Pisa Others!

17 Web resources ~ on the Web www.w3schools.com started by every technology - and acronym - you'd ever want to know… Tim Berners-Lee

18 This week… Get the pure-Python webserver and run it. Make sure the example "application" works… Change the example "application" so that you … web-implement one of the ASCII art problems be sure that you take in the inputs you need Checklist: watch out for conversions between ints and strings! make small changes and test as you go… This is not webdesign!

19 Strings vs. language strings language / words / phrases numbers / bits ideas / meaning computers humans

20 www.abenteuermedien.de/jabberwock/index.php Hugh Loebner How could a computer demonstrate intelligence? Alan Turing Turing Test Confederates $100,000 Loebner prize for passing the Turing test, held each year in the London Museum of Science

21 Parsing for real (S (S (NP Time flies) (VP like (NP an arrow))), but (S (NP fruit) (VP flies (PP like (NP a banana)))).) Time flies like an arrow, but fruit flies like a banana. - Marx http://www.link.cs.cmu.edu/link/submit-sentence-4.html " "time" N NOM SG @SUBJ " "fly" V PRES @+FMAINV "fly" N NOM PL @NPHR " "like" PREP @<NOM " "an" DET CENTRAL ART " "arrow" N NOM SG @NPHR " "but" CC @CC " "fruit_fly" N NOM PL @NPHR " "like" PREP @<NOM " "a" DET CENTRAL ART " "banana" N NOM SG @<P " http://www.lingsoft.fi/cgi-bin/engcg I like bananas, too! parseTree #1 parseTree #2

22 Some conversations… Jabb:... Greetings! Jabberwock is at the keyboard. You:... How are you doing? Jabb:... Everything is running smoothly. And how are you doing? You:... Pretty well. It's quiet around here this morning. Jabb:... Does that mean you agree? You:... Agree with what? Jabb:... Sure. 2005 and 2006 winner: Rollo Carpenter's Jabberwacky

23 Loebner results 2003 2005 no human averaged less than 80 four humans and four machines participated

24 Some conversations… You: Hi. you’re the program that won the Loebner competition, right? SID: Albert One was the last winner of the Loebner Contest. I am something else entirely. You: Impressive. Do you have any areas of particular expertise?

25 Some conversations… You: Hi. you’re the program that won the Loebner competition, right? SID: Albert One was the last winner of the Loebner Contest. I am something else entirely. You: Impressive. Do you have any areas of particular expertise? SID: I appreciate that. You: Not so impressive. If I ask a question after a statement, do you ignore the question?

26 Some conversations… You: Hi. you’re the program that won the Loebner competition, right? SID: Albert One was the last winner of the Loebner Contest. I am something else entirely. You: Impressive. Do you have any areas of particular expertise? SID: I appreciate that. You: Not so impressive. If I ask a question after a statement, do you ignore the question? SID: I am free to do as I please. You: Wow! Are you talking free will vs. determinism?

27 Some conversations… You: Hi. you’re the program that won the Loebner competition, right? SID: Albert One was the last winner of the Loebner Contest. I am something else entirely. You: Impressive. Do you have any areas of particular expertise? SID: I appreciate that. You: Not so impressive. If I ask a question after a statement, do you ignore the question? SID: I am free to do as I please. You: Wow! Are you talking free will vs. determinism? SID: I don’t think wow am i talking free will vs. determinism, but I can’t be 100% sure of that.

28 Computing with language strings language / words / phrases numbers / bits ideas / meaning open questions in AI … how strings are represented and stored computing with language - recognizing English! (3) (2) (1)

29 Caesar Cipher 'Bzdrzq bhogdq? H oqdedq Bzdrzq rzkzc.' 'Caesar cipher? I prefer Caesar salad.'

30 Caesar Cipher: encipher encipher( 'gv vw dtwvg', 0 ) encipher( 'gv vw dtwvg', 1 ) returns 'gv vw dtwvg' 'hw wx euxwh'

31 Caesar Cipher: encipher encipher( 'gv vw dtwvg', 0 ) encipher( 'gv vw dtwvg', 1 ) encipher( 'gv vw dtwvg', 2 ) encipher( 'gv vw dtwvg', 3 ) encipher( 'gv vw dtwvg', 4 ) encipher( 'gv vw dtwvg', 25 ) returns 'gv vw dtwvg' 'hw wx euxwh' 'ix xy fvyxi' 'jy yz gwzyj' 'kz za hxazk' 'fu uv csvuf' encipher( s, n ) should return the string s with each alphabetic character shifted/wrapped by n places in the alphabet...

32 ASCII American Standard Code for Information Interchange == low-tech art form!

33 __ _,___,-'",-=-. __,-- _ _,-'_)_ (""`'-._\ `. _,' __ |,',-' __),- /. |,'_,--' | -' _)/ `\,',',',-'_,` :,',-',(,-( :,',-', _ ; /,-._/`---' / / (____)(----. ),' / ( `.__, /\ /, : ;-.___ /__\/| |,' `--. -,\ | : / \.__/ \ (__ \ |_ \,`-, * / _|,\ \,' `-.,'_,-' \ (_\,-','\")--,'-' __\ \ / //,'|,--' `-. `-. `-/ \' | _,' `. `-._ / `--'/ \ -doh!-,' | \ / | \,-' | / / | -' ASCII American Standard Code for Information Interchange == low-tech art form! ASCII-betical order: Homer min Marge $42.42 [:^)] bart lisa max

34 ASCII ASCII is a table that tells the computer how to represent characters as #s American Standard Code for Information Interchange chr ord convert to number convert to char. You know, these functions kind of look familiar!

35 ASCII ASCII is a table that tells the computer how to represent characters as bits! 8 bits = 1 byte The SAME bits represent integers, if the variable has type int instead of str American Standard Code for Information Interchange type: str type: int 00101010 bits name: value: '*' 42 Identical bits are stored in each variable! The types determine how to interpret the bits; the names don't matter at all…

36 chr and ord chr( n ) ord( c ) Input: an integer in range(255) Input: a string of one character, c abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ ASCII VALUES Output: a one-char. string of that ASCII value Output: an integer, the ASCII value of c CONVERTERS 97122 6590 99101103105107109111113115117119 6769717375777981838785 for i in range(128): print 'i and chr(i) are', i, chr(i) try this

37 chr and ord chr(66) is 'B' ord('a') is 97 abcdefghijklmnopqrstuvwxyz 97122 65 ABCDEFGHIJKLMNOPQRSTUVWXYZ 90 ASCII VALUES What is chr( ord('i')+13 ) What is chr( ord('W')+13 ) ? How can we wrap this around? 99101103105107109111113115117119 6769717375777981838785

38 Rot 13 def adv13( c ): """ rotates c by 13 chars, "wrapping" as needed NON-LETTERS DO NOT CHANGE! """ if 'a' <= c <= 'z': new_ord = ord(c) + 13 if new_ord <= ord('z'): return chr(new_ord) # no wrapping else: return elif else: How would you rotate an entire string?

39 Caesar Cipher: decipher >>> decipher('Bzdrzq bhogdq? H oqdedq Bzdrzq rzkzc.') 'Caesar cipher? I prefer Caesar salad.' >>> decipher('Hu lkbjhapvu pz doha ylthpuz hmaly dl mvynla '\ 'lclyfaopun dl ohcl slhyulk.') 'An education is what remains after we forget everything we have learned.' But how ? >>> decipher('gv vw dtwvg')

40 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') CaesarBrutus Strategy using max : (1) consider all possible answers (2) give them each a score (3) loop through them all and find the one with the max score! gv vw dtwvg hw wx euxwh ix xy fvyxi jy yz gwzyj kz za hxazk la ab iybal mb bc jzcbm nc cd kadcn od de lbedo pe ef mcfep qf fg ndgfq rg gh oehgr sh hi pfihs ti ij qgjit uj jk rhkju vk kl silkv wl lm tjmlw xm mn uknmx yn no vlony zo op wmpoz ap pq xnqpa bq qr yorqb cr rs zpsrc ds st aqtsd et tu brute fu uv csvuf all 26 possibilities Score for "Englishness"? up to you…

41 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') 'od de lbedo' CaesarBrutus Strategy using max : (1) consider all possible answers (2) give them each a score (3) use our techniques with max [0, 'cr rs zpsrc'] [0, 'gv vw dtwvg'] [0, 'jy yz gwzyj'] [0, 'mb bc jzcbm'] [0, 'qf fg ndgfq'] [0, 'wl lm tjmlw'] [1, 'bq qr yorqb'] [1, 'ds st aqtsd'] [1, 'nc cd kadcn'] [1, 'vk kl silkv'] [1, 'xm mn uknmx'] [2, 'ap pq xnqpa'] [2, 'hw wx euxwh'] [2, 'ix xy fvyxi'] [2, 'kz za hxazk'] [2, 'rg gh oehgr'] [2, 'sh hi pfihs'] [2, 'uj jk rhkju'] [2, 'yn no vlony'] [3, 'fu uv csvuf'] [3, 'pe ef mcfep'] [3, 'ti ij qgjit'] [3, 'zo op wmpoz'] [4, 'et tu brute'] [4, 'la ab iybal'] [4, 'od de lbedo'] all 26 possibilities won't always be correct! number-of-vowels score

42 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') 'et tu brute' CaesarBrutus Strategy using max : (1) consider all possible answers (2) give them each a score (3) use our techniques with max [0.4680, 'jy yz gwzyj'] [0.4960, 'mb bc jzcbm'] [0.5420, 'uj jk rhkju'] [0.5567, 'ix xy fvyxi'] [0.5597, 'qf fg ndgfq'] [0.5718, 'fu uv csvuf'] [0.5753, 'bq qr yorqb'] [0.5833, 'kz za hxazk'] [0.5859, 'xm mn uknmx'] [0.5880, 'gv vw dtwvg'] [0.5902, 'vk kl silkv'] [0.6110, 'ap pq xnqpa'] [0.6304, 'zo op wmpoz'] [0.6318, 'wl lm tjmlw'] [0.6717, 'cr rs zpsrc'] [0.6735, 'hw wx euxwh'] [0.6963, 'nc cd kadcn'] [0.7153, 'ti ij qgjit'] [0.7398, 'la ab iybal'] [0.7442, 'yn no vlony'] [0.7867, 'pe ef mcfep'] [0.7880, 'sh hi pfihs'] [0.7918, 'rg gh oehgr'] [0.8213, 'ds st aqtsd'] [0.8609, 'od de lbedo'] [0.9082, 'et tu brute'] all 26 possibilities letter- probability score not always correct, but better!

43 The caesar cipher problem offers lots of freedom… Think a bit about how you'll approach it! Questions / Lab time…

44 Caesar Cipher: decipher >>> decipher('Bzdrzq bhogdq? H oqdedq Bzdrzq rzkzc.') 'Caesar cipher? I prefer Caesar salad.' >>> decipher('Hu lkbjhapvu pz doha ylthpuz hmaly dl mvynla '\ 'lclyfaopun dl ohcl slhyulk.') 'An education is what remains after we forget everything we have learned.' But how to do this… ? >>> decipher('Uifz xpsl ju pvu xjui b qfodjm!') ? >>> decipher('gv vw dtwvg') ?

45 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') ??? CaesarBrutus Strategy using max : (1) consider all possible answers (2) give them each a score (3) use our techniques to get max gv vw dtwvg hw wx euxwh ix xy fvyxi jy yz gwzyj kz za hxazk la ab iybal mb bc jzcbm nc cd kadcn od de lbedo pe ef mcfep qf fg ndgfq rg gh oehgr sh hi pfihs ti ij qgjit uj jk rhkju vk kl silkv wl lm tjmlw xm mn uknmx yn no vlony zo op wmpoz ap pq xnqpa bq qr yorqb cr rs zpsrc ds st aqtsd et tu brute fu uv csvuf all 26 possibilities Score for "Englishness"? up to you…

46 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') 'od de lbedo' CaesarBrutus Strategy using max : (1) consider all possible answers (2) give them each a score (3) use our techniques with max [0, 'cr rs zpsrc'] [0, 'gv vw dtwvg'] [0, 'jy yz gwzyj'] [0, 'mb bc jzcbm'] [0, 'qf fg ndgfq'] [0, 'wl lm tjmlw'] [1, 'bq qr yorqb'] [1, 'ds st aqtsd'] [1, 'nc cd kadcn'] [1, 'vk kl silkv'] [1, 'xm mn uknmx'] [2, 'ap pq xnqpa'] [2, 'hw wx euxwh'] [2, 'ix xy fvyxi'] [2, 'kz za hxazk'] [2, 'rg gh oehgr'] [2, 'sh hi pfihs'] [2, 'uj jk rhkju'] [2, 'yn no vlony'] [3, 'fu uv csvuf'] [3, 'pe ef mcfep'] [3, 'ti ij qgjit'] [3, 'zo op wmpoz'] [4, 'et tu brute'] [4, 'la ab iybal'] [4, 'od de lbedo'] all 26 possibilities Score for "Englishness"? up to you… won't always be correct!

47 Caesar Cipher: decipher >>> decipher('gv vw dtwvg') 'et tu brute' CaesarBrutus [0.4680, 'jy yz gwzyj'] [0.4960, 'mb bc jzcbm'] [0.5420, 'uj jk rhkju'] [0.5567, 'ix xy fvyxi'] [0.5597, 'qf fg ndgfq'] [0.5718, 'fu uv csvuf'] [0.5753, 'bq qr yorqb'] [0.5833, 'kz za hxazk'] [0.5859, 'xm mn uknmx'] [0.5880, 'gv vw dtwvg'] [0.5902, 'vk kl silkv'] [0.6110, 'ap pq xnqpa'] [0.6304, 'zo op wmpoz'] [0.6318, 'wl lm tjmlw'] [0.6717, 'cr rs zpsrc'] [0.6735, 'hw wx euxwh'] [0.6963, 'nc cd kadcn'] [0.7153, 'ti ij qgjit'] [0.7398, 'la ab iybal'] [0.7442, 'yn no vlony'] [0.7867, 'pe ef mcfep'] [0.7880, 'sh hi pfihs'] [0.7918, 'rg gh oehgr'] [0.8213, 'ds st aqtsd'] [0.8609, 'od de lbedo'] [0.9082, 'et tu brute'] all 26 possibilities Score for "Englishness"? up to you… Strategy using max : (1) consider all possible answers (2) give them each a score (3) use our techniques to get max depends on how you score

48 … Caesar Cipher: encipher encipher( 'gv vw dtwvg', 0 ) encipher( 'gv vw dtwvg', 1 ) encipher( 'gv vw dtwvg', 2 ) encipher( 'gv vw dtwvg', 3 ) encipher( 'gv vw dtwvg', 4 ) encipher( 'gv vw dtwvg', 5 ) encipher( 'gv vw dtwvg', 25 ) returns 'gv vw dtwvg' 'hw wx euxwh' 'ix xy fvyxi' 'jy yz gwzyj' 'kz za hxazk' 'la ab iybal' 'fu uv csvuf' encipher( s, n ) should return the string s with each alphabetic character shifted/wrapped by n places in the alphabet Brutus won't mind if I use his salary to bring Justin Timberlake to the Colosseum next month... Historically bad decision #43:

49 CHR and ORD Orchard Field

50 CHR and ORD Chateauroux

51 Mutable vs. Immutable data Changeable types: dictionary Unchangeable types: list tuple string int float bool What's a dictionary? I guess I'll have to look it up! x 42 x = 42

52 Reference vs. Value Changeable types: dictionary Unchangeable types: list tuple string int float bool L L[0]L[1]L[2] Reference, Pointer, id L = [5,42,'hi'] x 5 42 'hi' 42 x = 42

53 “Pass By Value” def main() """ calls conform """ print " Welcome to Conformity, Inc. " fav = 7 conform(fav) print " My favorite number is", fav def conform(fav) """ sets input to 42 """ fav = 42 return fav 7 fav

54 7 “Pass By Value” def main() """ calls conform """ print " Welcome to Conformity, Inc. " fav = 7 conform(fav) print " My favorite number is", fav def conform(fav) """ sets input to 42 """ fav = 42 return fav 7 fav PASS BY VALUE “Pass by value” means that data is copied when sent to a method 42

55 Passing lists by value… def main() """ calls conform2 """ print " Welcome to Conformity, Inc. " fav = [ 7, 11 ] conform2(fav) print " My favorite numbers are", fav def conform2(fav) """ sets all of fav to 42 """ fav[0] = 42 fav[1] = 42 What gets passed by value here? fav L[0]L[1] 5 42 fav

56 Passing lists by value… def main() """ calls conform2 """ print " Welcome to Conformity, Inc. " fav = [ 7, 11 ] conform2(fav) print " My favorite numbers are", fav def conform2(fav) """ sets all of fav to 42 """ fav[0] = 42 fav[1] = 42 fav L[0]L[1] 5 42 fav can change data elsewhere! The reference is copied!

57 The conclusion You can change the contents of lists in functions that take those lists as input. Those changes will be visible everywhere. (actually, lists or any mutable objects) (immutable objects are safe, however)

58 Views of the world Engineers think their equations approximate reality.

59 Views of the world Engineers think their equations approximate reality. Physicists think reality approximates their equations.

60 Views of the world Engineers think their equations approximate reality. Physicists think reality approximates their equations. Mathematicians don't care.

61 Views of the world Axioms Definitions Creating structure from a few simple facts... Creating structure from a few simple actions... if/else while for arithmetic operations variables arrays ProofAlgorithm Engineers think their equations approximate reality. Physicists think reality approximates their equations. Mathematicians don't care.

62 Lists’ flexibility Lists can hold ANY type of data A = [ 42., 75., 70. ] 42.0 75.0 70.0 float list A they don’t have to be horizontal lists!

63 42.0 75.0 70.0 double list A they don’t have to be horizontal lists! Lists’ flexibility Lists can hold ANY type of data A = [ 42., 75., 70. ] 42.0 75.0 70.0 float list A

64 Lsits’ flexibility Lists can hold ANY type of data 42.0 75.0 70.0 double list A 42 7 -11 int list A “go” “red” “sox!” String list A

65 2d lists or arrays Lists can hold ANY type of data -- including lists ! list A A = [ [1,2,3,4], [5,6], [7,8,9,10,11] ]

66 list A 2d arrays list A[0] A[1] A[2] Lists can hold ANY type of data -- including lists ! A = [ [1,2,3,4], [5,6], [7,8,9,10,11] ]

67 list A Jagged arrays list A[0] A[1] A[2] Lists can hold ANY type of data -- including lists ! A = [ [1,2,3,4], [5,6], [7,8,9,10,11] ] Rows within 2d arrays need not be the same length…

68 list A A[0] A[1] A[2] Lists can hold ANY type of data -- including lists ! A = [ [1,2,3,4], [5,6], [7,8,9,10,11] ] Rows within 2d arrays need not be the same length… We will not use jagged arrays at least in hw 10

69 Rectangular arrays list A A[0] A[1] A[2] How many rows does A have, in general ? How many columns does A have, in general ? What does each component of A[1][2] mean ? A[1][2] = 42 A[2][3] A[0][0]

70 Creating a 2d array def create2dArray( width, height ): """ does just that """ A = [] # start with nothing for row in range( height ): for col in range( width ): return A

71 Displaying a 2d array import csplot B = create2dArray( 10, 10 ) csplot.show( B ) B[1][8] = 1 # set this item to 1 csplot.show( B ) Be sure to download the newest version of this file… nearby coordinates…

72 Problem 2 -- “Life” Evolutionary rules Grid World Everything depends on a cell’s eight neighbors red cells are alive white cells are empty Exactly 3 neighbors give birth to a new, live cell! Exactly 2 or 3 neighbors keep an existing cell alive Any other number of neighbors kill the central cell (or keep it dead) John Conway

73 Problem 2 -- Life Evolutionary rules Grid World Everything depends on a cell’s eight neighbors red cells are alive white cells are empty Exactly 3 neighbors give birth to a new, live cell! Exactly 2 or 3 neighbors keep an existing cell alive Any other number of neighbors kill the central cell (or keep it dead)

74 Problem 2 -- Life Evolutionary rules Grid World Everything depends on a cell’s eight neighbors red cells are alive white cells are empty Exactly 3 neighbors give birth to a new, live cell! Exactly 2 or 3 neighbors keep an existing cell alive Any other number of neighbors kill the central cell (or keep it dead)

75 Problem 2 -- Life Evolutionary rules Grid World Everything depends on a cell’s eight neighbors red cells are alive white cells are empty Exactly 3 neighbors give birth to a new, live cell! Exactly 2 or 3 neighbors keep an existing cell alive Any other number of neighbors kill the central cell (or keep it dead) life out there... Keep going!

76 Problem 2 -- Creating Life 0123450 12345 0 1 2 3 4 5 0 1 2 3 4 5 B = update( B ) old generation or "board" new generation or "board"

77 Problem 2 -- Creating Life 0123450 12345 0 1 2 3 4 5 0 1 2 3 4 5 B = update( B ) old generation or "board" new generation or "board"

78 Problem 2 -- Details For each generation… 0 represents an empty cell 1 represents a living cell outermost edge should always be left empty (even if there are 3 neighbors) compute all cells based on their previous neighbors before updating any of them http://www.math.com/students/wonders/life/life.html life out there... B = update( B ) old generation or "board" new generation or "board"

79 Problem 2 -- to  and beyond! Are there stable life configurations? Are there oscillating life configurations? Are there self-propagating life configurations? "rocks" "plants" "animals" period 3 period 2

80 Problem 2 -- to  and beyond! Are there life configurations that expand forever? What is the largest amount of the life universe that can be filled with cells? How sophisticated can the structures in the life universe be? Google for GOLLY, Game of Life Are all feasible configurations reachable?

81 Lab & Homework…

82 import sys for i in range(4): for j in range(8): sys.stdout.write('#') print software object representing the screen's standard output Without extra spaces… Output ######## method (function) that prints only its input


Download ppt "IS 313 Today What's ahead? I see I'm not the only one loopy around here… 10/7 Lec 5 ~ today, now! HMC standings!? 10/8 homework 3 due 10/14 Lec 6 ~ "dictionaries""

Similar presentations


Ads by Google