EPGY 2011 Computer Science: Artificial Intelligence Lekan...
Transcript of EPGY 2011 Computer Science: Artificial Intelligence Lekan...
![Page 1: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/1.jpg)
1
EPGY 2011
Computer Science: Artificial Intelligence
Lekan Wang
![Page 2: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/2.jpg)
2
LECTURE 1.1
Introduction to the Course
Introduction to AI
Introduction/Review of Java and Code Design
![Page 3: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/3.jpg)
3
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 4: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/4.jpg)
4
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 5: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/5.jpg)
5
Who Are Your Counselors
• (RCs? TAs? RAs?)
• Name
• Academic Background
• CS and AI background
• Why you’re interested in AI, or what you’re
interested in learning
![Page 6: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/6.jpg)
6
Who Are You
• Name
• Why are you here?
• What’s your experience with computer
science?
• Why are you interested in AI?
• Summarize AI in a few sentences.
• Favorite snack foods
![Page 7: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/7.jpg)
7
Who Am I
• Stanford MS CS, BS MS&E
• Coordinated Stanford’s introductory CS
courses (CS106A, CS106B, CS106X, CS106L,
CS198)
• Work at Palantir Technologies
• SUMaC 2004
• Love to teach
• AI tools and concepts are powerful and useful
![Page 8: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/8.jpg)
8
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 9: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/9.jpg)
9
3 Weeks
• http://lekanwang.com/ai-epgy/wp-admin/
• Lecture – Stuff: 50/45/35
– 2 Breaks
• Lab (Groups of 3) – Problem Sets, “Vignettes,” and Code
– Shouldn’t ever finish
– Collaborative Reviews
• Daily Feedback -- http://goo.gl/uqDzF
• Evening Activities
![Page 10: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/10.jpg)
10
Final Project Timeline
• Week 1: Talk with RCs, me
• End of 2.1: Topic Selection
• Week 2: One-on-Ones with me
• Week 3: Optional one-on-ones
• 3.4: Presentations (15 minutes)
![Page 11: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/11.jpg)
11
3 Weeks
...OF EXPLORATION
![Page 12: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/12.jpg)
12
A Few Rules
Actively Engage and Contribute
Raise Questions
A Room of Equals
![Page 13: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/13.jpg)
13
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 14: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/14.jpg)
14
What Is AI? – Popular Views
• “The Machines” in The Matrix
• David, others in AI
• Data, The Borg in Star Trek
• Certain droids in Star Wars
• The Master Control Program in Tron
• Cylons in Basttlestar Galactica
• HAL 9000 in 2001: A Space Odyssey
• GLaDOS in Portal
• Cortana in Halo
• Terminator and SkyNet in Terminator
• The Steering Wheel in WALL-E
• Sonny from I, Robot
![Page 15: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/15.jpg)
15
What Is AI? – Maybe?
• Dumber droids in Star Wars
• The Computer in Star Trek
• Watson
• EDI in Mass Effect
• Dr. Know in AI
![Page 16: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/16.jpg)
16
What is AI? – Hmm...
• Chess playing program
• Military Drone/Autopilot
• Self-driving car
• Collision Avoidance System
• Adaptive Transmission
• Yelp/Netflix/iTunes/Facebook recommendations
• Washing Machine
![Page 17: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/17.jpg)
17
AI is the endeavor of building
intelligent artifacts or systems
Uhh...ok...?
![Page 18: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/18.jpg)
18
Strong vs. Weak AI
• John Searle
– Strong: “A physical symbol system can have a mind
and mental states.”
– Weak: “A physical symbol system can act
intelligently.”
• Strong presupposes consciousness
• WTF is consciousness?
![Page 19: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/19.jpg)
19
Approaches to AI
Systems that think like humans Systems the think rationally
Systems that act like humans Systems that act rationally
Russell/Norvig, 5
“The exciting new effort to make
computers think…machines with minds,
in the full and literal sense.”
“The study of the computations that
make it possible to perceive, reason, and
act.”
“The study of how to make computers do
things at which, at the moment, people
are better.”
“A field of study that seeks to explain and
emulate intelligent behavior in terms of
computational processes.”
![Page 20: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/20.jpg)
20
Approaches to AI—Human Simulation “Systems that think like humans.”
![Page 21: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/21.jpg)
21
• Cybernetics
• Ray Kurzweil (Technological Singularity)
• Early neural networks
Approaches to AI—Human Simulation “Systems that think like humans.”
![Page 22: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/22.jpg)
22
Approaches to AI—Logical Machines
• Theorem provers
• Constraint satisfaction problems
• Logic-based systems
“Systems that think rationally.”
![Page 23: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/23.jpg)
23
Approaches to AI—Turing Test “Systems that act like humans.”
• Turing Test
• Eliza, rule based systems
• The Most Human Human
![Page 24: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/24.jpg)
24
Approaches to AI – Rational Agent
• Bulk of modern AI approaches
• Techniques and tools
– Search
– Machine Learning
– Probabilistic Models
– Constraint satisfaction
– Perception/Sensors (Inputs)
– Robotics (Outputs)
“Systems that act rationally.”
![Page 25: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/25.jpg)
25
What a let down...
![Page 26: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/26.jpg)
26
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 27: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/27.jpg)
27
A Brief History – Early History
• From Control Theory/Operations Research
• (Pong came out in 1972)
• Arthur Samuel’s Checkers Program (ML)
• John McCarthy and Lisp (1958)
• Marvin Minsky
• Extreme optimism!
• Herbert Simon: Computer chess champion in ten years (1957)
![Page 28: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/28.jpg)
28
A Brief History—Slow Progress
• Problems
– Algorithmic complexity
– Logical Systems and Neural Nets inappropriate
– Researchers were naïve as hell
• Reframing of AI – rational agent model
• Expert Systems and Knowledge (1970s)
• Natural Language
![Page 29: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/29.jpg)
29
A Brief History— “Recent Progress”
• Handling Uncertainty
• Rational Agent model
• Probabilistic Methods
• Deep Learning
• Computer Vision
• SVMs
![Page 30: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/30.jpg)
30
So where are we now?
![Page 31: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/31.jpg)
31
What We Will Cover
• Real Tools
• Applications
![Page 32: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/32.jpg)
32
What We Will Cover
• Real Tools
• Applications
![Page 33: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/33.jpg)
33
What We Will Cover
• Real Tools
• Applications
![Page 34: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/34.jpg)
34
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 35: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/35.jpg)
35
Math and CS Foundations
• Data Structures
• Recursion
• Algorithms
• Complexity
• Proofs
• Probability
![Page 36: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/36.jpg)
36
Knowledge Representation
• Discrete vs. Continuous
• Data structures
• Ontologies
• Trees
• Graphs
• Logic and Logical Inference
![Page 37: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/37.jpg)
37
Search
• Maps and Directions
• Pathfinder
• Motion Planning
• Uninformed Search
• Informed Search
![Page 38: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/38.jpg)
38
CSPs
• Being smarter with constraints
• Planning
![Page 39: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/39.jpg)
39
Machine Learning
• Classification
• Regression
• Clustering
• Evaluation
• Applications
![Page 40: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/40.jpg)
40
Bayes and Markov
• Probabilistic Models
• Uncertainty
• Correlation/Causation
• Modeling Complex Behavior
• Neural Nets
![Page 41: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/41.jpg)
41
Other
• Natural Language Processing
• Autonomous vehicles
• Biocomputation
• Lisp
• Theorem Solvers
![Page 42: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/42.jpg)
42
Introduction
Class Structure
What is AI?
History
Topics and Techniques
Programming Intro
![Page 43: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/43.jpg)
43
Assumptions
• Familiarity with syntax of a modern
programming language (Java, C++, C, Python,
Visual Basic)
• Familiarity with math up to Algebra II
• Minimal exposure to theory of computing and
programming languages
![Page 44: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/44.jpg)
44
Language & Environment
• Java
• Eclipse
![Page 45: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/45.jpg)
45
Code Design
![Page 46: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/46.jpg)
46
Code Style
![Page 47: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/47.jpg)
47
Code Style
• Magic Numbers
• Tabbing and Spacing
• Variable Scoping
• Variable Names
• Unused Variables, Methods, and Warnings
• Control Structures Redundancy
• Commenting!!
• Decomposition!
• “Premature optimization is the root of all evil.” – Donald Knuth
![Page 48: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/48.jpg)
48
Debugging
![Page 49: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/49.jpg)
49
Debugging
• System.out.println()
• assert()
• Eclipse Debugger
![Page 50: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/50.jpg)
50
SGGraphics
![Page 51: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/51.jpg)
51
SGGraphics
• GraphicsProgram – Override
– setup()
– run()
• SGObjects
• MouseListener
• MouseMotionListener
• KeyListener
• ActionListener
• setXXXXDebugMode(boolean)
![Page 52: EPGY 2011 Computer Science: Artificial Intelligence Lekan Wanglekanwang.com/ai-epgy/wp-content/uploads/2011/06/L1-AI.pdfcourses (CS106A, CS106B, CS106X, CS106L, CS198) • Work at](https://reader033.fdocuments.in/reader033/viewer/2022052817/60b288a5d3516e5fec69c414/html5/thumbnails/52.jpg)
52
SGGraphics DEMO!