Forum Moderators: open
function Coin1() {
var m = Math.random()
if (m < 0.5) return 2; else return 3 }
Both of these functions
function numtoHT1() {
if (Coin1() == 3){
return "heads";
}else{
return "tails"; }}
function numtoHT2() {
return (Coin2() == 3)? "heads" : "tails" }
< Sorry, no links to test pages >
I'm beginning to think it's not possible.
[edited by: tedster at 9:07 pm (utc) on Dec. 3, 2007]
Is it possible to to take the 2 or 3, and have these return the words "tails" for 2 and "heads" for 3?
actually run the math.random() function afresh to generate the output, they don't store the output of invoking the function first time round
I'm beginning to think it's not possible.
I should have been more patient on another board, and allowed the folks there to get some sleep... before spelling out a solution for me:
< no links to test pages, please >
where 3 always returns "heads" and 2 always returns "tails"; which is not the case with test.htm.
[edited by: tedster at 1:22 am (utc) on Dec. 4, 2007]