Creates a grid-matrix of cells, Computer Engineering

Assignment Help:

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'])]


Related Discussions:- Creates a grid-matrix of cells

Program testing and debugging, Program testing and debugging: Program ...

Program testing and debugging: Program testing is the method of checking program, to verify that it satisfies its needs and to detect errors. These errors can be of any type-

Operating system, explain network operating system and design issues?

explain network operating system and design issues?

What is swapping, What is swapping?   A process can be swapped out tempo...

What is swapping?   A process can be swapped out temporarily of memory to a backing store and after that brought back in memory for execution as continued.

Logical representations in artificial intelligence, Logical Representations...

Logical Representations: If every human being spoke the same kind of language, there would be several less misunderstanding in the world. The problem with software engineering

Define parallel programming, Conventionally software has been written for s...

Conventionally software has been written for serial computation in that programs are written for computers which have a single Central Processing Unit (CPU). Here the problems are

Centres of keycaps, A full size keyboard has distance between centres of ke...

A full size keyboard has distance between centres of keycaps (keys) like 19mm (0.75in).The keycaps have a top of nearly 0.5in (12.5in) that is shaped as a sort of dish to help you

Explain the matlab working environment, This is the set of tools and facili...

This is the set of tools and facilities that you work with as the MATLAB user or programmer. It contains facilities for managing the variables in your workspace and importing and e

What is master slave kernel, Q. What is Master slave kernel? Master sl...

Q. What is Master slave kernel? Master slave kernel: In this model just one of processors is assigned as Master.  The master is in charge for subsequent activities:  i)

Need of cisc cpu - computer architecture, Need of CISC CPU -  computer arc...

Need of CISC CPU -  computer architecture: Why is Intel spending money and time to manufacture the Pentium II and the Pentium III? The answer of this question is simple, ba

Explain i/o buffer and advantage of buffering, What is an I/O buffer? What ...

What is an I/O buffer? What is the advantage of buffering? Is buffering always effective? Justify your answer with help of an example.   One type of I/O requirement arises from

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd