All pastes #408198 Raw Edit

Miscellany

public text v1 · immutable
#408198 ·published 2007-03-24 17:46 UTC
rendered paste body
<html>
<head>
<title>Challenge</title>
</head>

<body>

<script type="text/javascript">

var b = prompt("Enter a base:");
var e = prompt("Enter an exponent:");
var output=1;
var i;

function calc(b,e,i,output) {
for(i=0;i<e;i++){

document.write(b+"<sup>"+e+"</sup> = ");

if(e == 0) {
output = 1;
}

else if(b == 0) {
output = 0;
}

else if(e < 0) {
output/=b;
}

else {
output*=b;
document.write(b+"X");
}

}
}


document.write(calc(b(e)));

</script>

</body>
</html>