+ 3
What's wrong with this code it doesn't run in but it works fine in my PC weird🤔
15 odpowiedzi
+ 7
Glad to be of assistance. 😁
+ 4
If you run the code using SoloLearn mobile app, then you need to wrap your code in JS section inside "load" event handler.
Why? read here
https://www.sololearn.com/post/90825/?ref=app
window.onload = () =>
{
// your code goes here
}
I also noticed some typos in JS section. Are you sure it works fine in your PC? if it did, then I find it weird as well.
Line 22:
squar -> square
Line 58:
origBord -> origBoard
Line 78:
aiplayer -> aiPlayer
Line 81:
avialSpots -> availsSpots
Line 85, 87, 88, 99:
availSpots -> availsSpots
Line 92, 96:
result.score is not recognised
Line 101:
move.push(move) -> moves.push(move)
+ 2
Yes, their not interpreting the code properly/maybe they don't support the use of .style or just .display. I'd have to run some tests to actually be sure of it.
+ 1
The problem is in the JavaScript
document.querySelector(".endgame").style.display = "none";
Is not working, I'm pretty sure it's saying that it can't find .endgame class
or that .display is an invalid property.
+ 1
That means the problem is with sololearn's platform not the code?
+ 1
Samuel,
By that statement, you claim the code (with all the typos in it) works fine in your PC? is that it?
By right those typos should trigger the generation of error messages in console. It is weird if the code with those typos runs just fine.
I guess you can now cease pointing finger at SoloLearn : )
+ 1
Samuel,
One lesson learned. Next time, please post the code in original form to avoid misunderstanding. Just copy/paste the code as is.
Good day ...
+ 1
Good game idea
0
Thanks for your feedback!
0
the typos are my mistake but null nah it works it doesn't show null error or any thing
0
I've read the post he listed and from what I've seen it's because Sololearn interprets the code differently from your normal browser, also yes the typos are a problem.
0
Jah i think you right
0
Ipang: not with the typos the typos are my mistake when i wrote it on sololearn playground in my PC there are no typos everything is right no typo mistake
0
Okay!
thanks for your advice thou😊
0
Sup