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. Initialize new PVM processes? pvm_spawn( char *task, char **argv, int flag, char *where, int ntask, int *tids ) Initialize new PVM processes. Task a character st

What are the simplest way to restrict the users The simplest way to restrict the users to peek inside the internals of the Web site is to use firewalls, where the information c

An assembler is? Ans. An assembler is Machine dependant.

Explain the violating basic security principles There are drawbacks to permitting users to access the Intranet as well as not permitting them. A simple consideration such as a

How can you display frames (horizontal and vertical lines) in lists? You can show tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the syst

Visualization Visualization is a general method in contract to search based tools.  In this method visual aids are given like pictures to assist the programmer in evaluating th

Define parity bit and List its types. The most common error detection code used is the parity bit. Parity bit is a extra bit contained with a binary message to make the total n

What is the use and function of File Transfer Protocol? FTP : File Transfer Protocol (FTP) is the protocol used upon the Internet for sending files and is usually used fo

Explain advantages and disadvantages of a active document. The advantage of an active document over a dynamic document lies in its capability to update the information contin

In assignment you are required extend the Patient class to implement an  Inpatient  class,  representing a patient who is admitted to the hospital for a longer term and who may req