Make your own free website on Tripod.com
Hello

Welcome to my page!

Javascript

 
Links

Fuzzy Dice

 

<script>
//Fuzzy Dice
//Julio Maravilla Oct 1, 2007

var roll;
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!!!";
}

alert(die);
</script>

 

 

Links

Contact me

Favorite links

Computer Science

Five Classmates