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
Q. Define Parameters used in Program Annotation? Parameters: A parameter refines and extends the meaning that assembler attributes to keyword in a statement.  Number of param

An amplifier has an input resistance of 600 ohms and a resistive load of 75 ohms. When it has an rms input voltage of 100 mV, the rms output current is 20mA. Find the gain in dB.

Explain with the help of Nyquist theorem, the data rate limitations in PSTN's. Data rates in PSTNs : A voice channel in a public switched telephone network is band restricted

DATA SEGMENT  NUM1            DB      15h;     First number   NUM2            DB      20h;     Second number  RESULT DB?  ; Put sum here  CARRY DB? ; Put any carry he

Discuss in brief the history of E-Commerce. History of E-commerce illustrated below: E-commerce began before personal computers were prevalent and has grown into a multibill

Computer to computer communication is: (A)  Simplex                                   (B)  Duplex (C)  Half Duplex                             (D)  Both Duplex and Half D

What are the extra variables by which customers call for to work out? All customers who do not purchase Internet connectivity through a Service Provider do call for to work out

Q. Explain Hardwired control organization? In the hardwired organization control unit is designed as a combinational circuit. The control unit is applied by gates, flip-flops,

(a) Explain the following terms: Information System and Information Technology. (b) Describe the main components of a computer. Illustrate your answer by a block diagram. (c)

Define Operation code. The Operation code of an instruction is a group of  bits that explain such operations as add, sub, ,shift, mul and complement.