Make your own free website on Tripod.com
SWAT My Welcome Of Doom to you!!!
  Javascript Actionscript Blog
 

<script>
//fuzzyDice
//David Fang
//Demonstrates switch statement
var roll = 0;
var die = "";
roll = Math.floor(Math.random() * 6) + 1;
switch (roll) {
case 1:
die = " |- - - - - - - - |\n";
die +=" | |\n";
die +=" | * |\n";
die +=" | |\n";
die +=" |- - - - - - - - |\n";
break;

case 2:
die = " | - - - - - - - - |\n";
die +=" | * |\n";
die +=" | |\n";
die +=" | * |\n";
die +=" | - - - - - - - - |\n";
break;
case 3:
die = " | - - - - - - - - |\n";
die +=" | * |\n";
die +=" | * |\n";
die +=" | * |\n";
die +=" | - - - - - - - - |\n";
break;
case 4:
die =" |- - - - - - - - |\n";
die +=" | * * |\n";
die +=" | |\n";
die +=" | * * |\n";
die +=" | - - - - - - - -|\n";
break;
case 5:
die =" |- - - - - - - - |\n";
die +=" | * * |\n";
die +=" | * |\n";
die +=" | * * |\n";
die +=" | - - - - - - - -|\n";
break;
case 6:
die =" |- - - - - - - - |\n";
die +=" | * * |\n";
die +=" | * * |\n";
die +=" | * * |\n";
die +=" | - - - - - - - -|\n";
break;
default:
die = "ERROR!"
} // end switch
alert(die);
</script>

 

 

Links

1. SLHS

2. SLHSXC

3. JMMS

Contact me

Class links

Computer Science

Five Classmates

1. Julio Maravilla

2. Norman Duong

3. Huy Vo

4. Titus Green

5. Jack Li

Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Miscellaneous
 
Home Product Contact order