Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Richard Munroe  >  Sudoku  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example of using Sudoku classes.
Class: Sudoku
Generate and solve sudoku puzzles
Author: By
Last change:
Date: 2005-11-03 08:18
Size: 673 bytes
 

Contents

Class file image Download
<?php

include_once("class.Sudoku.php") ;

/**
 * Generate a new puzzle.
 * 
 * During puzzle generation, show the steps taken by the puzzle generator.
 * Then initialize a new Sudoku from the solution provided and print
 * the initial position and the solution.
 * 
 * @author Dick Munroe <munroe@csworks.com>
 * @copyright copyright @ 2005 by Dick Munroe, Cottage Software Works, Inc.
 * @license http://www.csworks.com/publications/ModifiedNetBSD.html
 * @package SudokuExample
 */

$p = new SudokuIntermediateSolution() ;

$theInitialPosition $p->generatePuzzle() ;

$p = new Sudoku() ;

$p->initializePuzzleFromArray($theInitialPosition) ;

$p->printSolution() ;

?>