i have an n*n page (n is a power of 2) with an empty place in it, and i want to fill in this sqaure with right trominos (a tromino has an 'L' shape)

i want to show the empty spaces with zeros and the ones filled with trominos with ones.
everytime a tromino is placed in the sqaure page, the page must be displayed on teh monitor with the 0s and 1s.

I am really stuck on this.....i'd be very happy for any help
many thanks in advance

10 Years
Discussion Span
Last Post by scream2ice

i've got the algorithm but haven't got started on the c++ program yet..i desperately need help with the cpp code plz

input: n,a power of 2(the board size); and the location L of the missing square
OUtput: A tiling of a deficient n*n board

procedure tile(n,L)

if n=2 then
//the board is a right tromino T
tile with T

divide the board into four (n/2)*(n/2) boards
rotate the board so that the missing square is in tthe upper left quadrant
place one right tromino in the centre
//consider each of the squares covered by the centre tromino as
//missing and donate the missing squares as m1,m2,m3,m4

call tile (n/2,m1)
call tile(n/2,m2)
call tile(n/2,m3)
call tile(n/2,m4)

end tile

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.