Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Roam45 authored Nov 2, 2024
1 parent 143cca6 commit ca8c01d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ <h2>Output:</h2>
for (const line of lines) {
const trimmedLine = line.trim();

// Numeric variable assignment with var.value.x
const numberAssignmentMatch = trimmedLine.match(/var\.value\.(\w+)\s*=\s*"(.*)"/);
// Numeric variable assignment with var.value.x(45)
const numberAssignmentMatch = trimmedLine.match(/var\.value\.(\w+)\s*\((.*)\)/);
if (numberAssignmentMatch) {
const nickname = numberAssignmentMatch[1];
const value = parseFloat(numberAssignmentMatch[2]); // Convert string to number
variables[nickname] = value; // Store numeric value with nickname
continue;
}

// Text variable assignment with text.var.value.x
const textAssignmentMatch = trimmedLine.match(/text\.var\.value\.(\w+)\s*=\s*"(.*)"/);
// Text variable assignment with text.var.value.hi(hi)
const textAssignmentMatch = trimmedLine.match(/text\.var\.value\.(\w+)\s*\((.*)\)/);
if (textAssignmentMatch) {
const textNickname = textAssignmentMatch[1];
const textValue = textAssignmentMatch[2];
Expand Down

0 comments on commit ca8c01d

Please sign in to comment.