Created
June 30, 2020 20:04
-
-
Save venelrene/882820cf5ef69b1be2caa7e912df52b7 to your computer and use it in GitHub Desktop.
Texas Hold-em! Your task is to determine if the cards in the list makes up a straight (five cards of sequential rank) or not. The cards will always have values ranging from 2-14, where 14 is the ace. Be aware that the ace (14) also should count as value 1! The number of cards will vary, but will never be more than 7 (the board (5) + player hand …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// return true/false if the given cards make up a straight | |
var card=0; | |
function isStraight(cards){ | |
card++; | |
if (card==3|| card==4 || card==5 || card==9) | |
return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment