CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 12: Homework stuff and Accumulating Recursion.

Slides:



Advertisements
Similar presentations
Read the following: oo The zoo is too far from school oo The cook can cook good cookies ow The tree by the window grows slowly ow The cow is eating.
Advertisements

Time Series Analysis – Homework Homework Rules: All homework must be completed by due date Homework may be done in groups – please put names of all group.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 4: Review Conditional & Word Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 17: HOF and Tick-Tack-Toe.
QUESTION 1 What day is it today? A) I’m Tuesday. B) I have Tuesday. C) Tuesday. D) It’s Tuesday.
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. 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 19: HOF Problems.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 6: Mini-Project Prep.
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.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 10: Recursion Rocks Again!
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.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 8: Recursion.
Midterm Logistics Where? 4 Leconte ( When? Monday, 4:10 to 5:40 What to do? –“Review problems”
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 9: Recursion Rocks!
Midterm Logistics Where? 2050 VLSB When? Monday, 4:10 to 5:40 What to do? –“Review problems” from Thursday/Friday in UCWise. –Two practice exams and solutions.
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.
Today: 1. Hand back/review Test Lecture on Section 5. 1, with HW 5
August 13, 2014 Today ◦ Seating Chart ◦ Introductions ◦ Meet me ◦ Name Tags Tomorrow ◦ Finish Name Tags ◦ Appointment Clocks ◦ Syllabus ◦ Names Friday.
Lecturer’s desk INTEGRATED LEARNING CENTER ILC 120 Screen Row A Row B Row C Row D Row E Row F Row G Row.
Date: 11/21/13 Thursday - Day 1 UNIT 3 “The Dynamic Earth” Go over Unit 3 Exam File Labs HOMEWORK: UNIT 4 SQs HW p. 3 due tomorrow!
Welcome! Algebra Two/Trig Honors Sandy Christen
ALGEBRA 2; AGENDA; DAY 93; TUE. JAN. 20, 2015 (3 rd 9-Weeks) ›BEGINNING OF 3 rd 9 WEEK; SEE BELL RINGER › OBJECTIVE: SWBAT: MAFS.912.N-RN.1.2: Rewrite.
CS61A Lecture Colleen Lewis. Clicker Query What else are you doing this summer? A)Taking another class B)Working C)Taking another class and.
BIT 115: Introduction To Programming Instructor: Mike Panitz
Important Dates  Tues June 4 th - TKAM Ch Vocab quiz  Wed/Thur June 5 th & 6 th --- TKAM REVIEW  Fri June 7 th --- TKAM FINAL EXAM  Fri June.
Biology Christmas Homework ALL 1. Complete the following questions showing ALL workings 2. Mark your answers using the SQA mark scheme 3. Calculate a %
BIT 116:JavaScript. BIT 116: Scripting2 Today Ch 9: Object Oriented Programming, Part 1 –Random numbers –Basic OOP stuff Reading quiz turned in?
Quantitative Methods in Geography Geography 391. Introductions and Questions What (and when) was the last math class you had? Have you had statistics.
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
What is the least common denominator for 7, and 3 ? A.36 B.12 C.48 D.3 What is the least common denominator for, and ? A.21 B.16 C.18 D.42 Monday Top half.
11.2 Areas of Triangles, Trapezoids, and Rhombi What you’ll learn: 1.To find areas of triangles 2.To find areas of trapezoids and rhombi.
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
Today’s Agenda is…. Pre-algebra Friday, October 16 (Homework-Skill 5-No Calculators- is due on Friday) 1.Check Homework 2.Quiz to improve grades. 3.Write:
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
CS61A Lecture Colleen Lewis. Clicker Test How often do you read piazza posts? A)Whenever I receive an B)Once or twice a day C)When.
E x i t ?Help ABC Home Quiz Pick It Out ? Closer Look E x i t ?Help Home.
Math 010 Gateway Quiz Information. Gateway Quiz Information: The Gateway Quiz covers material from sections on fractions and the order of operations.
November 10, 2014 What are we doing today? Complete Mini-Project Due: Wednesday Target Develop models to describe the atomic composition of simple molecules.
CS61A Lecture Colleen Lewis. Clicker Test When do you think homework should be due? A)10pm B)11pm C)Midnight D)11am the next day.
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
Week 16 BIO Finals. No First Five Learning Target: Everything!! Today’s Activities: ● Review on your own...Tomorrow Questions! Notecard: ● Front side.
Lesson 87. Read and chant What day is today? Today is What day is today? Today is What day is today? Today is Today is a fun day.
B B C C D D Herald Museum Fri [80] Wed [60] Tue & Thur [40] Visitors to Herald Museum Mon [20]
Present continuous vs. present simple. I USUALLY MOP THE FLOOR AFTER LUNCH.
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
Introduction to the Bar Model Addition and Subtraction
نجاح وفشل المنشآت الصغيرة
No written homework this week due to testing
Calculate 81 ÷ 3 = 27 3 x 3 x 3 3 x 3 x 3 x 3 ÷ 3 = This could be written as
Presentation transcript:

CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 12: Homework stuff and Accumulating Recursion

Today I’m sick. I’m going home after lecture, but I’ll be online Homework Thurs: Bowling (Hwk11) due Monday Fri: Compress/occurs-in? (Hwk12) due Tuesday Mon: Mini-project 2 due Wednesday Testing the Bowling Program Accumulating Recursion Compressed Occurs-in?

Testing Bowling Don’t start programming before you can calculate a bowling score by hand Test with simple cases ‘( ) The last frame is complicated!

Accumulating Recursion (define (gather-evens sent) (cond ((empty? sent) ‘()) ((even? (first sent)) (se (first sent) (gather-evens (bf sent)))) (else (gather-evens (bf sent))))

> (gather-evens '( ))  (se 2 (se 4 (se 6 ‘())))  (2 4 6) ‘() (gather-evens ‘( )) (se 2 (gather-evens ‘( )) (gather-evens‘( )) (se 4 (gather-evens ‘( 5 6 )) (gather-evens ‘( 6 )) (se 6 (gather-evens ‘( ))

(define (gather-evens sent) (cond ((empty? sent) ‘()) ((even? (first sent)) (se (first sent) (gather-evens (bf sent)))) (else (gather-evens (bf sent)))) Accumulating Recursion (define (gather-evens evens-so-far sent) (cond ((empty? sent) evens-so-far) ((even? (first sent)) (gather-evens (se evens-so-far (first sent)) (bf sent))) (else (gather-evens evens-so-far (bf sent))))

Final Version of gather-evens w/ Accumulating Recursion (define (gather-evens evens-so-far sent) (cond ((empty? sent) evens-so-far) ((even? (first sent)) (gather-evens (se evens-so-far (first sent)) (bf sent))) (else (gather-evens evens-so-far (bf sent))))

Homework - Compressed ( ) ( ) ( )

Homework - Occurs-in? (occurs-in? 'abc 'abcde) #t (occurs-in? 'abc 'xyabc) #t (occurs-in? 'ab 'axbc) #f (occurs-in? 'abc 'xy) #f This is not an exhaustive list!!!