0
syntax error
Hi all, I have written this code : https://code.sololearn.com/cSWeIr773Vmx but I don't know why I receive Error: syntax error: cannot use points += 3 as value
1 Answer
+ 1
Hello, I have solved your problem and I have never even programmed in Go before! I love these kinds of questions as they encourage me to push outside my normal space but I digress. Anyways, you need to use parenthesis and closing brackets in your if else statement.
How you currently have it:
if v =="w"
points +=3
else if v=="d"
points +=1
How it should be:
if (v =="w"){
points +=3
}else if (v=="d"){
points +=1
}