1. Russian Dolls
A friend of yours was reading an online coding quiz. He is asking for your help in order to solve the following problem.
We are trying to represent russian dolls Matryoshka dolls to be precise. There are many dolls of increasing size. The smallest doll is made of solid wood, all other dolls are hollow in the middle and you can open them. Each size of doll can fit the previous size of doll inside of it.
We are providing you with he following incomplete data definition
(define DOLL 'doll) ;; the smallest sized doll that is not hollow
(define-struct nested-doll (inner))
;; A RussianDoll is one of
;; - 'doll
;; - (make-nested-doll RussianDoll)
;; A NestedDoll is a (make-nested-doll RussianDoll)
;; INTERP: represents a one level nesting of a russian doll
2. List of Strings
You have another friend who actually attended class on Tuesday but spent the entire time on Facebook looking at their crush’s profile pictures from 2010. They need help with Lists of Strings.
3. List of Posns
The team you are a part of is working on designing a game. In this game, little missiles move across the screen from left to right. You are in charge of keeping track of these missiles and their locations. You decide the best way to do this is to use a List of Posns. You are given the following incomplete data definitions from a previous team member who decided they had enough of Dr.Racket to pursue their passion of ceramics.
;; A Posn is a (make-posn NonNegInteger NonNegInteger)
;; INTERP: represents a cartesian coordinate with an x and y coordinate
;;; Template
;; posn-fn: Posn -> ???
#; ???
;; A List of Posns (LoP) is one of
;; - empty
;; - ???
;;; Template
;; lop-fn: LoP -> ???
#;???
Your team has now given you the width and height of the scene of the game (500 x 500). During the game, the missiles that exit the screen should be removed from the List of Posns.