This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sourcegraph Cloud is the easiest way for organizations to get started with Sourcegraph. | |
└── Small-to-medium organizations can search across their code together on Sourcegraph Cloud. | |
└── Individual users can search across their private code on Sourcegraph Cloud. | |
└── Sourcegraph team members can search across their private code on Sourcegraph Cloud. | |
└── Individual users can search across their public code on Sourcegraph Cloud. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const card = { cost: [{count: 2, type: 'r'}, {count: 2, type: 'any'}, {count: 1, type: 'w/r', hybrid: true}] }; | |
const availableMana = [{count: 4, type: 'r'}, {count: 2, type: 'w'}, {count: 1, type: 'w/r', hybrid: true}]; | |
function hasEnoughMana(cost, availableMana) { | |
// If it requires more mana than is available in the first place | |
return cost.reduce((total, obj) => total + obj.count)) > cost.reduce((total, avail) => total + avail.count); | |
} | |
function hasRequiredMana(cost, availableMana) { | |
// Return if the available mana matches the required mana |