Skip to content

mixxor/Crossword

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crossword

Php crossword generator

Column base crossword

$words = ['hello', 'on', 'hi'];

$crossword = new \Crossword\Crossword(2, 5, $words);
$isGenerated = $crossword->generate(\Crossword\Generate\Generate::TYPE_BASE_LINE_COLUMN);

print_r($crossword->toArray());

// [
//   ['h', 'i'],
//   ['e', ' '],
//   ['l', ' '],
//   ['l', ' '],
//   ['o', 'n'],
// ]

Row base crossword

$words = ['hello', 'on', 'hi'];

$crossword = new \Crossword\Crossword(5, 2, $words);
$isGenerated = $crossword->generate(\Crossword\Generate\Generate::TYPE_BASE_LINE_ROW);

print_r($crossword->toArray());

// [
//   ['h', 'e', 'l', 'l', 'o'],
//   ['i', ' ', ' ', ' ', 'n'],
// ]

Random crossword

$words = ['ubuntu', 'bower', 'seed', 'need'];

$crossword = new \Crossword\Crossword(9, 9, $words);
$isGenerated = $crossword->generate(\Crossword\Generate\Generate::TYPE_RANDOM);

print_r($crossword->toArray());

// [
//   [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
//   [' ', ' ', 'u', 'b', 'u', 'n', 't', 'u', ' '],
//   [' ', ' ', ' ', 'o', ' ', 'e', ' ', ' ', ' '],
//   [' ', ' ', ' ', 'w', ' ', 'e', ' ', ' ', ' '],
//   [' ', ' ', 's', 'e', 'e', 'd', ' ', ' ', ' '],
//   [' ', ' ', ' ', 'r', ' ', ' ', ' ', ' ', ' '],
//   [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
//   [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
//   [' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' '],
// ]

About

Php crossword generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%