- #1
P
PCDPatrick
Guest
Hi!
Schaut euch mal das an:
wie funktioniert das? ???
Das stimmt bei mir immer was da herauskommt...
Hat jemand ne Erklärung?
Greetz
Schaut euch mal das an:
Code:
<script LANGUAGE=JavaScript>
<!--
function es() {
alert(Denk Dir eine Zahl.)
x=0
var today=new Date()
sec=0
for (i=1;i<=5;i++) {
sec=today.getSeconds()
rand1 = 31
while ( rand1 > 30 ) {
rand1 = Math.random()*sec*100
rand1 = Math.ceil(rand1)
}
rand2 = Math.random()
if (rand2>0.5) { mes=addiere ; mes1= zu ; y=rand1 }
else{ mes=substrahiere ; mes1= von ; y=-rand1}
x1=x
x=x+y
if (x<0) { mes=addiere ; mes1= zu ; x=x1+rand1 }
alert(Bitte +mes+rand1+mes1+der Zwischensumme. )
}
alert(Bitte substrahiere die zuerst gedachte Zahl.)
alert(Die Zahl, die jetzt herauskommt, ist +x+ , oder etwa nicht?)
}
//-->
</script>
Das stimmt bei mir immer was da herauskommt...
Hat jemand ne Erklärung?
Greetz