100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
University of British Columbia CPSC 110 LAB 3 CA$11.58   Add to cart

Exam (elaborations)

University of British Columbia CPSC 110 LAB 3

1 review
 136 views  0 purchase
  • Course
  • Institution

University of British Columbia CPSC 110 LAB 3

Preview 2 out of 5  pages

  • October 15, 2021
  • 5
  • 2021/2022
  • Exam (elaborations)
  • Questions & answers

1  review

review-writer-avatar

By: Peter9 • 2 year ago

avatar-seller
(require spd/tags)

(require 2htdp/image)

(require 2htdp/universe)



(@assignment lab-03)

(@cwl ???)



; Balloon popping



(@htdw Balloon)




m
er as
;; CONSTANTS ==========================




co
eH w
o.
(define WIDTH 500)

(define HEIGHT 500) rs e
ou urc
(define MTS (empty-scene WIDTH HEIGHT))
o
aC s


(define BALLOON-COLOR "red")
vi y re



(define POP-IMAGE

(overlay (text "POP!" 80 "black")
ed d




(radial-star 30 (/ WIDTH 10) (/ WIDTH 2) "solid" "yellow")))
ar stu




(define CTR-X (/ WIDTH 2))
is




(define CTR-Y (/ HEIGHT 2))
Th




(define SPEED 2)
sh




(define MAX-SIZE (/ WIDTH 2))




This study source was downloaded by 100000805705997 from CourseHero.com on 10-14-2021 20:49:22 GMT -05:00


https://www.coursehero.com/file/57633285/Lab-3docx/

, ;; DATA DEFINITIONS ============================



(@problem 1)



(@htdd Balloon)

;; Balloon is one of

;; - false

;; - Number

;; interp. false means balloon has popped, number is the radius of the balloon

;; CONSTRAINT: Number is in [0, MAX-SIZE)




m
er as
co
eH w
(define B1 0) ;smallest balloon




o.
(define B2 125) ;middle balloon

(define B3 250) rs e
;max size of balloon
ou urc
(define B4 false) ;popped balloon
o
aC s


(define (fn-for-balloon b)
vi y re



(cond [(false? b) (...)]

[(number? b) (... b)]))
ed d
ar stu




(@dd-template-rules one-of ;2 cases

atomic-distinct ;false
is




atomic-non-distinct) ;Number
Th
sh




;; FUNCTIONS ====================================

(@problem 2)

(@htdf main)

(@signature Balloon -> Balloon)



This study source was downloaded by 100000805705997 from CourseHero.com on 10-14-2021 20:49:22 GMT -05:00


https://www.coursehero.com/file/57633285/Lab-3docx/

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller solutions. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for CA$11.58. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67866 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
CA$11.58
  • (1)
  Add to cart