This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userChoice = ["paper", "rock", "scissors"]; | |
var computerChoice = Math.random(); | |
if (computerChoice < 0.34) { | |
computerChoice = userChoice[1]; | |
} else if(computerChoice <= 0.67) { | |
computerChoice = userChoice[0]; | |
} else { | |
computerChoice = userChoice[2]; | |
} console.log("Computer: " + computerChoice); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onSimulateOrdersClick: function(article) { | |
console.log("Simulating for article:"); | |
console.log(article); | |
var me = this; | |
var articleId = article.get('article_id'); | |
// First we have to load All data about article before proceeding any further. |