Skip to content

Commit

Permalink
fix weigting
Browse files Browse the repository at this point in the history
  • Loading branch information
JayAgra committed Oct 5, 2023
1 parent acdbbd2 commit c633c3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
24 changes: 12 additions & 12 deletions 2023.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,32 +142,32 @@ function weightScores(submissionID) {
var cubes = 0;
var cones = 0;
var gridWt = 0;
result.game12.split("").forEach(function(item, index, array) {
const fullGrid = !array.includes("0");
if (index <= 8 && item !== "0") {
if (item === "3" || item === "4" && fullGrid) {
const fullGrid = !result.game12.split("").includes("0");
result.game12.split("").forEach(function(item, index) {
if (index <= 8 && item != "0") {
if (item == "3" || item == "4" && fullGrid) {
gridWt += 3;
}
gridWt += 5;
} else if (index <= 17 && item !== "0") {
if (item === "3" || (item === "4" && fullGrid)) {
} else if (index <= 17 && item != "0") {
if (item == "3" || (item == "4" && fullGrid)) {
gridWt += 3;
}
gridWt = gridWt + 3;
} else if (index <= 26 && item !== "0") {
if (item === "3" || (item === "4" && fullGrid)) {
} else if (index <= 26 && item != "0") {
if (item == "3" || (item == "4" && fullGrid)) {
gridWt += 3;
}
gridWt += 2;
}
if (item === "1") {
if (item == "1") {
cubes++
} else if (item === "3") {
} else if (item == "3") {
cubes += 2
}
if (item === "2") {
if (item == "2") {
cones++
} else if (item === "3") {
} else if (item == "3") {
cones += 2
}
});
Expand Down
1 change: 1 addition & 0 deletions routes/submit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const qs = require("querystring");
const { season } = require("../config.json");

function escapeHTML(htmlStr) {
return String(htmlStr)
Expand Down

0 comments on commit c633c3d

Please sign in to comment.