Skip to content

Comments

Leonardo Lodi#203

Open
LeonardoSaraceli wants to merge 2 commits intoboolean-uk:mainfrom
LeonardoSaraceli:main
Open

Leonardo Lodi#203
LeonardoSaraceli wants to merge 2 commits intoboolean-uk:mainfrom
LeonardoSaraceli:main

Conversation

@LeonardoSaraceli
Copy link

No description provided.

Comment on lines +1 to +28
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
}
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ( )

Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiplier = brackets[word[i]]

Comment on lines +45 to +55
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)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant function (see below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants