Creates a grid-matrix of cells, Computer Engineering

1. Write the function makegrid. This function accepts a width and height and creates a grid/matrix of cells. The width gives the number of columns and the height the number of rows of the grid that should be created.

e.g. >>> makegrid(4,5)

[('cell', (0, 0), ['t', 'b', 'r', 'l']), ('cell', (0, 1),['t', 'b', 'r', 'l']), ('cell', (0, 2), ['t', 'b', 'r', 'l']),

('cell', (0, 3), ['t', 'b', 'r', 'l']), ('cell', (0, 4), ['t','b', 'r', 'l']), ('cell', (1, 0),['t', 'b', 'r', 'l']),

('cell', (1, 1), ['t', 'b', 'r', 'l']), ('cell', (1, 2), ['t','b', 'r', 'l']), ('cell',(1, 3), ['t', 'b', 'r', 'l']),

('cell', (1, 4), ['t', 'b', 'r', 'l']), ('cell', (2, 0), ['t','b', 'r', 'l']), ('cell', (2, 1), ['t', 'b', 'r', 'l']),

('cell', (2, 2), ['t', 'b', 'r', 'l']), ('cell', (2, 3), ['t','b','r', 'l']), ('cell', (2, 4), ['t', 'b', 'r', 'l']),

('cell', (3, 0), ['t', 'b', 'r', 'l']), ('cell', (3, 1),['t','b', 'r', 'l']), ('cell', (3, 2), ['t', 'b', 'r', 'l']),

('cell', (3, 3), ['t', 'b', 'r', 'l']), ('cell',(3, 4), ['t','b', 'r', 'l'])]

Posted Date: 3/4/2013 7:33:40 AM | Location : United States







Related Discussions:- Creates a grid-matrix of cells, Assignment Help, Ask Question on Creates a grid-matrix of cells, Get Answer, Expert's Help, Creates a grid-matrix of cells Discussions

Write discussion on Creates a grid-matrix of cells
Your posts are moderated
Related Questions
Write an HTML program segment that contains hypertext links from one document to another . HTML permits any item to be placed as a hypertext reference. Therefore a single word

Object Orientation and Analysis An Object is anything that exists within the problem domain that can be recognized by data and/or behaviour. An example of an object is a bike.

What do understand by the granularity of a parallel system ? Granularity refers to the quantity of computation complete in parallel relative to the size of the entire program. I

How the system would work in real time -  Sensors in/near road gather data (these can be infra-red/light sensors, pressure sensors, induction loops etc.) -data is generally num

Bus arbitration: In single bus architecture when more than 1 device requests the bus, a controller known as bus arbiter decides who gets the bus; this is known as the bus arbi

Explain Auto increment and Auto decrement mode  The register is incremented or decremented after (or before) its value is used to access memory.  The address stored in the regi

Extranet : Extranet is Extension of an Intranet that makes the latter accessible to outside companies or individuals with or without an intranet. It is also described as a coll

Objects, messages, class, inheritance and polymorphism are the major concepts of object orientation.

What is slack? 'Slack' is the amount of time you have which is measured through while an event ‘really happens' and while it ‘should happen’. The term ‘really happens' can a

What is a structure? A structure is a collection of variables under a single name. These variables can be of different types, and each has a name which is used to select it fro