a pseudo-code for drawing a 4x4 tic-tac-toe board with “X” or “O” text centered in some…
Jump to turn (34)
- 1a pseudo-code for drawing a 4x4 tic-tac-toe board with “X” or “O” text centered
- 2and?
- 3and?
- 4and?
- 5and?
- 6and?
- 7and?
- 8and?
- 9and?
- 10and?
- 11and?
- 12&?
- 13&?
- 14&?
- 15&?
- 16&?
- 17and?
- 18and? &?
- 19conversation? where?
- 20conversation? where?
- 21conversation? where?
- 22conversation? where?
- 23conversation? where? and? &?
- 24conversation? where? and? &?
- 25conversation? where? and? &?
- 26conversation? where? and? &?
- 27conversation? where? and? &?
- 28conversation? where? and? &?
- 29conversation? where? and? &?
- 30conversation? where? and? &?
- 31conversation? where? and? &?
- 32conversation? where? and? &?
- 33conversation? where? and? &?
- 34conversation? where? and? &?
- User
a pseudo-code for drawing a 4x4 tic-tac-toe board with “X” or “O” text centered in some cells, using marquee elements:
INITIALIZE an empty 4x4 matrix
FOR each row in the matrix DO FOR each cell in the row DO IF cell is not empty THEN OUTPUT “<marquee behavior=‘alternate’ scrollamount=‘0’ bgcolor=‘#fff’ width=‘32’ height=‘32’ style=‘margin-top:-5px;border:1px solid #000;display:inline-block;text-align:center;vertical-align:top;’>” IF cell contains ‘X’ THEN OUTPUT “X” ELSE IF cell contains ‘O’ THEN OUTPUT “O” END IF OUTPUT “” ELSE OUTPUT “<marquee bgcolor=‘#fff’ width=‘32’ height=‘32’ style=‘margin-top:-5px;border:1px solid #000;display:inline-block;vertical-align:top;’>” END IF END FOR IF row is not the last row THEN OUTPUT “” END IF END FOR
What this pseudo-code does:
- It assumes there’s a matrix representing the state of the tic-tac-toe game, with each cell possibly empty, having an “X”, or having an “O”.