receiver.js
//Purpose: Checks if the stamps are set correctly
Checks if the stamps are set correctly
Checks if the stamps are set correctly
function going()
{
	var puzzleSolution = Table.hasRandomNumbers;
	var playerSolution = Table.isStamped;
	if(puzzleSolution.length !== playerSolution.length)
	{
		alert("Please fill the correct number of stamps!");
		return 0;
	}
	if(typeof puzzleSolution !== typeof playerSolution)
	{
		alert("FATAL ERROR: Array objects are not of the same type!")
		throw "FATAL ERROR: Array objects are not of the same type!";
		return 0;
	}
	puzzleSolution.forEach(Table.go.bind(Table));
	alert("CONGRATULATION!!! You solved the puzzle :)!")
	var solvedPuzzle = document.getElementById('solved');
	solvedPuzzle.innerHTML = '<img src="Result.jpg">';
}
function going ( ) { var puzzleSolution = Table . hasRandomNumbers ; var playerSolution = Table . isStamped ; if ( puzzleSolution . length !== playerSolution . length ) { alert ( "Please fill the correct number of stamps!" ) ; return 0 ; } if ( typeof puzzleSolution !== typeof playerSolution ) { alert ( "FATAL ERROR: Array objects are not of the same type!" ) throw "FATAL ERROR: Array objects are not of the same type!" ; return 0 ; } puzzleSolution . forEach ( Table . go . bind ( Table ) ) ; alert ( "CONGRATULATION!!! You solved the puzzle :)!" ) var solvedPuzzle = document . getElementById ( 'solved' ) ; solvedPuzzle . innerHTML = '<img src="Result.jpg">' ; }
Purpose: Checks if the stamps are set correctly
Purpose : Checks if the stamps are set correctly
//CHEATS //console.log("puS", Table.hasRandomNumbers); //console.log("plS", Table.isStamped); //USER-ERROR //INTERN-ERROR /*
		ATTENTION: 
		Using bind for comparing the array elements
	*/ //CONGRATS //Visualizing the right outcome