Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VSCode Schulung
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schwertgen
VSCode Schulung
Compare revisions
67986672b390ab0dffae69ad53426acd5e341ba1 to 8bc199e710a5ae916dacc287f4e3cbab5038bb50
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
david.schwertgen/vscode-schulung
Select target project
No results found
8bc199e710a5ae916dacc287f4e3cbab5038bb50
Select Git revision
Swap
Target
david.schwertgen/vscode-schulung
Select target project
david.schwertgen/vscode-schulung
1 result
67986672b390ab0dffae69ad53426acd5e341ba1
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (3)
add Button dom elements
· 1b3f9f96
Sarah Fiedler
authored
2 months ago
1b3f9f96
add EventListener
· 2f01457e
Sarah Fiedler
authored
2 months ago
2f01457e
Bug Fix Arrow Function
· 8bc199e7
Subliminal Guy
authored
2 months ago
8bc199e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/index.js
+8
-0
8 additions, 0 deletions
game/index.js
with
8 additions
and
0 deletions
game/index.js
View file @
8bc199e7
...
...
@@ -6,6 +6,13 @@ let computerScore = 0;
const
playerScoreElement
=
document
.
getElementById
(
"
player-score
"
)
const
computerScoreElement
=
document
.
getElementById
(
"
computer-score
"
)
const
roundResultsMessage
=
document
.
getElementById
(
"
results-msg
"
)
const
buttonStein
=
document
.
getElementById
(
"
rock-btn
"
)
const
buttonPapier
=
document
.
getElementById
(
"
paper-btn
"
)
const
buttonSchere
=
document
.
getElementById
(
"
scissors-btn
"
)
buttonStein
.
addEventListener
(
"
click
"
,
()
=>
showResults
(
"
Stein
"
));
buttonPapier
.
addEventListener
(
"
click
"
,
()
=>
showResults
(
"
Papier
"
));
buttonSchere
.
addEventListener
(
"
click
"
,
()
=>
showResults
(
"
Schere
"
));
function
getRandomComputerResult
(){
const
number
=
Math
.
floor
(
Math
.
random
()
*
options
.
length
);
...
...
@@ -36,6 +43,7 @@ function getRoundResults(playerChoice){
}
function
showResults
(
playerChoice
)
{
console
.
log
(
"
click
"
)
roundResultsMessage
.
innerText
=
getRoundResults
(
playerChoice
)
playerScoreElement
.
innerText
=
playerScore
;
computerScoreElement
.
innerText
=
computerScore
;
...
...
This diff is collapsed.
Click to expand it.