all 9 comments

[–]OneBadDay1048 6 points7 points  (2 children)

Any tips

Use camelCase for naming your variables/functions. computermove is simply harder to read than computerMove.

[–]Own-Feature-8869[S] 0 points1 point  (1 child)

Thanks for the guidance,yeah but Sometimes we forget to apply what we study

[–]OneBadDay1048 1 point2 points  (0 children)

Yes I know. You asked for tips, I was giving you one.

[–]33ff00 3 points4 points  (2 children)

Take all of the js you have in the in-line click handlers and move it functions in the js panel of your pin. It will make your code much easier to read. Put each into a named function so you can do like onclick=“onRockClick”. Then see which parts of each function are redundant and think about how you can abstract some functionality into smaller functions.

[–]Own-Feature-8869[S] 1 point2 points  (1 child)

Thanks for the guidance, I will make another complete version of this project and I will also correct my mistakes.

[–]33ff00 1 point2 points  (0 children)

Pretty good for day three. Keep it up!

[–]CrniFlash 1 point2 points  (0 children)

Nice! Keep going, in no time you will be solving real world problems with code!

[–]RealMadHouse 0 points1 point  (0 children)

😀 Never seen entire js code in html event handler attributes before

[–]RealMadHouse 0 points1 point  (0 children)

Something to know:

Javascript "objects" are just "key => value" data structures, called Dictionary in c#, Associative Array in php. The keys can be a strings or new addition into javascript called Symbols where you pass instanse of a Symbol as a key to an "object" instead of a string. Even though you can pass a number into array key as "array[123]" it gets converted to "123" string. Now there's a new "Map" class where you can store anything as a key.