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 shorts notes on Digital Signature. This method is used to authenticate the sender of a message. For sign a message, the sender encrypts the message by using a key ident

Reset and Submit are special types of input buttons. Submit is used to send data to the server and Reset resets/clears the form.

Before we take a detailed look about software languages, let us consider the role of computers in engineering. Computers are commonly used in the areas of 'Computer Aided Design /

Georg Thimm handles a webpage that lets you search for upcoming or past conferences in a range of AI disciplines.

Illustrate the list of key differences to word processors The following is a list of key differences to word processors: -  Most word processors force users to work on a doc

What is Dynamic Modelling  As you know that computer systems are built from the objects which respond to events. External events arrive at boundary of system; you understan

What are the process states in Unix? As a process implements it changes state according to its circumstances. Unix processes have the following states: Running : The process

In a two stage network there are 512 inlets and outlets, r=s=24. If the probability that a given inlet is active is 0.8, calculate: Blocking probability Given: N =M =512,

Dictator Dim wants to replace counting, in particular, counting the population of his land. To keep an accurate population count, Dictator Dim has instructed his secretary to add o

A Choice is displayed in a compact form that needs you to pull it down to see the list of available choices and only one item may be selected from a choice. A List may be shown in