Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove obsolete myfunctions.js file

  • Loading branch information...
commit e5692aa6aa50c24c74fab0bcf24fd5a21f8dc17c 1 parent 34aa2c8
James Gater authored
Showing with 0 additions and 30 deletions.
  1. +0 −30 myblackjack/myFunctions.js
View
30 myblackjack/myFunctions.js
@@ -1,30 +0,0 @@
-// shuffle an array function
- exports.shuffle = function(array) {
- var tmp, i, j;
- for ( i = array.length - 1 ; i ; i-- ) {
- j = Math.floor(Math.random() * (i + 1));
- tmp = array[j];
- array[j] = array[i];
- array[i] = tmp;
- }
- return array;
- };
-
-// Our deal function will return the last card(s) from the deck
- exports.deal = function(cardsToDeal,hand,deck) {
- if (!hand) {hand = [];}
- for (i=0;i<cardsToDeal;i++) {
- hand.push(deck.pop());
- }
- return hand;
- };
-
-// Score the hand
- exports.score = function(hand) {
- var totalScore=0;
- for (var mycard in hand) {
- totalScore += hand[mycard].value;
- }
- return totalScore;
- };
-
Please sign in to comment.
Something went wrong with that request. Please try again.