Problems numbered P1, P2... are practice problems. Problems numbered NV1, NV2... are problems from the edX numbered videos.
Problems that have an autograder are marked in the first column.
Easy
Medium
Hard
Problem Number | Difficulty | Requires lectures | Name and files |
---|---|---|---|
BSL P1 | ![]() | exprs | More Arithmetic Expression Write more arithmetic expressions. more-arithmetic-expression-starter.rkt |
BSL P2 Has Grader | ![]() | eval | Primitive Evaluation Write out the step-by-step evaluation of expressions involving calls to primitives. primitive-evaluation-starter.rkt |
BSL P3 | ![]() | strs-imgs | Tile Create an image using image composition primitives. |
BSL P4 | ![]() | strs-imgs | Glue Write an expression to combine strings together. |
BSL P5 | ![]() | bools-if-exprs | Compare Images Write expressions to operate on booleans using primitives. |
BSL P6 Has Grader | ![]() | stepper | Function Call Evaluation Step by step evaluation of expressions involving calls to programmer defined functions. function-call-evaluation-starter.rkt |
BSL P8 | ![]() | strs-imgs | Canadian Flag Background Write expression to produce background image of Canadian flag. |
BSL P9 | ![]() | exprs | Even More Arithmetic Expression Write even more arithmetic expressions. even-more-arithmetic-expression-starter.rkt |
BSL P10 | ![]() | strs-imgs | Triangles Write an expression that operates on images using image primitives. |
BSL P12 | ![]() | strs-imgs | Debug Expression Fix the error(s) in a call to an image primitive. |
BSL P13 | ![]() | exprs | Arithmetic Expression Write an arithmetic expression. arithmetic-expression-starter.rkt |
BSL P14 | ![]() | strs-imgs | Overlay Write an expression that operates on images using image primitives. |
BSL P15 | ![]() | fun-def | Function Writing Write a function that produces the larger of two given numbers. |
HtDF NV1 | ![]() | yell | Yell Design a function to yell! |
HtDF NV2 | ![]() | area | Area Design a function to calculate the area of a square. |
HtDF NV3 | ![]() | img-area | Image Area Design a function to calculate the area of an image. |
HtDF NV4 | ![]() | tall | Tall Design a function to determine if an image is tall. |
HtDF P1 | ![]() | full | Summon Design a function to summon items. |
HtDF P2 | ![]() | full | Less Than 5 Design a function to check if length of a string is less than 5. |
HtDF P3 | ![]() | full | Boxify Design a function to put a box around a given image. |
HtDF P4 | ![]() | full | Pluralize Stub Write a stub for a function given its signature and purpose. |
HtDF P5 | ![]() | full | Blue Triangle Design a function to produce a blue solid triangle of a given size. |
HtDF P6 | ![]() | full | Double Error Fix the error(s) in a function that doubles a given number. |
HtDF P7 | ![]() | full | Make Box Design a function to create a square based on the given colour. |
HtDF P8 | ![]() | full | Ensure Question Design a function to produce a question by adding ? to the end of a given string. |
HtDF P9 | ![]() | full | Cartesian Design a function to calculate the distance between two points. |
HtDD NV1 | ![]() | atomic | City name Design a data definition for all the citys in the world. |
HtDD NV2 | ![]() | atomic-htdf | Best Given the data definition for City, design a function that checks if a given city is the best city in the world. |
HtDD NV3 | ![]() | interv | Seat number Design a data definition for seat numbers in a theatre. |
HtDD NV4 | ![]() | enum | Letter grade Design a data definition to represent a student"s grade. |
HtDD NV5 | ![]() | itemz | Countdown Design a data definition to represent the current state of a New Year"s Eve countdown. |
HtDD NV6 | ![]() | interv-htdf | Aisle Given the data definition for SeatNum, design a function that determines if the seat number is on the aisle. |
HtDD NV7 | ![]() | enum-htdf | Bump up Given the data definition for LetterGrade, design a function that produces the next highest grade. |
HtDD NV8 | ![]() | itemz-htdf | Countdown to display Given the data definition for Countdown, design a function that produces an image of the current state. countdown-to-display-starter.rkt |
HtDD P1 | ![]() | interv-htdf | Employees Design a data definition and a function for a program to track a ski lodge"s payroll. |
HtDD P2 | ![]() | enum-htdf | Demolish Design a data definition and a function for a program to classify buildings in downtown Vancouver. |
HtDD P3 | ![]() | itemz-htdf | Rocket Design a data definition and a function for a program to track a rocket"s return to Earth. |
HtDD P4 | ![]() | enum | LetterGrade Error Fix error(s) in the revised data definition for LetterGrade. letter-grade-error-starter.rkt |
HtDD P5 | ![]() | interv | Style Rules Discuss the importance of following style rules and fix a given data definition to follow them. |
HtDD P7 | ![]() | itemz-htdf | Rocket Error Fix the error(s) in a function we have developed for the Rocket program. |
HtDD P8 | ![]() | enum-htdf | Direction Design a function based on a given data definition for compass directions. |
HtDD P9 | ![]() | enum-htdf | Dinner Design a data definition to represent airline dinners, and a function to let flight attendants know a passenger"s choice. |
HtDW NV1 | ![]() | da, main, wish-list | Cat A cat that moves across the screen. |
HtDW NV2 | ![]() | add-key | Add mouse-handler to cat Given an existing world program, add a mouse handler to reset the position of the moving cat. |
HtDW P1 | ![]() | da, main, wish-list | Countdown Animation Design an animation of a countdown. countdown-animation-starter.rkt |
HtDW P2 | ![]() | da, main, wish-list | Traffic Light Animation Design an animation of a traffic light. |
Compound NV3 | ![]() | htdw | Cowabunga A cow that wanders back and forth across the screen. cowabunga-starter.rkt |
Compound P1 | ![]() | dd | Movie Design a compound data definition to represent movies, and a function to compare their release dates. |
Compound P2 | ![]() | htdw | Spinning Design a world to represent a growing and rotating red box. |
Compound P3 | ![]() | dd | Student Design a compound data definition to represent students, and a function to monitor their allergies. |
Compound P4 | ![]() | dd | Trip Design a compound data definition to represent trips, and a function to compare their lengths. |
Compound P5 | ![]() | htdw | Growing Grass Design a world to represent grass that grows and is replanted. |
Compound P6 | ![]() | htdw | Mouse Tracker Design a world where the mouse position is displayed at the mouse cursor. |
Compound P7 | ![]() | htdw | Rolling Lambda Design a world where a lambda rolls back and forth across the screen. |
Compound P8 Has Grader | ![]() | dd | Compound Evaluation Starter Step by step evaluation of code involving compound data. compound-evaluation-starter.rkt |
Compound P9 | ![]() | htdw | Water Balloon Design an animation of throwing a water balloon. |
Self-Ref P1 | ![]() | list-fun | Total String Length Design a function to calculate the total number of individual characters in a list of strings. total-string-length-starter.rkt |
Self-Ref P2 | ![]() | des-w-list | Double All Design a function to double every number in a list. |
Self-Ref P3 | ![]() | des-w-list | Boolean List Design a data definition to represent a list of booleans, and a function to determine if all values in a given list are true. |
Self-Ref P4 | ![]() | list-fun | Yell All Design a function to add "!" to each string in a list of strings. |
Self-Ref P5 | ![]() | des-w-list | Largest Design a function to find the largest number in a list of numbers. |
Self-Ref P6 | ![]() | des-w-list | Image List Design a data definition to represent a list of images, and a function to find the sum of areas from a list of images. |
Ref NV1 | ![]() | part-1-2-3 | Tuition A tuition graphing program and intermediate solutions. tuition-graph-starter.rkt |
Ref P1 | ![]() | part-3 | Alternative Tuition Graph Design the tuition graph bar chart function based on an alternative data definition for School. alternative-tuition-graph-starter.rkt |
Ref P2 | ![]() | part-3 | Spinning Bears Design a world program that has an arbitrary number of spinning bears. |
Ref P3 | ![]() | part-3 | Tuition Graph Design a function to find the lowest tuition, and a function to produce a list of school names. |
Naturals NV1 | ![]() | nat nums | Naturals Design functions that operate on the Natural data definition. |
Naturals NV2 | ![]() | parlor | New numerals Design functions that does arithmetic operations on the NATURAL data definition. |
Naturals P1 | ![]() | nat nums | Sum to n Design a function that computes the sum of all natural numbers from zero to n. |
Naturals P2 | ![]() | nat nums | Decreasing Image Design a function that produces an image of the numbers from n to zero, side by side. |
Naturals P3 | ![]() | nat nums | Odd from n Design a function that produces a list of all the odd numbers from n to zero. |
Naturals P4 | ![]() | nat nums | Concentric Circles Design a function that produces an image of n concentric circles of a given colour. concentric-circles-starter.rkt |
Helpers NV1 | ![]() | all | Arrange Images Creating a program to sort a list of images and lay them out next to each other, as demonstrated in lecture, with all intermediate solutions. arrange-images-starter.rkt |
Helpers P1 | ![]() | all | Render Roster Design a program to render a dodgeball game roster. |
Helpers P2 | ![]() | all | Making Rain Filtered Design a world program to make it rain where you want it to. In this version of the program you should remove drops that have already fallen off the screen from the world state. Be sure to use all appropriate helper function rules. There are a total of 9 functions in our solution, so this problem takes some time. making-rain-filtered-starter.rkt |
BSTs NV1 | ![]() | loa | Lookup in List Creating a program to find an account in a list of account given its account number. |
BSTs NV2 | ![]() | dd | BST Data Definition Creating a data definition for a Binary Search Tree. |
BSTs NV3 | ![]() | lookup | Lookup in BST Creating a function that searches through a BST. |
BSTs NV4 | ![]() | render | Render BST Creating a function that renders a BST |
BSTs P1 | ![]() | lookup | Count Nodes Design a function to count the number of nodes in a BST. |
BSTs P2 | ![]() | lookup | Sum Keys Design a function that sums the keys in a BST. |
BSTs P3 | ![]() | lookup | Height Design a function to determine the height of a BST. |
BSTs P4 | ![]() | lookup | Insert Design a function that inserts a node in the proper place in a BST. |
BSTs P5 | ![]() | lookup | Balance Factor Design functions to determine whether a BST is balanced. |
BSTs P6 | ![]() | render | Render BST with Lines Design a function that renders a BST with lines. render-bst-w-lines-starter.rkt |
Mutual-Ref P1 | ![]() | fun-part-2 | Image Organizer Several function design problems for arbitrary-arity trees. |
Mutual-Ref P2 | ![]() | fun-part-2 | Find Person Design a function to find a person in a person tree. |
Mutual-Ref P3 | ![]() | fun-part-2 | Harry Potter Family Tree Represent information about descendant family trees from Harry Potter and design functions that operate on them. |
2-One-Of P1 Has Grader | ![]() | code | Concat Design a function that concatenates two lists. |
2-One-Of P2 Has Grader | ![]() | code | Merge Design a function that merges two sorted lists into a single sorted list. |
2-One-Of P3 Has Grader | ![]() | code | Zip Design a function that produces a list of the corresponding elements of the given two lists. |
2-One-Of P4 Has Grader | ![]() | code | Pattern Match Design a function that determines if a sequence of characters matches a given pattern. |
Local NV1 | ![]() | all | File System An implementation of a file system, as demonstrated in lecture, with all intermediate solutions. |
Local NV1 | ![]() | encap, recomp | File System 2 Refactoring of file system developed in Mutual-Ref. |
Local P2 | ![]() | avoid-recomp | Faster Render BST with Lines Improve the performance of a function that produces a simple rendering of a bst with lines. render-bst-w-lines-faster-starter.rkt |
Local P3 Has Grader | ![]() | eval | Evaluate local Step by step evaluation of code including local expressions. |
Local P4 Has Grader | ![]() | eval | Evaluate local 2 Evaluation of code including local expressions. |
Local P5 Has Grader | ![]() | eval | Evaluate local 3 Evaluation of code including local expressions. |
Local P6 | ![]() | encap | Encapsulate total area Encapsulate the total-area function into local. encapsulate-total-area-starter.rkt |
Abstraction NV1 | ![]() | from-ex | Parameterization Introduction to abstracting functions, as demonstrated in lecture, with intermediate solutions. parameterization-starter.rkt |
Abstraction NV2 | ![]() | built-in | Using built ins Design functions that use built-in abstract list functions. |
Abstraction NV3 | ![]() | closures | Closures Design functions that use built-in abstract list functions with closure. |
Abstraction P1 | ![]() | built-in | Wide only Design a function to produce only wide images from a list of images. |
Abstraction P2 | ![]() | built-in | Photos Design a function to produce all the favourited photos in the given album. |
Abstraction P3 | ![]() | from-ex-3 | Abstract sum Design an abstract function to simplify the sum-of functions. |
Abstraction P4 | ![]() | from-ex-3 | Abstract some Design an abstract function to simplify the some functions. |
Abstraction P5 | ![]() | built-in | Ellipses Write expressions that uses abstract functions to produce a list of ellipses and images of ellipses. |
Abstraction P6 | ![]() | built-in | Bag Design a function to produce the linear lengths of a list of bags. |
Abstraction P7 | ![]() | built-in | Sum n Design a function to produce the sum of the first n odd numbers. |
Abstraction P8 Has Grader | ![]() | built-in | Sum n Design a function to produce the largest of each sublists smallest numbers. |
Abstraction P9 | ![]() | fold | Fold dir Design an abstract fold function for Dir and some functions that uses this abstract function. |
Abstraction P10 Has Grader | ![]() | from-ex-3 | Accounts Design abstract functions to simplify given functions. |
Abstraction P11 | ![]() | built-in | Weather Use built-in abstract functions to design a function that produces the sum total of rainfall on warm days. |
Genrec NV1 | ![]() | fractals | Fractals Design of a few basic fractals, as demonstrated in lecture, with intermediate solutions. |
Genrec NV2 | ![]() | term-arg | Termination Design three part termination argument for generative recursions. |
Genrec P2 | ![]() | term-arg | Van Koch Design a function to draw a Van Koch fractal line. The GEOMETRY of this problem is much more difficult than the triangle and the carpet. If you feel confident with cartesian geometry then this function may not be too difficult. If you feel less confident then you may find this problem to be too difficult. |
Genrec P3 | ![]() | term-arg | Cantor Design a world program to create the cantor set. |
Search NV1 | ![]() | sudoku | Sudoku Design a program that solves a sudoku board, as demonstrated in lecture, with intermediate solutions. sudoku-starter.rkt |
Search P1 | ![]() | sudoku | 2 Way Maze Design a program that tries to find the path through a maze. |
Search P2 | ![]() | sudoku | Triangle Solitaire Design a program that solves triangle solitaire puzzles. triangle-solitaire-starter.rkt |
Search P3 | ![]() | sudoku | N Queens Design a program that solves the n queens problem. nqueens-starter.rkt |
Accumulators P1 | ![]() | context-preserv-acc | Drop N Design a function that drops every nth element from a list. |
Accumulators P2 | ![]() | context-preserv-acc | Replicate Element Design a function that replicates elements in a list. |
Accumulators P3 | ![]() | context-preserv-acc | Strictly Decreasing Design a function that produces true if numbers in a list are strictly decreasing. strictly-decreasing-starter.rkt |
Accumulators P4 Has Grader | ![]() | tail-rec | Average Design a tail-recursive function that produces the average of numbers in a list. |
Accumulators P5 | ![]() | tail-rec | Product Design a tail-recursive version of a function that produces the product of numbers in a list. |
Accumulators P6 | ![]() | tail-rec | Sum N Design a tail-recursive version of a function that produces the sum of naturals in [0, n]. |
Accumulators P7 | ![]() | tail-rec | Sum Odds Design a tail-recursive version of a function that produces the sum of odd numbers in a list. |
Accumulators P8 | ![]() | tail-rec | To list Design a tail-recursive version of a function that produces a list of naturals from 1 to n. |
Accumulators P9 | ![]() | tail-rec | Count Evens and Odds Design a tail-recursive function that produces separate counts of odd and even numbers in a list. |
Accumulators P10 | ![]() | tail-rec | Reverse Design a tail-recursive function that produces a list of the same elements in the opposite order. |
Accumulators P11 | ![]() | worklist-acc | House Path Design functions that operate on house paths. |
Accumulators P12 | ![]() | worklist-acc | Contains Key Design a tail-recursive function that determines whether a binary tree contains a given key. |
Accumulators P13 Has Grader | ![]() | worklist-acc | Arbitrary-Arity Tree TR Design tail-recursive functions that operate on arbitrary arity trees. First file is from a structurally recursive template; second file is from a tail-recursive template. arbitrary-arity-tree-tr-starter.rkt |
Accumulators NV1 | ![]() | context-preserv-acc | Context Preserving Accumulators Problems where an accumulator is needed to preserve information lost in the structural recursion template. skip1-starter.rkt |
Accumulators NV2 | ![]() | tail-rec | Tail Recursion Using accumulators to make functions tail recursive. |
Accumulators NV3 | ![]() | worklist-acc | Worklist Accumulators Making functions operating on an arbitrary-arity tree tail recursive using context preserving and worklist accumulators. same-house-as-parent-v1.rkt |
Graphs P1 | ![]() | graphs-reachable | All Reachable Design a function that produces rooms reachable from a given room. |
Graphs P2 | ![]() | graphs-reachable | Count Rooms Design a function that produces the number of rooms reachable from a given room. |
Graphs P3 | ![]() | graphs-reachable | Find Room Design a function that produces a room with the given name. |
Graphs P4 | ![]() | graphs-reachable | Max Exits From Design a function that produces the room with the most exits. |
Graphs P5 | ![]() | graphs-reachable | Max Exits to Design a function that produces a room to which the greatest number of other rooms have exits. |
Graphs NV1 | ![]() | cyclic-data, templating, reachable | Graphs Walking through the design of a data definition for representing graphs, and a simple function that operates on those graphs. graphs-v1.rkt |
Graphs NV2 | ![]() | cyclic-data, templating, reachable | Graphs Design a tail-recursive function with additional accumulators that operates on a simple graph. |