Pretty good. I played it a few times but couldn't beat it either.
Just a minor suggestion: gameplay would 'feel' better if you could actually drag the cards with the mouse.
It seems as if I regain my previous card when I put one down, so say I draw a 7 of hearts, then an 8 of spades, if I put the 8 down, I see the 7 again, that's not how it's supposed to work, there should be 3 cards drawn!
bartbes wrote:that's not how it's supposed to work, there should be 3 cards drawn!
This is 'Vegas' style solitaire where only 1 card is drawn at a time and they do not rotate once you've drawn all of them.
Maybe it's just me, but I find this style of solitaire much more exciting then when 3 cards are drawn.
I can see why no-one won yet. The diamonds 5 is missing.
And I think you know why. In your code, I can see you counting from 0 in your numeric indices for tables. However, Lua counts from 1. I think something went wrong there.
EDIT: just to be clear, in this case diamonds 5 was missing, but I think it is a different card each time, either because it is at location 0, when Lua starts with 1, or at location #table, and you only count to #table - 1.
EDIT 2: also, I see a few instances of "pairs" where you should use "ipairs".
And thanks for taking the time to look at the code. I didn't know about ipairs. You were right about the problem, the shuffle function was nuking one of the cards.
Yep, nothing happens when you win. A couple of things:
Could you track/show the number of moves?
And could you remove the ".lua" from line 2 of main.lua? It won't run in the next version of Love if its there.
Also, moving cards from the "finished" stack back into the play area can be a bit tricky. Occasionally you need to resort, so it's something you should probably code an exception for.
tentus wrote:Could you track/show the number of moves?
What should I consider a move? I'm thinking of omitting moving to the foundations.
And could you remove the ".lua" from line 2 of main.lua? It won't run in the next version of Love if its there.
Done, thanks.
Also, moving cards from the "finished" stack back into the play area can be a bit tricky. Occasionally you need to resort, so it's something you should probably code an exception for.
Can you elaborate? It seems to work fine for me.
Robin wrote:Happy to help.
It works much better, and now the game is winnable.