0
having trouble adding js to my game
HELP!
10 Respuestas
+ 4
Can you explain in detail whats your problem??
+ 1
hey thanks for the reply mehta!
Is on my game "Rock Paper Scissors", seems like the code I plugging isn't right. the code I'm trying to configure is for the user and computer score to work, to tell is time the user or computer wins. I'll put my project on public so you and anyone can take a look ok. I'll write you the code I'm trying to configure maybe I'm not writing correctly.
+ 1
I've fixed all bugs in your code.
Check it out: https://code.sololearn.com/WdkPpDXOk5eG/?ref=app
+ 1
are you serious? wow thank you so much! sorry I'm a beginner. I appreciate your help.
+ 1
No problem man, i am to pleased to help you. Just keep practicing. Beleive me, you write really nice code as a beginner. And yes you can ask me any question anytime. And also you don't have to link css and javascript in sololearn app, because sololearn automatically link that stuff But if you are working on some kind of ide then you have to link css and js with link and script tag.😊
0
this is the code I'm trying to configure in js
function game(userchoice) {
const computerChoice = getComputerChoice();
switch (userchoice + computerChoice) {
case "rs":
case "pr":
case "sp":
break;
win();
}
}
function main() {
rock_div.addEventListener('click',function (){
game ("r");
})
paper_div.addEventListener('click',function (){
game ("p");
})
scissors_div.addEventListener('click',function (){
game ("s");
})
0
please give yourself credit too. couldn't work without your help my friend.
0
mehta,
so I when over the fixes you made, saw that you do not need a <script js.</script> in this app. I thought we needed to specify this. also you use variables in js. overall I want to thank you, I see I was over thinking this to much- I'm learning through my note++ on my computer, but I see this app is already link to ccs and java. again, thank you so much. will be asking you more questions if you don't mind.
0
thank you, and I'll be coding more often. I made the game public gave you credits. thanks.
0
hey mehta, I updated the game, check it out. is not much of an upgrade but is something lol