Changes
This commit is contained in:
parent
363e681f48
commit
6a5bd31b28
1 changed files with 4 additions and 1 deletions
|
|
@ -273,6 +273,9 @@ const PresentsPuzzle = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const stepToEnd = () => {
|
const stepToEnd = () => {
|
||||||
|
// Don't do anything if already at end or winner already determined
|
||||||
|
if (currentStep >= 99 || winner !== null) return;
|
||||||
|
|
||||||
const { presents, aliceOrder: aOrder, bobOrder: bOrder } = initializeSimulation();
|
const { presents, aliceOrder: aOrder, bobOrder: bOrder } = initializeSimulation();
|
||||||
|
|
||||||
let aliceCount = 0;
|
let aliceCount = 0;
|
||||||
|
|
@ -465,7 +468,7 @@ const PresentsPuzzle = ({
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={stepToEnd}
|
onClick={stepToEnd}
|
||||||
disabled={isRunning || currentStep >= 99}
|
disabled={isRunning || currentStep >= 99 || winner !== null}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="gap-2"
|
className="gap-2"
|
||||||
title="Step to end"
|
title="Step to end"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue