problem with a switch function
Hi all:
I have a function which returns randomly either 6, 7 8 or 9.
Then there's a switch function which does different things for each number.
Problem is, connecting the random results to the switch function.
Currently, Firefox is saying "unreachable code after return statement", but I don't understand how FF's problem with "code after a return statement" applies.
Here's the code:
- function fastLine1() {
- var poss = [7,7,7,8,8,8,6,9]
- result = Math.floor(Math.random() * poss.length); return poss[result];
- var m = 7
- var n = 8
- var p = 6
- var q = 9
- var r = (m + n + p + q)
- switch(r) {
- case 6:
- hideFast('fast1'); hideWen2('D1'); yin6(); return false;
- break
- case 7:
- hideFast('fast1'); hideWen2('D1'); yang7(); return false;
- break
- case 8:
- hideFast('fast1'); hideWen2('C1'); yin8(); return false;
- break
- default:
- hideFast('fast1'); hideWen2('C1'); yang9(); return false; }
- }
- There are more functions in each case, what's above is there to show each case is well-formed.