generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Club Houses » Off Topic
Home Search
 

I decided to start learning to script today

Previous Thread :: Next Thread 
Puppy2233 is not online. Puppy2233
Joined: 14 Feb 2011
Total Posts: 10444
20 Oct 2015 04:19 PM
I didn't get anywhere. what are some good guides to scripting?

why am I not on my alt
Report Abuse
redlego98 is not online. redlego98
Joined: 11 Jul 2008
Total Posts: 8870
20 Oct 2015 04:22 PM
I'm just going to put this here.
I was bored.

var upCase = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
var lowCase = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
var numChar = ["0","1","2","3","4","5","6","7","8","9"];
var specChar = ["!","@","#","$","%","&"];

var maxChar = prompt("Max Characters");
var sCharAllow = confirm("Are special characters allowed?");

var rChoiceYS = Math.ceil(Math.random()*4);
var rChoiceNS = Math.ceil(Math.random()*3);

var upCharChoice = Math.ceil(Math.random()*26-1);
var lowCharChoice = Math.ceil(Math.random()*26-1);
var numChoice = Math.ceil(Math.random()*10-1);
var specChoice = Math.ceil(Math.random()*6-1);

function sCharYSwitch(y) {
switch (y) {
case 1:
console.log(upCase[upCharChoice]);
break;
case 2:
console.log(lowCase[lowCharChoice]);
break;
case 3:
console.log(numChar[numChoice]);
break;
case 4:
console.log(specChar[specChoice]);
break;
default:
console.log("This shouldn't happen.");
break;
}
}

function sCharNSwitch(n) {
switch (n) {
case 1:
console.log(upCase[upCharChoice]);
break;
case 2:
console.log(lowCase[lowCharChoice]);
break;
case 3:
console.log(numChar[numChoice]);
break;
default:
console.log("This shouldn't happen.");
break;
}
}

function final() {
switch (sCharAllow) {
case true:
sCharYSwitch(rChoiceYS);
break;
case false:
sCharNSwitch(rChoiceNS);
break;
default:
console.log("This shouldn't happen.");
break;
}}


for (var i = 0; i < maxChar; i++) {
rChoiceYS = Math.ceil(Math.random()*4);
rChoiceNS = Math.ceil(Math.random()*3);
upCharChoice = Math.ceil(Math.random()*26-1);
lowCharChoice = Math.ceil(Math.random()*26-1);
numChoice = Math.ceil(Math.random()*10-1);
specChoice = Math.ceil(Math.random()*6-1);
final();
}

Yes, I realize it is terribly inefficient.

A strange game. The only winning move is not to play.
Report Abuse
Puppy2233 is not online. Puppy2233
Joined: 14 Feb 2011
Total Posts: 10444
20 Oct 2015 04:23 PM
I'LL TOY WITH IT

why am I not on my alt
Report Abuse
nickyny is not online. nickyny
Joined: 09 Aug 2012
Total Posts: 4067
20 Oct 2015 04:23 PM
k



youll never get my swiggity swoogity sam
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Off Topic
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image