Skip to content

Commit

Permalink
v. 0.16 - fixed bug #10
Browse files Browse the repository at this point in the history
quandyfactory committed Sep 22, 2011
1 parent 0e3b4ff commit 49d42a1
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -19,11 +19,15 @@ Released under the GNU General Public Licence, Version 2: [http://www.gnu.org/li

### This Version

* Version: 0.15
* Release Date: 2011-04-11
* Version: 0.16
* Release Date: 2011-09-21

### Revision History

* Version: 0.16
* Release Date: 2011-09-21
* Changes: Fixed [bug #10](https://github.com/quandyfactory/Solitaire/issues/10).

* Version: 0.15
* Release Date: 2011-04-11
* Changes: Fixed [bug #9](https://github.com/quandyfactory/Solitaire/issues/9).
15 changes: 13 additions & 2 deletions js/game.js
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ var _sol = {
vals: 'A 2 3 4 5 6 7 8 9 10 J Q K'.split(' '),
zIndex: 51, // initialize zIndex so we can always put cards on top of each other
score: 0, // increment by 1 each time you put a card on the foundation, decrement by 1 when you remove a card
debugMode: false, // set to true to send details to console.log
debugMode: true, // set to true to send details to console.log
deck: [],
history: []
};
@@ -558,8 +558,19 @@ function dragStop() {
&& under_card.location == 'foundation' // card is in foundation
&& this_card.suit == under_card.suit // same suit
&& this_card.valNum == under_card.valNum + 1 // card must be one more than card under
&& this_card.location != 'foundation' // no double-points for cards already in foundation
) {
moveFoundation('', this_card.id, under_card.id);
// nudging a card that is already on a card on the foundation
} else if (
under_card.face == 'up' // card under must be face up
&& under_card.location == 'foundation' // card is in foundation
&& this_card.suit == under_card.suit // same suit
&& this_card.valNum == under_card.valNum + 1 // card must be one more than card under
&& this_card.location == 'foundation' // no double-points for cards already in foundation
) {
$(this).css('top', this_card.posY).css('left', this_card.posX);
notify('The ' + displayVal(this_card.val) + ' of ' + displaySuit(this_card.suit) + ' is on the ' + displayVal(under_card.val) + ' of ' + displaySuit(under_card.suit) + '.');
// card isn't turned up
} else if (under_card.face == 'down') {
$(this).css('top', this_card.posY).css('left', this_card.posX);
@@ -618,7 +629,7 @@ function dragStop() {
$(this).css('top', this_card.posY).css('left', this_card.posX);
notify('You cannot place a card elsewhere on the board.');
}
log('in dragStop(); elem_id=' + elem_id + ', ' + pos.left + ', ' + pos.top);
log('in dragStop(); elem_id=' + elem_id + ', pos.left=' + pos.left + ', pos.top=' + pos.top);
$('#' + this_id).css('display', 'block'); // restore visibility after hiding
}

0 comments on commit 49d42a1

Please sign in to comment.