-
Notifications
You must be signed in to change notification settings - Fork 208
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
Leonardo Lodi #203
base: main
Are you sure you want to change the base?
Leonardo Lodi #203
Conversation
const points = { | ||
a: 1, | ||
e: 1, | ||
i: 1, | ||
o: 1, | ||
u: 1, | ||
l: 1, | ||
n: 1, | ||
r: 1, | ||
s: 1, | ||
t: 1, | ||
d: 2, | ||
g: 2, | ||
b: 3, | ||
c: 3, | ||
m: 3, | ||
p: 3, | ||
f: 4, | ||
h: 4, | ||
w: 4, | ||
v: 4, | ||
y: 4, | ||
k: 5, | ||
j: 8, | ||
x: 8, | ||
q: 10, | ||
z: 10 | ||
} |
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 points = [{ letter: 'a', value: 1 }, { letter: 'b', value: 1 }]
const points = {
'1': ['a', 'e', 'i']
}
} | ||
|
||
const increase = (multiplier, value) => { | ||
return (multiplier *= value) |
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.
Remove ( )
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 multiplier *= value
|
||
for (let i = 0; i < word.length; i++) { | ||
if (word[i] in brackets) { | ||
multiplier = checkBrackets(word[i], multiplier) |
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.
multiplier = brackets[word[i]]
const checkBrackets = (bracket, multiplier) => { | ||
if (bracket === '{') { | ||
return increase(multiplier, 2) | ||
} else if (bracket === '[') { | ||
return increase(multiplier, 3) | ||
} else if (bracket === '}') { | ||
return decrease(multiplier, 2) | ||
} else if (bracket === ']') { | ||
return decrease(multiplier, 3) | ||
} | ||
} |
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.
Redundant function (see below)
No description provided.