Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @author=Cicco23 */
- /*
- Parameters:
- > u = $(user);
- > qs = $(query);
- > c = $(count);
- > alive = true;
- */
- /*Clear ueless spaces ("%20")*/
- function trimmer(x){
- x = x.trim();
- while(x.startsWith("%20")){
- x=x.replace("%20","");
- }
- return x.trim();
- }
- /*Clear the "%20" space bug*/
- qs = trimmer(qs);
- /*q -> string array of qs (querystring).*/
- var q = qs.split("%20");
- /*move saves the moves the player have chosen.*/
- var move = [0,0,0];
- /*nbMooves are the moves NB chooses.*/
- var nbMoves = [0,0,0];
- /*The fundamental string.*/
- var str = "";
- /*Result*/
- var hits = 0;
- /*Let's check if player have chosen correctly.*/
- var flag = q.length>=3;
- for(int i=0;flag && i<3;i++{
- if(isNaN(q[i])||q[i]<1||q[i]>3) "ERROR. "+qs+" is NOT a valid number. Please re-try with a number between 1 and 3, next time! (correct sintax: !nbshoot [number] [number] [number].";
- else move[i]=q[i];
- var x = Math.random()*3;
- x = 1+Math.floor(x);
- nbMoves[i]=x;
- }
- /* TESTING */
- /* str = "Hai inserito \" "+qs+" \"\t"+str;*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement