Translate Your Circle of Evaluation to Code

1 Code:

Add Examples and Define Your Function

Open My Function Starter File on your computer. Select "File", then "Save a Copy."

2 At the top of the starter file we’ve defined two functions for you to write examples with.

  • What shape will pt make?

  • What shape will yr make?

3 Define a third image value called img to make a shape of your choosing and then click "Run" to load the program with your new definition.

  • What shape will img make?

4 Test out the code you wrote in question 1 in the Interactions Area and hit Enter/return.

  • If you get an error, or if you are not getting the result that you expected, try again until it works and describe one adjustment that you made.

5 Once the code is working how you want it to, it’s time to add it to the EXAMPLES in the definitions area.

  • Type my-function(shape) is and then paste in the code you just entered.

  • Follow the pattern to add examples using pt and yr.

  • Remember to use linebreaks and indentation to make your code easy to read. If you’re not sure how to do that, look at the EXAMPLES in the Functions Study Starter File.

6 After entering your examples, click "Run" to confirm that your tests passed in Pyret, with no error messages. You should see the message, "Looks shipshape, all 3 tests passed, mate!"

7 Define my-function in Pyret. (If you don’t remember how to define a function, you can refer to the Functions Study Starter File.)

Peer Review

Save your program. Then swap papers and computers with your partner so they can view your Pyret file.

8 Write your name on the line so that your teacher knows who is reviewing this function.

9 Did your partner write 3 different and correctly formatted examples?

If yes, write "Exmaples look good to me!". If not, describe what you notice needs to be fixed.

10 When you click "Run", do you see the message, "Looks shipshape, all 3 tests passed, mate!"? If not, work with your partner to find and fix the problem. Describe the issue below or write "No errors!".

Publish and Submit Your Program

11 Save your program. Go to "Publish", and copy the link that appears. Follow your teacher’s instructions for submitting the link.

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.