Reference no: EM132367299
Assignment 1, Part A: Tessellation
Motivation
One of the most basic functions of any IT system is to process a given data set to produce some form of human-readable output. This assignment requires you to produce a visual image by following instructions stored in a list. It tests your abilities to:
• Process lists of data values;
• Produce maintainable, reusable code;
• Design a solution to a repetitive computational problem; and
• Display information in a visual form.
In particular, you will need to think carefully about how to design reusable code segments, via well-planned function definitions and the use of repetition, to make the resulting program concise and easy to understand and maintain.
Goal
Completely filling a plane with tiles of different shapes is a computational challenge that goes back to ancient times. Formally this process is called “tessellation”. In this assignment you will solve this challenge by drawing “tiles” (rectangular images) in a grid using automatically-generated solutions.
To do so you must follow a set of instructions, provided as a Python list, to place differently-sized tiles in various locations in the grid. When this is done properly the grid will be entirely filled with non-overlapping tiles. Most importantly, the pattern to be followed is generated randomly, so your solution must be sufficiently general that it can work correctly for any possible pattern of tiles that fills the grid.
Resources provided
A template Python 3 program, tessellation.py, is provided with these instructions.
When run it creates a drawing canvas and displays a simple grid image on which you will draw tiles of specific shapes in specific locations. You have a free choice in the design of the individual tiles, but they must all be related by a common theme. The default image drawn by running the provided Python template appears as shown overleaf. It consists of a numbered grid representing the plane to be tiled, with space on either side for a legend in which you will describe the theme and tokens you have designed.
Assignment 1, Part B: Broken Tiles
Motivation
One of the most common tasks in “Building IT Systems” is modifying some existing code. In practice, computer programs are written only once but are subsequently modified and extended many times during their operational lifetime. Code changes may be required in response to internal factors, such as the need to correct design flaws or coding errors, or external factors, such as changes in consumer requirements.
A common situation is where some new feature must be added to an existing program. This is the scenario simulated in this part of the assignment. This task requires you to extend your solution to Part A of the assignment by adding an additional feature. It tests:
• Your ability to work under time pressure; and
• The quality and clarity of your code for Part A, because a well-written solution to
Part A will make completing this part of the assignment easy.
Goal
In Part A of this assignment you were required to develop a program which could follow instructions, encoded as a randomly-generated Python list, to draw a pattern of differentlyshaped tiles that precisely filled a rectangular area. However, one of the frustrations of “tessellation” using real ceramic tiles is that they can become cracked or broken, spoiling the pattern. In this part of the assignment you will simulate this annoying, but realistic, situation.
Specifically:
• For each of your four different types of tiles you must develop a “broken” version; and
• You must draw a broken tile for any instruction in the pattern that ends with an ‘X’.
To complete this additional task you must extend your solution to Part A. No additional Python template file is supplied for this part. As per Part A, your Part B solution must work for any randomly-generated pattern that can be returned by the provided function random_pattern.
Attachment:- Assignment Tessellation.rar