so nun den code eintippen ... ich
benutze hier eine do while Schleife für die Zufallszahl ... im
einzelnen Math.random erzeigt eine Zufallszahl zwischen 0 und 1
z.B. 0,5737788 - diese neme ich mal hundert und runde mit
Math.round ab ... und dieses wird sollange wider holt bis die
bedingungt im nagativen sinne erfüllt sind ... also nicht
größe als 49 , nicht gleich null und nicht schon
vorhanden...
// This file was generated by Dashcode from
Apple Inc.
// You may edit this file to customize your web
application.
//
// Function: load()
// Called by HTML body element's onload event when the web
application is ready to start
//
function load()
{
setupParts();
}
function meinClickHandler(event)
{ // Code hier eingeben
var textAreaToChange =
document.getElementById("textarea");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
var zahl = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea1");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
var zahl1 = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea2");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == zahl1 || newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
var zahl2 = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea3");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == zahl1 || newTextAreaText == zahl2 ||
newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
var zahl3 = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea4");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == zahl1 || newTextAreaText == zahl2 ||
newTextAreaText == zahl3 || newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
var zahl4 = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea5");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == zahl1 || newTextAreaText == zahl2 ||
newTextAreaText == zahl3 || newTextAreaText == zahl4 ||
newTextAreaText == 0 );
textAreaToChange.value = newTextAreaText;
var zahl5 = newTextAreaText;
var textAreaToChange =
document.getElementById("textarea6");
do { var newTextAreaText = Math.round ((Math.random())*100);
} while (newTextAreaText > 49 || newTextAreaText == zahl ||
newTextAreaText == zahl1 || newTextAreaText == zahl2 ||
newTextAreaText == zahl3 || newTextAreaText == zahl4 ||
newTextAreaText == zahl5 || newTextAreaText == 0);
textAreaToChange.value = newTextAreaText;
}