HTML and CSS Reference
In-Depth Information
.deck .pattern {
width: 100%;
height: 100%;
}
We should have the following screenshot once this task is completed. The deck shows the
paterns that a player needs to compose the quest:
Objective complete - mini debriefing
JavaScript comes with a sort method for the array. Normally, we compare the given two
array elements and return +1 or -1 to control elements' swapping.
We can randomize an array by randomly returning either +1 or -1 :
patternsToShow.sort(function(a, b){
return Math.random() - 0.5;
});
Ater we randomize the paterns, we clone each patern from the template and append
them to the deck element.
 
Search WWH ::




Custom Search