refactor: use separate seed for reroll of vegetables
This commit is contained in:
@@ -25,6 +25,7 @@ export default [
|
|||||||
"max-statements": ["warn", 50],
|
"max-statements": ["warn", 50],
|
||||||
"max-params": ["warn", 5],
|
"max-params": ["warn", 5],
|
||||||
"max-lines": "off",
|
"max-lines": "off",
|
||||||
|
"init-declarations": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -75,8 +75,8 @@
|
|||||||
<td><label for="candidates">Candidates:</label></td>
|
<td><label for="candidates">Candidates:</label></td>
|
||||||
<td><textarea v-model="config.candidates" id="candidates" rows="8"></textarea></td>
|
<td><textarea v-model="config.candidates" id="candidates" rows="8"></textarea></td>
|
||||||
<td>
|
<td>
|
||||||
<button @click="newVegetables"><i icon="rotate-ccw"></i></button>
|
<button @click="newVegetables"><i icon="dices"></i></button>
|
||||||
<br/>
|
<br />
|
||||||
<span v-if="candidates.length <= 2" title="not enough candidates">
|
<span v-if="candidates.length <= 2" title="not enough candidates">
|
||||||
<i icon="triangle-alert"></i> <i icon="users-round"></i> {{candidates.length}}
|
<i icon="triangle-alert"></i> <i icon="users-round"></i> {{candidates.length}}
|
||||||
</span>
|
</span>
|
||||||
@@ -124,4 +124,4 @@
|
|||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -103,6 +103,7 @@ class TableGenerator {
|
|||||||
return scores;
|
return scores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line class-methods-use-this
|
||||||
mixKey(index1, index2) {
|
mixKey(index1, index2) {
|
||||||
return Math.min(index1, index2) * 1000 + Math.max(index1, index2);
|
return Math.min(index1, index2) * 1000 + Math.max(index1, index2);
|
||||||
}
|
}
|
||||||
@@ -312,7 +313,7 @@ const app = createApp({
|
|||||||
},
|
},
|
||||||
newVegetables() {
|
newVegetables() {
|
||||||
this.config.candidates = utils
|
this.config.candidates = utils
|
||||||
.shuffleSeeded(Object.keys(VEGETABLES), this.config.seed)
|
.shuffleSeeded(Object.keys(VEGETABLES), utils.randomSeed())
|
||||||
.map((key) => `${key} ${VEGETABLES[key]}`)
|
.map((key) => `${key} ${VEGETABLES[key]}`)
|
||||||
.slice(0, 6)
|
.slice(0, 6)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
@@ -374,8 +375,7 @@ const app = createApp({
|
|||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(csvTable);
|
await navigator.clipboard.writeText(csvTable);
|
||||||
this.copyTableOverride = "Table Copied";
|
this.copyTableOverride = "Table Copied";
|
||||||
} catch (error) {
|
} catch {
|
||||||
console.error(error.message);
|
|
||||||
this.copyTableOverride = "Error";
|
this.copyTableOverride = "Error";
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user