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
Explain about the MINI COMPUTER Minicomputers are much smaller in size than mainframe computers and they are also less expensive.  The cost of these computers can differ from a

What do you mean by complexity of an algorithm? The term complexity is used to define the performance of an algorithm. Typically performance is calculated in terms of time or s

Receive a message. tid is integer task identifier of transmitting process supplied by user and msgtag is message tag supplied by user( must be non negative integer). The process re

Public Key Infrastructure solutions The use of public-key based security systems requires great attention and due care in design and management of security features. The secur

Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes? No. The Minimal spanning tree makes sure that the total weight of the tree i

Logic manufactures have produced 'large scale' logic (LSI) blocks to achieve complex functions; a typical set of logic functions is that of data storage. There are two main types o

Q. Show the liability of CPU in interrupt cycle? In the interrupt cycle the liability of CPU/Processor is to ensure whether any interrupts have happened checking presence of in

Q. Convert the following into SOP form   1. (A+B) (B'+C) (A'+ C) 2. (A+C) (AB'+AC) (A'C'+B) 3. (A'+B') (C'+B)   Q.Convert the following into POS form   1. WYZ + XYZ + W'X'

Hyper-threading officially known as Hyper-threading Technology (HTT) is Intel's trademark for their functioning of simultaneous multithreading technology on Pentium 4 micro-archite

Purpose: Front line client service. Make bookings for vehicle servicing, accesses client database, prints invoices for clients etc. The mechanics complete worksheets for the variou