It’s Around Here Somewhere¶
In this lab, you will implement several custom blocks performing variants of sequential search.
Part 1: You There¶
Write your own version of the Snap!
contains
block, which takes a list and a value as arguments. Then reports true if the value is in the list and reports false otherwise. You should NOT use the existingcontains
block in your implementation.
Part 2: Where¶
Write a custom block called “index of” that takes a list and a value as arguments and reports the index of the value found in the list. If the value is not in the list, report -1.
Part 3: Tell Me More¶
Write a custom block called “first e-word” that takes a list as an argument and reports the first word in the list that starts with the letter ‘e’. If no such word exists, report a blank (nothing).
BONUS: Write a custom block called “first word that starts with” that takes a list and a letter as arguments, and reports the first word in the list that starts with the given letter. If no such word exists, report a blank (nothing).
Grading Scheme/Rubric¶
Lab 4.5 Criteria |
Points |
---|---|
1.1 contains block |
0.5 |
2.1 index of block |
0.5 |
3.1 first e-word block |
1.0 |
3.2 BONUS: first word that starts with block |
0.5 |
PROJECT TOTAL |
2.0 |