-
Notifications
You must be signed in to change notification settings - Fork 60
Outline of pizza cube maximizer #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
(toSlot(item) === $slot`familiar` | ||
? mallPrice($item`box of Familiar Jacks`) | ||
: 0) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't get multiple jacks from having multiple familiar items unfortunately
(acc, it) => acc + calculateItemValue(it, effect), | ||
0, | ||
); | ||
const cost = pizzaItems.reduce((acc, it) => acc + mallPrice(it), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const cost = pizzaItems.reduce((acc, it) => acc + mallPrice(it), 0); | |
const cost = sum(pizzaItems, mallPrice); |
const benefit = pizzaItems.reduce( | ||
(acc, it) => acc + calculateItemValue(it, effect), | ||
0, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const benefit = pizzaItems.reduce( | |
(acc, it) => acc + calculateItemValue(it, effect), | |
0, | |
); | |
const benefit = sum(pizzaItems, (it) => calculateItemValue(it, effect)); |
value: calculateItemValue(item, effect), | ||
})); | ||
|
||
return maxBy(itemsWithValues, (entry) => entry.value).item; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return maxBy(itemsWithValues, (entry) => entry.value).item; | |
return maxBy(itemsWithValues, "value").item; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fwiw if you aren't using the values outside of the maxby it makes more sense to not do the map at all and to instead just ```typescript
return maxBy(items, (it) => calculateItemValue(it, effect));
No description provided.