(v1, v2, bias)
| 2510 | } |
| 2511 | |
| 2512 | function random(v1, v2, bias) { |
| 2513 | /* Returns a number between v1 and v2, including v1 but not v2. |
| 2514 | * The bias (0.0-1.0) represents preference towards lower or higher numbers. |
| 2515 | */ |
| 2516 | if (v1 === undefined) v1 = 1.0; |
| 2517 | if (v2 === undefined) { |
| 2518 | v2=v1; v1=0; |
| 2519 | } |
| 2520 | if (bias === undefined) { |
| 2521 | var r = Math.random(); |
| 2522 | } else { |
| 2523 | var r = Math.pow(Math.random(), _rndExp(bias)); |
| 2524 | } |
| 2525 | return r * (v2-v1) + v1; |
| 2526 | } |
| 2527 | |
| 2528 | function grid(cols, rows, colWidth, rowHeight, shuffled) { |
| 2529 | /* Returns an array of Points for the given number of rows and columns. |
no test coverage detected
searching dependent graphs…