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

Handshake packets - computer architecture, Handshake packets: Handshak...

Handshake packets: Handshake packets consist of nothing but a PID byte, and are usually sent in response to data packets. The 3 basic types are, NAK, indicating that the data

Explain register addressing mode, Q. Explain Register Addressing Mode? ...

Q. Explain Register Addressing Mode? Operand can be a 16-bit register: Addressing Mode Description Example AX, BX, CX, DX, SI,

Multi-operating systems, The assignment enhances the acquisition of new kno...

The assignment enhances the acquisition of new knowledge through reading, research and practical work in class and at home. It requires critical thinking applied to real life tasks

What are advantages and disadvantages of using eeprom, What are advantages ...

What are advantages and disadvantages of using EEPROM? The benefits are that EEPROM do not have to be removed for erasure. Also it is possible to delete the cell contents selec

What are single stage and multistage networks, What are single stage and mu...

What are single stage and multistage networks? Compare the strengths and weaknesses of each. OR List the major difference in single stage, two stages and three stage Netw

How is an instruction represented, Q. How is an instruction represented? ...

Q. How is an instruction represented? Instruction is signified as a sequence of bits. A layout of an instruction is called as instruction format. Instruction formats are princi

Processor, what is the difference between i5 and i7 processor?

what is the difference between i5 and i7 processor?

Prolog programming language - artificial intelligence, Prolog Programming L...

Prolog Programming Language - Artificial intelligence: Most of the programming languages are procedural: the programmer specifies exactly the correct instructions (algorithms)

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