John Smith commited on 2023-42 12:18:26
Showing 1 changed files, with 0 additions and 16 deletions.
biasedshuffle is no longer in use, as of 735ea73
| ... | ... |
@@ -53,22 +53,6 @@ local function should(prompt) |
| 53 | 53 |
return false |
| 54 | 54 |
end |
| 55 | 55 |
|
| 56 |
---[[ |
|
| 57 |
- shuffles a table in-place, |
|
| 58 |
- intentionally biased to keep the list |
|
| 59 |
- in a roughly-similar order to how it was originally |
|
| 60 |
- (but so that the list may deviate more towards the end) |
|
| 61 |
-]] |
|
| 62 |
-local function biasedshuffle(t) |
|
| 63 |
- for i = 1, (#t-1) do |
|
| 64 |
- if math.random() < (i / #t)^0.5 then |
|
| 65 |
- local s = t[i] |
|
| 66 |
- t[i] = t[i + 1] |
|
| 67 |
- t[i + 1] = s |
|
| 68 |
- end |
|
| 69 |
- end |
|
| 70 |
-end |
|
| 71 |
- |
|
| 72 | 56 |
local function alwaystrue(x) |
| 73 | 57 |
return true |
| 74 | 58 |
end |
| 75 | 59 |