Skip to content

Instantly share code, notes, and snippets.

@risingBirdSong
Created December 29, 2019 03:33
Show Gist options
  • Save risingBirdSong/1a9f490fc9f08bd107af58d73552bb5a to your computer and use it in GitHub Desktop.
Save risingBirdSong/1a9f490fc9f08bd107af58d73552bb5a to your computer and use it in GitHub Desktop.
code war kata "points"
function points(games : string[]){
let ourpoints = 0;
games.forEach((val) => {
let split = val.split(":"); //?
if (split[0] > split[1]){
ourpoints += 3
}
else if (split[0] == split[1]){
ourpoints += 1
}
})
return ourpoints
}
points(['1:0','2:0','3:0','4:0','2:1','3:1','4:1','3:2','4:2','4:3']) //?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment