lnf.cymru stimulus sheet · Computer Science · Year 7
Please do not write on this sheet so another pair can use it next lesson.
Computers store pictures in two main ways:
(x, y) and geometry commands. When you enlarge a vector graphic, the computer recalculates the coordinates and redraws crisp, smooth lines at any size.Our two vector commands today:
• MOVE_TO (x, y) lifts the pen and moves to horizontal position x, vertical position y.
• LINE_TO (x, y) draws a straight line from the current point to (x, y).
The castle tower badge is meant to be symmetrical about the vertical mirror line x = 8, with three flat battlements along the top at height y = 10 and two rectangular gaps dipping down to height y = 8. However, Commands 4, 6 and 10 contain coordinate bugs (shown as the dashed red lines on the diagram):
| Vector command file (with 3 bugs in bold) | What the buggy file draws vs the intended shape |
|---|---|
|
1. MOVE_TO (3, 2) [bottom-left corner] 2. LINE_TO (3, 10) [top of left wall] 3. LINE_TO (5, 10) [top of left merlon] 4. LINE_TO (5, 9) [BUG 1: left gap depth] 5. LINE_TO (7, 8) [bottom-right of left gap] 6. LINE_TO (10, 7) [BUG 2: middle merlon] 7. LINE_TO (9, 10) [top-right of middle merlon] 8. LINE_TO (9, 8) [bottom-left of right gap] 9. LINE_TO (11, 8) [bottom-right of right gap] 10. LINE_TO (11, 11) [BUG 3: right merlon] 11. LINE_TO (13, 10) [top of right wall] 12. LINE_TO (13, 2) [bottom-right corner] 13. LINE_TO (3, 2) [base back to start] |
Once the castle tower is fixed, a 5-sided symmetrical shield icon is drawn inside the tower walls around the mirror line x = 8. Read the coordinates of corners A, B, C, D and E from the diagram below: