tutorial02 - CS 135 Winter 2012 Tutorial the Second CS 135...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 135 - Winter 2012 Tutorial the Second January 18, 2012 CS 135 Winter 2012 02: Tutorial the Second 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Clicker Question - Stepping Go to this URL https://www.student.cs.uwaterloo.ca/ cs135/stepping and complete Practice Problem 3. How many arrows = (how many steps) are on the completed page? A 4 B 5 C 6 D 7 E 8 CS 135 Winter 2012 02: Tutorial the Second 2
Image of page 2
Posn structures constructor function make-posn , with contract ;; make-posn: Num Num Posn selector functions posn-x and posn-y , with contracts ;; posn-x: Posn Num ;; posn-y: Posn Num CS 135 Winter 2012 02: Tutorial the Second 3
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example: ( define mypoint ( make-posn 8 1 )) ( posn-x mypoint ) 8 ( posn-y mypoint ) 1 Possible uses: coordinates of a point on a two-dimensional plane positions on a screen or in a window a geographical position CS 135 Winter 2012 02: Tutorial the Second 4
Image of page 4
Group Problem - my-equal? Write a predicate: my-equal?: ( union Symbol Num Posn ) ( union Symbol Num Posn ) Boolean that produces true if the two arguments are equal and otherwise false . You
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern