Browse Source

phpdoc compatibility

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
b2a525f003
  1. 20
      export/html/snakes/js/snakes-mod.js
  2. 44
      sudoku/class.Sudoku.php

20
export/html/snakes/js/snakes-mod.js

@ -6,15 +6,12 @@ var totblocks = 0;
var lastposition = new Array(); var lastposition = new Array();
var randomno = 0; var randomno = 0;
var tots = new Array(); var tots = new Array();
var l = 0;
var srcsnake = new Array(4); var srcsnake = new Array(4);
var destsnake = new Array(4); var destsnake = new Array(4);
var ladsrc = new Array(3); var ladsrc = new Array(3);
var laddest = new Array(3); var laddest = new Array(3);
var quest = new Array(); // Available questions along with multiple answers. var quest = new Array(); // Available questions along with multiple answers.
var coranswered = new Array(); // Record all questions (along with answers) the user responded CORRECTLY.
var wroanswered = new Array(); // Record all questions (along with answers) the user responded WRONGLY.
// Constract table with questions and answers and pick question to display. // Constract table with questions and answers and pick question to display.
@ -45,12 +42,6 @@ for (;;) {
} }
allQuest = z / 4; allQuest = z / 4;
function selectQuest(all) {
var pickone = Math.floor((Math.random() * all));
return pickone;
}
// The below Function will simulate throwing of a dice. // The below Function will simulate throwing of a dice.
function throwDice(i) { function throwDice(i) {
randomno = Math.floor((Math.random() * 6)) + 1; randomno = Math.floor((Math.random() * 6)) + 1;
@ -111,17 +102,6 @@ function laddercheck(k) {
} }
} }
// The below function regulates the play.
function doit(i) {
throwDice(i);
if (checkWin(i)) {
snakescheck(i);
laddercheck(i);
} else {
alert("Congatulations!!!");
}
}
// The below function checks whether the player has won or not. // The below function checks whether the player has won or not.
function checkWin(i) { function checkWin(i) {
if (tots[i] == totblocks) { if (tots[i] == totblocks) {

44
sudoku/class.Sudoku.php

@ -146,7 +146,7 @@ class cell extends objects {
* *
* @param integer $inpr row address of this cell (not used, primarily for debugging purposes). * @param integer $inpr row address of this cell (not used, primarily for debugging purposes).
* @param integer $inpc column address of this cell (ditto). * @param integer $inpc column address of this cell (ditto).
* @param integer $nStates The number of states each cell can have. Looking forward to * @param integer $nstates The number of states each cell can have. Looking forward to
* implementing Super-doku. * implementing Super-doku.
*/ */
public function init($inpr, $inpc, $nstates = 9) { public function init($inpr, $inpc, $nstates = 9) {
@ -339,29 +339,20 @@ class rcs extends ObjectS {
/** /**
* Constructor * Constructor
* *
* This interface is what limts things to 9x9 Sudoku currently
* @param string $thetag "Row", "Column", "Square", used primarily in debugging. * @param string $thetag "Row", "Column", "Square", used primarily in debugging.
* @param integer $theindex 1..9, where is this on the board. Square are numbered top * @param integer $theindex 1..9, where is this on the board. Square are numbered top
* left, ending bottom right * left, ending bottom right
* @param ObjectS $a1 of class Cell. The cells comprising this entity. This interface is what * @param ObjectS $a1 of class Cell.
* limts things to 9x9 Sudoku currently. * @param ObjectS $a2 of class Cell.
* @param ObjectS $a2 of class Cell. The cells comprising this entity. This interface is what * @param ObjectS $a3 of class Cell.
* limts things to 9x9 Sudoku currently. * @param ObjectS $a4 of class Cell.
* @param ObjectS $a3 of class Cell. The cells comprising this entity. This interface is what * @param ObjectS $a5 of class Cell.
* limts things to 9x9 Sudoku currently. * @param ObjectS $a6 of class Cell.
* @param ObjectS $a4 of class Cell. The cells comprising this entity. This interface is what * @param ObjectS $a6 of class Cell.
* limts things to 9x9 Sudoku currently. * @param ObjectS $a7 of class Cell.
* @param ObjectS $a5 of class Cell. The cells comprising this entity. This interface is what * @param ObjectS $a8 of class Cell.
* limts things to 9x9 Sudoku currently. * @param ObjectS $a9 of class Cell.
* @param ObjectS $a6 of class Cell. The cells comprising this entity. This interface is what
* limts things to 9x9 Sudoku currently.
* @param ObjectS $a6 of class Cell. The cells comprising this entity. This interface is what
* limts things to 9x9 Sudoku currently.
* @param ObjectS $a7 of class Cell. The cells comprising this entity. This interface is what
* limts things to 9x9 Sudoku currently.
* @param ObjectS $a8 of class Cell. The cells comprising this entity. This interface is what
* limts things to 9x9 Sudoku currently.
* @param ObjectS $a9 of class Cell. The cells comprising this entity. This interface is what
* limts things to 9x9 Sudoku currently.
*/ */
public function init($thetag, $theindex, &$a1, &$a2, &$a3, &$a4, &$a5, &$a6, &$a7, &$a8, &$a9) { public function init($thetag, $theindex, &$a1, &$a2, &$a3, &$a4, &$a5, &$a6, &$a7, &$a8, &$a9) {
$this->thetag = $thetag; $this->thetag = $thetag;
@ -453,7 +444,7 @@ class rcs extends ObjectS {
/** /**
* apply a tuple to exclude items from within the row/column/square. * apply a tuple to exclude items from within the row/column/square.
* *
* @param array $aTuple the tuple to be excluded. * @param array $atuple the tuple to be excluded.
* *
* @return boolean true if anything changes. * @return boolean true if anything changes.
*/ */
@ -624,7 +615,6 @@ class rcs extends ObjectS {
return $thereturn; return $thereturn;
} }
/** /**
* un set * un set
* *
@ -957,9 +947,6 @@ class sudoku extends ObjectS {
/** @var integer. Used during puzzle generation to limit the number of trys at /** @var integer. Used during puzzle generation to limit the number of trys at
* generation a puzzle in the event puzzle generation fails * generation a puzzle in the event puzzle generation fails
* (@see Suduko::$theMaxIterations). I've never seen more than
* a couple of failures in a row, so this should be sufficient
* to get a puzzle generated.
*/ */
protected $thetrys = 10; protected $thetrys = 10;
@ -1095,7 +1082,7 @@ class sudoku extends ObjectS {
* Given a solution, see if there are any alternates within the solution. * Given a solution, see if there are any alternates within the solution.
* In theory this should return the "minimum" solution given any solution. * In theory this should return the "minimum" solution given any solution.
* *
* @param array $theInitialState (@see Sudoku::initializePuzzleFromArray) * @param array $theinitialState
* *
* @return array A set of triples containing the minimum solution. * @return array A set of triples containing the minimum solution.
*/ */
@ -1140,7 +1127,6 @@ class sudoku extends ObjectS {
* @param integer $thetrys [optional] The number of attempts at resetting the * @param integer $thetrys [optional] The number of attempts at resetting the
* initial parameters before giving up. * initial parameters before giving up.
* @return array A set of triples suitable for initializing a new Sudoku class * @return array A set of triples suitable for initializing a new Sudoku class
* (@see Sudoku::initializePuzzleFromArray).
*/ */
public function generatepuzzle($thedifficultylevel = 10, $themaxiterations = 50, $thetrys = 10) { public function generatepuzzle($thedifficultylevel = 10, $themaxiterations = 50, $thetrys = 10) {
$thedifficultylevel = min($thedifficultylevel, 10); $thedifficultylevel = min($thedifficultylevel, 10);
@ -1533,8 +1519,6 @@ class sudoku extends ObjectS {
* A "hook" so that extension classes can show all the steps taken by * A "hook" so that extension classes can show all the steps taken by
* the solve function. * the solve function.
* *
* @see SudokuIntermediateSolution.
*
* @param string $theheader [optional] The header line to be output along * @param string $theheader [optional] The header line to be output along
* with the intermediate solution. * with the intermediate solution.
*/ */

Loading…
Cancel
Save