Skip to content
Merged
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1960adb
Add prompt guessing game initial structure
mentatbot[bot] Jan 16, 2025
8e9cb95
Implement prompt guessing game functionality
mentatbot[bot] Jan 16, 2025
d7f7765
Add game instructions and hint system
mentatbot[bot] Jan 16, 2025
18a094c
Fix build configuration and directory structure
mentatbot[bot] Jan 16, 2025
68be43a
Update deploy-apps.yml
voodoohop Jan 17, 2025
38eaf60
Update utils.js
voodoohop Jan 17, 2025
78b55d4
Update vite.config.js
voodoohop Jan 17, 2025
ce4f3f8
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
978a7ee
Update vite.config.js
voodoohop Jan 17, 2025
775d517
Update vite.config.js
voodoohop Jan 17, 2025
2046ac5
Update vite.config.js
voodoohop Jan 17, 2025
bc87a8c
Crop
voodoohop Jan 17, 2025
81f1450
Add svg feedback experiment
voodoohop Jan 17, 2025
b4c9f32
Update index.html
voodoohop Jan 17, 2025
4c9c876
Update index.html
voodoohop Jan 17, 2025
7123bda
Update index.html
voodoohop Jan 17, 2025
2fcdbc2
Update index.html
voodoohop Jan 17, 2025
68b6bf3
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
3177b83
Update index.html
voodoohop Jan 17, 2025
6caa377
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
7e993fd
Beautiful version
voodoohop Jan 17, 2025
c15e53d
Update index.html
voodoohop Jan 17, 2025
54a62c2
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
55df13c
Update index.html
voodoohop Jan 17, 2025
aeca570
initial svg state
voodoohop Jan 17, 2025
47cf8fb
save preset too
voodoohop Jan 17, 2025
8bc7de5
Update index.html
voodoohop Jan 17, 2025
8f9b7ca
Update index.html
voodoohop Jan 17, 2025
4f91539
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
a46fc28
Update index.html
voodoohop Jan 17, 2025
04640df
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
571251e
Update index.html
voodoohop Jan 17, 2025
aecaecb
Merge branch 'main' into mentat-140-1-prompt-guessing-game
voodoohop Jan 17, 2025
645ba27
Update SVG dimensions to 100% width and height
voodoohop Jan 17, 2025
34eb5f7
Extract js
voodoohop Jan 17, 2025
bdd44aa
revert script to html file
voodoohop Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions svg-feedback/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ <h2>History</h2>
const maxRetries = 3;
const model = getSelectedModel();
const temperature = parseFloat(elements.temperature.value);
const seed = parseInt(elements.seed.value) >= 0 ?
parseInt(elements.seed.value) :
currentSeed++; // Use and increment the current seed
const seed = currentSeed; // Use and increment the current seed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The seed increment is now handled outside this function, but there's no comment indicating where the increment happens. Consider adding a comment here to point to where currentSeed gets incremented (line 364) for better code maintainability.


const systemPrompt = `You are an animated SVG art generator. Create SVG code that fits within a 800x600 viewBox.
Follow these rules:
Expand Down Expand Up @@ -382,6 +380,10 @@ <h2>History</h2>
isRunning = true;
elements.start.disabled = true;
elements.stop.disabled = false;

if (parseInt(elements.seed.value) >= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The seed initialization should validate that the parsed value is a finite number to prevent potential issues with NaN or Infinity. Consider adding validation using !isNaN() and isFinite(). Here's how:

if (!isNaN(parseInt(elements.seed.value)) && isFinite(parseInt(elements.seed.value)) && parseInt(elements.seed.value) >= 0) {
    initialSeed = parseInt(elements.seed.value);    
}

initialSeed = parseInt(elements.seed.value);
}

frames = [];
frameIndex = 0;
Expand Down Expand Up @@ -435,7 +437,7 @@ <h2>History</h2>
temperature: elements.temperature.value,
initialSvg: elements.initialSvg.value,
model: elements.modelSelect.value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change to store initialSeed instead of currentSeed in presets, as it represents the starting point of the evolution sequence. However, consider adding a comment explaining why we store initialSeed rather than currentSeed to make the intent clear for future maintainers.

seed: currentSeed
seed: initialSeed
};

const savedPresets = JSON.parse(localStorage.getItem('savedPresets2') || '{}');
Expand Down
Loading