function switchCurrentPlayer() { if (currentPlayer = 1) { currentPlayer = 2; } else { currentPlayer = 1; } }
switchCurrentPlayer(); document.write('player ' + currentPlayer + '<br>'); switchCurrentPlayer(); document.write('player ' + currentPlayer + '<br>');
function switchCurrentPlayer() { if (currentPlayer == 1) { currentPlayer = 2; } else { currentPlayer = 1; } }
function switchCurrentPlayer() { currentPlayer == 1 ? currentPlayer = 2: currentPlayer = 1; }
You sir, are a star! Thank you. This is all new to me and programming is not my strong point. Do you mind if I PM you for further help if needed?
I can offer biscuits with owl shapes on them as a reward!
FORUM HELPFUL AWARD!
(worship)
var a = 0; var b = '0'; document.write(a==b); document.write('\n'); document.write(a===b);
currentPlayer == 1 ? currentPlayer = 2: currentPlayer = 1;
currentPlayer = (currentPlayer == 1) ? 2 : 1;
function switchCurrentPlayer() { currentPlayer++ if ( currentPlayer > PlayerCount ) { currentPlayer=1 } }
Wow, just wow.
Peter, why are you not ruling the world, or even just Britain by now?
The last email made a lot more sense to me and is in the style of scripting that the OU is teaching.
Come one peter, become that evil genius we all know and love.