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
What is data mining? Data Mining: It is an analytic process designed to explore data and after that to validate the findings through applying the detected patterns to lat

What is a digital multiplexer?  Ans: Multiplexer: Data selector or MUX is a logic circuit selects binary information from one of several input and directs this to a sing

Given: • A sequence of n arrival times t0, t1, ..., tn-1, • a library of mlogically equivalent gates {(d0, c0), (d1, c1), ..., (dm-1,cm-1)} where d is delay and c is cost • a

Objectives After going through this unit, you will be able to : Tell historical facts of parallel computing; Can explain the essential concepts of the discipline, e.g.

What is a flip-flop? Ans. Flip-flop is particular bit memory cell. This stores individual bit information in its true and compliment form. It is the basic block of any sequ

An expert system also represents knowledge symbolically as sets of symbols that stand for problem concepts. In AI jargon symbol is a string of characters that stands for

#how to write c program for all types of beam reactions

Q. What are the elements of an instruction? As the function of instruction is to communicate to CPU what to do it needs a minimum set of communication such as:  What op

How does CPU know that an interrupt has taken place? There needs to be a line or a register or status word in CPU which can be increased on occurrence of interrupt situation.

What is a decoder? Draw the logic circuit of a 3 line to 8 line decoder and explain its working. Ans. Decoder: it is a combinational logic circuit which converts Binary words