+ 1

My code isn't working

I have a code named Rock Paper Scissors if you go into my code you can probably see what I'm trying to do, but it's not working. Can anyone help?

3rd Sep 2017, 10:34 PM
Joe Shanahan
Joe Shanahan - avatar
8 Answers
+ 10
Here are some examples of how other people have done this. There are quite a few more examples available in code playground. https://code.sololearn.com/WgPP67N1gOvV/?ref=app https://code.sololearn.com/Wrwx0eGihcjk/?ref=app https://code.sololearn.com/W5l9EalQRLh9/?ref=app
3rd Sep 2017, 10:48 PM
jay
jay - avatar
+ 9
https://code.sololearn.com/WbtcMJiUSLE4/?ref=app Is this the code you refer to in your question?
3rd Sep 2017, 10:36 PM
jay
jay - avatar
+ 7
You're making conditions by using the "h" variable defined inside these functions: function rock() { h=1 } function paper() { h=2 } function scissors() { h=3 } ... but you did not call these functions in your code. [ Edit ] Guys i think he is aware of the <script> tag, that's why he assigned a color to his HTML content... The problem is the Js itself, it wouldn't work with or without that HTML. ^^
3rd Sep 2017, 10:45 PM
Maz
Maz - avatar
+ 2
Yes
3rd Sep 2017, 10:42 PM
Joe Shanahan
Joe Shanahan - avatar
4th Sep 2017, 10:30 AM
Carlos Castro
Carlos Castro - avatar
0
there is no html..you repeat js code on html check it out..
3rd Sep 2017, 10:47 PM
Mima_nf
Mima_nf - avatar
0
use <script> tag or write those codes on js not html
3rd Sep 2017, 10:49 PM
Ahmet Turan
Ahmet Turan - avatar