+ 3

What's wrong with this code it doesn't run in but it works fine in my PC weirdđŸ€”

https://code.sololearn.com/W8qsybl22nrL/?ref=app

5th Aug 2022, 1:05 AM
Samuel Tadele
Samuel Tadele - avatar
15 Answers
+ 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)
5th Aug 2022, 1:33 AM
Ipang
+ 1
That means the problem is with sololearn's platform not the code?
5th Aug 2022, 1:24 AM
Samuel Tadele
Samuel Tadele - avatar
+ 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 : )
5th Aug 2022, 1:52 AM
Ipang
+ 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 ...
5th Aug 2022, 2:00 AM
Ipang
+ 1
Good game idea
6th Aug 2022, 8:14 PM
emma
emma - avatar
0
Thanks for your feedback!
5th Aug 2022, 1:28 AM
Samuel Tadele
Samuel Tadele - avatar
0
the typos are my mistake but null nah it works it doesn't show null error or any thing
5th Aug 2022, 1:47 AM
Samuel Tadele
Samuel Tadele - avatar
0
Jah i think you right
5th Aug 2022, 1:54 AM
Samuel Tadele
Samuel Tadele - avatar
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
5th Aug 2022, 1:57 AM
Samuel Tadele
Samuel Tadele - avatar
0
Okay! thanks for your advice thou😊
5th Aug 2022, 2:02 AM
Samuel Tadele
Samuel Tadele - avatar
0
Sup
5th Aug 2022, 6:33 PM
Duquan Mccain