week 0 - cs50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 computer science 50...
TRANSCRIPT
![Page 1: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/1.jpg)
0
Computer Science 50Introduction to Computer Science I
Harvard College
David J. [email protected]
Week 0
![Page 2: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/2.jpg)
1
Roll Call
1) Stand up.2) Think to yourself “I am #1”.3) Pair up with someone; add your numbers
together; take that sum as your new number.4) One of you should sit down.5) GOTO step 3 if still standing.
![Page 3: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/3.jpg)
2
Divide and Conquer
![Page 4: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/4.jpg)
3
Lolcats
![Page 5: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/5.jpg)
4
Who
![Page 6: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/6.jpg)
5
“Those Less Comfortable”
Image from stevens.senate.gov.
![Page 7: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/7.jpg)
6
Prior Programming Experience
![Page 8: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/8.jpg)
7
Gender
![Page 9: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/9.jpg)
8
Should I?
Today (9/15), 3:30 – 5, Emerson 105Wednesday (9/17), 3:30 – 5, Emerson 105Thursday (9/18), 3:30 – 5, Emerson 105
![Page 10: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/10.jpg)
9
0
![Page 11: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/11.jpg)
10
1
![Page 12: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/12.jpg)
11
Counting in Binary128s 64s 32s 16s 8s 4s 2s 1s
![Page 13: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/13.jpg)
12
Counting in Binary128s 64s 32s 16s 8s 4s 2s 1s
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 11
0 0 0 0 0 0 11 0
0 0 0 0 0 0 11 11
0 0 0 0 0 11 0 0
![Page 14: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/14.jpg)
13
Cambridge in Binary
_ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
128s 64s 32s 16s 8s 4s 2s 1s
![Page 15: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/15.jpg)
14
Cambridge in Binary
0 0 0 0 0 0 0 0
0 0 0 0 0 0 11 0
0 0 0 0 0 0 0 11
0 0 0 0 0 0 11 11
0 0 0 0 11 0 0 0
128s 64s 32s 16s 8s 4s 2s 1s
![Page 16: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/16.jpg)
15
FoxTrot in Binary
![Page 17: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/17.jpg)
16
ASCII
![Page 18: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/18.jpg)
17
This is CS 50.Introduction to the intellectual enterprises of computer sciences.
Algorithms: design, implementation, analysis. Software development: abstraction, encapsulations, data structures, debugging, testing.
Architecture of computers: low-level data representation, instructions processing. Computer Systems: programming languages, compilers, operating systems, databases. Computers in the real world: networks,
websites, security, forensics, cryptography. This course teachesstudents how to think more carefully and how to solve problems more
effectively. Problem sets involve extensive programming in C as well as PHP and JavaScript.
No previous programming experience required.
This course, when taken for a letter grade, meets the Core area requirement for Quantitative Reasoning.
![Page 19: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/19.jpg)
18
Expectations*
Attend all lectures and sectionsComplete nine problem setsTake two quizzesProduce a final project
* No final exam.
![Page 20: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/20.jpg)
19
Grades*
Problem Sets (best 8 out of 9) 60%Quizzes 30%Final Project 10%
* You may take the course pass/fail.
![Page 21: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/21.jpg)
20
Website
http://cs50.net/
![Page 22: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/22.jpg)
21
RecommendedFor Those Less Comfortable
![Page 23: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/23.jpg)
22
Recommended For Those More Comfortable
![Page 24: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/24.jpg)
23
Recommended For Everyone
![Page 25: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/25.jpg)
24
Recommended For Aspiring Hackers
![Page 27: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/27.jpg)
26
Sections
For “those less comfortable”For “those more comfortable”For those somewhere in between
![Page 28: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/28.jpg)
27
Staff
Teaching FellowsCourse AssistantsVirtual Teaching FellowsSysadminsScribesProducers, Videographers, AVme
![Page 29: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/29.jpg)
28
Head TF
![Page 30: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/30.jpg)
29
Office Hours
![Page 31: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/31.jpg)
30
Virtual Office Hours
![Page 32: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/32.jpg)
31
Workload
![Page 33: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/33.jpg)
32
LecturesWeek 0
Introduction. Bits. Binary. ASCII. Programming. Algorithms. Scratch. Statements. Boolean expressions.
Conditions. Loops. Variables. Threads. Events.
![Page 34: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/34.jpg)
33
LecturesWeek 1
C. Source code. Compilers. Object code. SSH. SFTP. GCC. Functions. Comments. Standard output. Arithmetic
operators. Precedence. Associativity. Local variables. Types. Casting. Standard input. Libraries. Boolean
expressions, continued. Conditions, continued. Loops, continued.
printf("hai, world\n");
![Page 35: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/35.jpg)
34
LecturesWeek 2
Functions, continued. Global variables. Parameters. Return Values. Stack. Frames. Scope. Arrays. Strings.
Command-line arguments. Cryptography.
![Page 36: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/36.jpg)
35
LecturesWeek 3
Linear search. Binary search. Asymptotic notation. Recursion. Pseudorandomness. Bubble sort. Selection
sort. Insertion sort. Merge sort.
![Page 37: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/37.jpg)
36
LecturesWeek 4
Structures. Dynamic memory allocation. Pointers.
![Page 38: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/38.jpg)
37
LecturesWeek 5
Pointers, continued. Heap. Debugging. File I/O. Forensics.
![Page 39: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/39.jpg)
38
![Page 40: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/40.jpg)
39
LecturesWeek 6
Linked lists.
Figure from http://cs.calvin.edu/books/c++/ds/1e/.
L
first
mySize 5
last9 17 22 26 34
prev
next
![Page 41: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/41.jpg)
40
LecturesWeek 7
Hash tables. Binary search trees. Huffman coding. Heaps. Heapsort. Tries.
Image from Data Structures & Their Algorithms.
![Page 42: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/42.jpg)
41
LecturesWeek 8
TCP/IP. HTTP. XHTML. PHP. SQL.
![Page 43: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/43.jpg)
42
LecturesWeek 9
DOM. CSS. Inheritance. JavaScript. Events, continued. OOP. Ajax.
Image from www.gearthblog.com.
![Page 44: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/44.jpg)
43
LecturesWeek 10
Preprocessing. Compiling. Assembling. Linking. CPUs.
Image from regmedia.co.uk.
![Page 45: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/45.jpg)
44
LecturesWeek 11
Enterprise architectures. Virtualization. Cloud computing. Sneak previews.
Image from amazon.com.
![Page 46: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/46.jpg)
45
LecturesWeek 12
Exciting conclusion.
![Page 47: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/47.jpg)
46
Problem Sets*Problem Set 0: ScratchProblem Set 1: CProblem Set 2: CryptoProblem Set 3: To Be NamedProblem Set 4: To Be NamedProblem Set 5: ForensicsProblem Set 6: MispellingsProblem Set 7: XHTML + PHP + SQLProblem Set 8: JavaScript
* Hacker Editions too
![Page 48: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/48.jpg)
47
Final Project*
Build something of interest to you.Make something useful.Solve an actual problem.Somehow impact campus.
* CS 50 Fair
![Page 49: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/49.jpg)
48
kthxbai
![Page 50: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/50.jpg)
49
Algorithms1) let socks_on_feet = 02) while socks_on_feet != 23) open sock drawer4) look for sock5) if you find a sock then6) put on sock7) socks_on_feet++8) look for matching sock9) if you find a matching sock then10) put on matching sock11) socks_on_feet++12) close sock drawer13) else14) remove first sock from foot15) socks_on_feet--16) else17) do laundry and replenish sock drawer
![Page 51: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/51.jpg)
50
O Hai, C!hai.c
#include <stdio.h>
int
main(int argc, char * argv[])
{printf("O hai, world!\n");
}
![Page 52: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/52.jpg)
51
O Hai, C!#include <stdio.h>
int
main(int argc, char * argv[])
{
printf("O hai, world!\n");
}10000011 00000001 00010001 00000000 00111101 11111100 01110100 0011110100000000 01000000 00000000 00000000 00000000 00000000 00000000 0000000010010000 00000000 00000000 00000000 01010000 00000000 00000111 0011000000001011 00000001 00001011 00000011 00001010 00000000 00000000 0000000000000000 00100000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00100000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000001110000 00010000 00000000 00100000 00000001 00000000 00000000 0000000000000000 00000000 00000000 00100000 00000001 00000000 00000000 0000000000000000 00000000 00000000 01000000 00000001 00000000 00000000 0000000000000000 00100000 00000000 01000000 00000001 00000000 00000000 0000000011111111 11111111 11111111 11111111 11111111 11111111 11111111 1111111110010000 10000000 00000000 01000000 00000001 00000000 00000000 0000000000101110 01100100 01111001 01101110 01100001 01101101 01101001 0110001110110000 00000100 00000000 00100000 00000001 00000000 00000000 0000000010110000 00000100 00000000 00100000 00000001 00000000 00000000 0000000010100000 00000001 00000000 00000000 00000000 00000000 00000000 0000000010110000 00000100 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00100000 00000000 00000000[...]
![Page 53: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/53.jpg)
52
O Hai, Scratch!Hai1.sb
![Page 54: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/54.jpg)
53
Statements
...
![Page 55: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/55.jpg)
54
StatementsHai{2,3}.sb
![Page 56: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/56.jpg)
55
Boolean Expressions
...
![Page 57: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/57.jpg)
56
Conditions
...
![Page 58: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/58.jpg)
57
ConditionsHai{4,5}.sb
![Page 59: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/59.jpg)
58
Loops
![Page 60: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/60.jpg)
59
LoopsHai{6,7,8}.sb
![Page 61: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/61.jpg)
60
VariablesCount{1,2}.sb
![Page 62: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/62.jpg)
61
Arrays
![Page 63: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/63.jpg)
62
ArraysFruitcraftRPG.sb
![Page 64: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/64.jpg)
63
ThreadsMove1.sb
![Page 65: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/65.jpg)
64
ThreadsMove2.sb
![Page 66: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/66.jpg)
65
ThreadsHai10.sb
![Page 67: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/67.jpg)
66
ThreadsDavid.sb
![Page 68: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/68.jpg)
67
EventsMarco.sb
![Page 69: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/69.jpg)
68
Sensorssinger.sb, Masquerade.sb, davidwu.sb, Electricity.sb
![Page 70: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/70.jpg)
69
OscartimeOscartime.sb
![Page 71: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/71.jpg)
70
OscartimeDisplaying the Instructions
![Page 72: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/72.jpg)
71
OscartimeMaking Trash Fall
![Page 73: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/73.jpg)
72
OscartimeImplementing Dragging
![Page 74: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/74.jpg)
73
OscartimeImposing a Time Limit
![Page 75: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/75.jpg)
74
OscartimeKeeping Score
![Page 76: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/76.jpg)
75
OscartimeRaising Oscar’s Lid
![Page 77: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/77.jpg)
76
int
main(int argc, char * argv[])
{
printf("O hai, world!\n");
}
Scratch Meets C
![Page 78: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/78.jpg)
77
StatementsScratch v. C
printf("O hai, world!\n");
![Page 79: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/79.jpg)
78
(x < y)
((x < y) && (y < z))
Boolean ExpressionsScratch v. C
![Page 80: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/80.jpg)
79
if (x < y)
{printf("x is less than y\n");
}
else if (x > y)
{
printf("x is greater than y\n");
}
else
{printf("x is equal to y\n");
}
ConditionsScratch v. C
![Page 81: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/81.jpg)
80
while (1)
{printf("O hai!\n");
}
for (int i = 0; i < 10; i++)
{printf("O hai!\n");
}
LoopsScratch v. C
![Page 82: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/82.jpg)
81
int counter = 0;
while (1){
printf("%d\n", counter);
counter++;
}
VariablesScratch v. C
![Page 83: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/83.jpg)
82
char *inventory[SIZE];
inventory[i] = "Orange";
ArraysScratch v. C
![Page 84: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/84.jpg)
83
Problem Set 0
![Page 85: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/85.jpg)
84
Problem Set 0HACKER EDITION
![Page 86: Week 0 - CS50cdn.cs50.net/2008/fall/lectures/0/week0.pdf · 2012-08-22 · 0 Computer Science 50 Introduction to Computer Science I Harvard College David J. Malan malan@post.harvard.edu](https://reader033.vdocuments.mx/reader033/viewer/2022060406/5f0f84da7e708231d4449077/html5/thumbnails/86.jpg)
85
Computer Science 50Introduction to Computer Science I
Harvard College
David J. [email protected]
Week 0