Make your own free website on Tripod.com
 
Home
ActionScript
Blog

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dice Roller

<script>

//dieRoller
//Catherine Casuat 10/2/07
//converts random numbers to six-sided die

var rollRaw = 0;

var rollBigger = 0;

var rollInt = 0;

var rollFinal = 0;

var result = "";

rollRaw = Math.random();

rollBigger = 0;

var rollInt = 0;

var rollFinal = 0;

var result = "";

rollRaw = Math.random();

rollBigger = rollRaw * 6;

rollInt = Math.floor(rollBigger);

rollFinal = rollInt + 1;

result = "rollRaw: " + rollRaw + "\n";

result += "rollBigger: " + rollBigger + "\n";

result += "rollInt: " + rollInt + "\n";

result += "rollFinal: " + rollFinal + "\n";

alert(result);

</script>