hi I'm just new to java and I'm trying to write a script that will shuffle the information in a array with no gaps and no repeats. below is that code that i have so far. thanks ben
[CODE]
//constants
SWAPS_TO_BE_MADE = 30;
//variables
var myArray = new Array('Ace',2,3,4,5,6,7,8,9,10,'Jack','Queen','King'); // the array that entities will be shuffled from
var temp = 0;
var outPutArray = new Array (12);
var arrayLength = myArray.length;
var index = 0;
var swapIndex = 0;
var self_swaps = 0;
var counter = 0;
<script type = "text/javascript">
var imgArray = new Array('Ace',2,3,4,5,6,7,8,9,10,'Jack','Queen','King');
function randOrd(){return (Math.round(Math.random())-0.5); }
imgArray.sort(randOrd);
alert (imgArray);
<script>
Quote:
I'm just new to java
Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.