Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Recreational Programming

Recreational Programming

Slides of the talk given at PyConf Hyd 2017.

Anand Chitipothu

October 08, 2017
Tweet

More Decks by Anand Chitipothu

Other Decks in Programming

Transcript

  1. Who is Speaking? Anand Chi)pothu @anandology • Autodidact Programmer •

    Building a data science pla5orm at @rorodata • Advanced programming courses at @pipalacademy • Worked at Strand Life Sciences and Internet Archive 2
  2. The Game • infinite two-dimensional orthogonal grid of square cells

    • each cell is either alive or dead h"p://www.math.cornell.edu/~lipa/mec/banner.png 15
  3. The Rules Any live cell with: • fewer than two

    live neighbours dies - loneliness • more than three live neighbours dies - overpopula7on • two or three live neighbours lives on - right living condi7ons Any dead cell with: • exactly three live neighbours becomes a live cell, as if by reproduc9on. 16
  4. 5. Li&le Languages1 1 Programming Pearls - Jon Bentley, h5p:/

    /cs448h.stanford.edu/li5le-languages.pdf 23
  5. The Pic Language .PS ellipse "pic program" arrow box "PIC"

    arrow box "TROFF" arrow ellipse "output" .PE 24
  6. .PS pi = 3.14159 n = 20 r = 3.5

    s = 2*pi/n for i = 1 to n-1 do { for j = i+1 to n do { line from r*cos(s*i), r*sin(s*i) \ to r*cos(s*j), r*sin(s*j) } } .PE 25
  7. Extract data from readable strings: every day at 10:00 AM

    every month on first day at 5:00PM 27
  8. Example: Count Change How to make change of 100 using

    denomina5ons 50, 25, 10, 5 and 1? Too tedious to try it manually. How about wri4ng a program? 30
  9. A language that doesn't affect the way you think about

    programming, is not worth knowing. — Alan Perlis 32