From 44a89c74058f7ad45ad60ec9675f7a86a1deebed Mon Sep 17 00:00:00 2001 From: patriciarealini Date: Sat, 12 Sep 2015 14:40:38 -0700 Subject: [PATCH] created randomOrient function to randomly determine if a card should be dealt upside down or upside up & integrated it into the dealCard function --- index.html | 24 +++++++++++++----------- main.js | 28 +++++++++++++++++++++------- stylesheet.css | 18 ++++++++++++++++-- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/index.html b/index.html index f57b49a..64a9996 100644 --- a/index.html +++ b/index.html @@ -10,18 +10,20 @@ -
-

ARCANA

-

Click on the deck

+
+
+

ARCANA

+

Click on the deck

-
- deck of cards -
- -
-
-
-
+
+ deck of cards +
+ +
+
+
+
+
diff --git a/main.js b/main.js index bf285c1..5293899 100644 --- a/main.js +++ b/main.js @@ -97,6 +97,11 @@ var random = function() { return Math.round(Math.random() * (77-cardsDealt)); }; +// create a function to randomly determine if the card will be oriented up or down, if randomOrient returns 0, do nothing. if randomOrient returns 1, rotate the card at a 180 degree angle. +var randomOrient = function() { + return Math.round(Math.random()); +}; + //create a function to remove a card once it has been used. This is a basic way to avoid duplicates. Implies that to deal we must refresh the page. var removeCard = function(k) { for (var j=k; j