Class PHP_Crossword_Grid

Description

PHP Crossword Grid

Located in /sources_custom/php-crossword/php_crossword_grid.class.php (line 29)


	
			
Variable Summary
mixed $cells
mixed $cols
mixed $inum
mixed $maxinum
mixed $rows
mixed $totwords
mixed $words
Method Summary
PHP_Crossword_Grid PHP_Crossword_Grid (int $rows, int $cols)
boolean canPlaceWord (string $word, int $x, int $y, int $axis)
int countWords ()
int getCenterPos (int $axis, [string $word = ''])
int getCols ()
object cell &getEndCell ( &$cell, int $axis, object $cell)
string getHTML ([array $params = array()])
int getRandomPos (int $axis, [string $word = NULL])
object word &getRandomWord ()
int getRows ()
object cell &getStartCell ( &$cell, int $axis, object $cell)
void placeWord (string $word, int $x, int $y, int $axis)
void __initCells ()
Variables
mixed $cells = array() (line 33)
mixed $cols (line 32)
mixed $inum = 0 (line 36)
mixed $maxinum = 0 (line 37)
mixed $rows (line 31)
mixed $totwords = 0 (line 38)
mixed $words = array() (line 34)
Methods
Constructor PHP_Crossword_Grid (line 45)

Constructor

PHP_Crossword_Grid PHP_Crossword_Grid (int $rows, int $cols)
  • int $rows
  • int $cols
canPlaceWord (line 161)

Check if it's possible to place the word

boolean canPlaceWord (string $word, int $x, int $y, int $axis)
  • string $word
  • int $x
  • int $y
  • int $axis
countWords (line 68)

Count words in the grid

int countWords ()
getCenterPos (line 224)

Get center position

int getCenterPos (int $axis, [string $word = ''])
  • int $axis
  • string $word
getCols (line 186)

Get number of columns in the grid

int getCols ()
getEndCell (line 273)

Get maximum ending cell on the axis

object cell &getEndCell ( &$cell, int $axis, object $cell)
  • object $cell: crossing cell
  • int $axis
  • &$cell
getHTML (line 313)

Get HTML (for debugging)

  • return: HTML
string getHTML ([array $params = array()])
  • array $params: params
getRandomPos (line 206)

Get random position

int getRandomPos (int $axis, [string $word = NULL])
  • int $axis
  • string $word
getRandomWord (line 78)

Get random word from the grid (not fully crossed)

  • return: object
object word &getRandomWord ()
getRows (line 195)

Get number of rows in the grid

int getRows ()
getStartCell (line 238)

Get minimum starting cell on the axis

object cell &getStartCell ( &$cell, int $axis, object $cell)
  • object $cell: crossing cell
  • int $axis
  • &$cell
placeWord (line 103)

Place word

void placeWord (string $word, int $x, int $y, int $axis)
  • string $word
  • int $x
  • int $y
  • int $axis
__initCells (line 57)

Initialize cells (create celll objects)

  • private:
void __initCells ()

Documentation generated on Sun, 02 Jan 2011 23:22:13 +0000 by phpDocumentor 1.4.3