CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 19: HOF Problems.

Slides:



Advertisements
Similar presentations
Advance with English 牛津高中英语 (模块四 ·高一下学期).
Advertisements

How to write an essay? TO PRACTICE IN WRITING AN ESSAY FOR THE ENGLISH STATE EXAMS The aim of the lesson:
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 4: Review Conditional & Word Stuff.
School Life Dialogues Listen, read,and act out with your partner: A: I lost my new pen. B: Where did you lose it? A: I don't know. B: When did you lose.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 17: HOF and Tick-Tack-Toe.
CS3 Fall 2005 Lecture 11: Finish higher order functions Midterm Prep.
Slide 1 CS3: Lecture 8 Advanced recursion. Slide 2 Schedule Oct 10Advanced recursion Oct 17Number-spelling Miniproject Oct 24Higher order procedures Oct.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 18: HOF.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 26: Printing and Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 14: Number Spelling Mini-project.
Slide 1 CS3 Week 8: Recursion. Slide 2 Midterm 1 You did great If you need a re- grade, see the person that graded that question Solutions are available.
Slide 1. Slide 2 Administrivia Mid-semester survey this week (Thur/Fri) –you NEED to do this. Interviews should be starting in a few weeks. I apologize.
CS3 Fall 2005 Lecture 10: More on higher order functions.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 12: Homework stuff and Accumulating Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 6: Mini-Project Prep.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 4: "Difference Between Dates" and data abstraction.
Slide 1 Midterm 1 Midterm 1: Feb 28 th (next week). –In the lecture slot, plus 20 minutes (4:10-5:30 pm, 120 Latimer) –Everything we’ve covered, including.
Slide 1. Slide 2 Midterm 1 You did great If you need a regrade, see the person that graded that question Solutions available on the portal soon.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 10: Recursion Rocks Again!
BA271 Week 9 Lecture Using forms in Access. Status Report … Review where we are … –Midterm – Graded! –Final websites – Graded! –Access #1 – Graded! –Access.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 13: Bugs and Two Stage Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 20: Tree Recursion.
Administrivia Make sure you have completed the Mid Semester Survey –Scheduled the week before Spring Break –this will be worth some points Reading is.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 1: Introduction & Administration.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 11: Accumulating Recursion.
Feb 28More complicated recursions March 7Tree recursion, etc. Number-spelling Miniproject (#2) March 14Higher order procedures March 21Spring Break March.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 2: Introduction, and Conditionals.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 8: Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 9: Recursion Rocks!
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 2: Review – Writing Procedures.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 16: Let and Lambda.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 25: Trees and Generalized Lists.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 27: Review – most children and truth about cons.
Slide 1 CS3 Fall 2005 Lecture 9: Higher Order Functions.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 7: Review.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 15: Procedures as Arguments.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 5: Difference Between Dates Case Study.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 24: Review for lists, map and member.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 3: Conditional Expressions.
Lecture 29 CSE 331 Nov 11, To be strictly enforced For the rest of the semester on Fridays SUBMIT your HOMEWORKS by 1:10 PM.
Lesson 3-4: Pronouns that Ask Questions. Interrogative Pronouns Who Whom Whose Which What They are used to ask a question.
Monday, October 24 th 3 rd & 6 th Please have 2 sharpened pencils, your formula notecards, and your math notebook and folder. NO new Math Minutes this.
 In My Homework, please write:  Spelling Quiz Unit 2 on Friday  Ex. 26, p. 324  Have ex. 21 out on your desk.
Geometry 13.5 The Midpoint Formula. The Midpoint Formula The midpoint of the segment that joins points (x 1,y 1 ) and (x 2,y 2 ) is the point (-4,2) (6,8)
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ Click the letter for a super secret to success…. Then click the school bus to return home.
HS Announcements: Thursday, Dec. 6 th High School 1.The Guidance Office will host its annual Senior Financial Aid Night tonight - Thursday, December 6.
1. 去旅行 ______________ 2. 想起 ______________ 3. (在 ) 不做某事(的情况下) ____________ 4. 一个令人吃惊的聚会 __________________ 5. 将 …… 带到 …… ________________ 6. 收到某人的信 ________________.
Today we will solve equations with two variables. Solve = figure out.
Converting Simple Decimals to Fractions and Vice Versa.
10/30/14 BR- What are values? Today: Understanding Our Community Values (finish collaboration with 1 st period)
Welcome! EWRT1A Composition and Reading. Agenda Reading Journals Outlines Workshops.
ENGLISH CLASS TODAY IS MONDAY APRIL 7TH OF 2014 DAYS OF THE WEEK MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY YESTERDAY WAS.
CSE373: Data Structures & Algorithms Lecture 9: Disjoint Sets and the Union-Find ADT Lauren Milne Summer 2015.
1.3 Segments and Measure The segment postulate Distance Formula.
Personal Choice Reading Get out your Personal Choice Reading (PCR) book and start in. We’ll have minutes to read today. Get out your Personal Choice.
ANNOUNCEMENTS ANNOUNCEMENTS FRIDAY, NOVEMBER 13, 2015 TODAY IS AN “A” DAY.
Adapted from
Good Morning! Today is __________________. Not all friends are people. __________ is my friend. ____________ is also my friend. The best friend I have.
CS61A Lecture Colleen Lewis. Clicker Test Are you coming to the potluck on Thursday on the 4 th floor of Soda from 6:30pm-9:00? A)Yes B)Maybe.
Days of the week and my activities. Oscar Sada ESL 1 Mrs. Echeverry
Homework: Homework is being sent home today! Please be sure your student completes all of their homework. Also, students are bringing home their Home/School.
Today we will solve equations with two variables. Solve = figure out.
I hope you will enjoy….
نجاح وفشل المنشآت الصغيرة
Welcome to CS61BL Grab lecture notes when you come in
Reading: ‘Washington, DC’
Kindergarten News August 29, 2014 Mrs. Musial’s Class
August- Mrs. Hatjakes Birthdays: Reminders:
What’s Happening in kindergarten?
February 4th – February 8th, 2019
Presentation transcript:

CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 19: HOF Problems

Announcements Midterm two Tuesday July 29 th This one will probably be harder than the first Colleen will be out of town Thurs-Monday Homework Miniproject 3 started yesterday! Due Friday July 25 th at 11:59 pm Today is Gilbert’s 7,000 th day! And we’re having a surprise party for him!

Today Problem: Successive-concatenations Which HOFs should I use? Work on the mini-project Let me know if you don’t have a partner and want one

Successive Concatenations (sc '(a b c d e))  (a ab abc abcd abcde) (sc '(the big red barn))  (the thebig thebigred thebigredbarn) (define (sc sent) (accumulate (lambda ?? ) sent))

‘big  ‘(big bigred bigredbarn) ‘the  ‘(the thebig thebigred thebigredbarn) Successive Concatenations (accumulate (lambda () …) ‘(the big red barn) ‘red ‘barn  ‘(red redbarn)

Successive Concatenations (accumulate (lambda () …) ‘(the big red barn) (lambda (new-wd so-far) (every (lambda (wd) (word new-wd wd)) (se “” so-far))) (proc ‘big ‘(red redbarn))  ‘(big bigred bigredbarn)

(sc '(a b c d e))  (a ab abc abcd abcde) (sc '(the big red barn))  (the thebig thebigred thebigredbarn) (define (sc sent) (accumulate (lambda (new-wd so-far) (every (lambda (wd) (word new-wd wd)) (se “” so-far)) sent)) Successive Concatenations

accumulate ( accumulate procedure sent ) procedure a procedure that takes in two arguments a procedure that combines things together sent a sentence with 1 or more words a word with 1 or more letters

every ( every procedure sent ) procedure a procedure that takes in one argument a procedure that returns a word or a sentence sent a sentence with 0 or more words a word with 0 or more letters

keep ( keep procedure sent ) procedure a procedure that takes in one argument a procedure that returns #t or #f sent a sentence with 0 or more words a word with 0 or more letters

Which HOFs would you use? Capitalize-proper-names (c-p-n '(mr. smith goes to washington))  (mr. Smith goes to Washington) Every Keep Accumulate

Which HOFs would you use? Longest Word (longest-word '(have a great week))  great Every Keep Accumulate

Which HOFs would you use? Count-if odd? (count-if odd? '( ))  3 (count-if odd? '( ))  2 Every Keep Accumulate

Which HOFs would you use? Count-vowels-in-each (c-v-i-e '(good luck on tuesday))  ( ) Every Keep Accumulate

Which HOFs would you use? Squares-greater-than-100 (s-g-t-100 '( ))  ( ) Every Keep Accumulate