Triangle / Peg Solitaire Solver Programming Software Development by zekish …, all. I am in the process of writing a peg solitaire solver in Python. It will allow the user to select… might do this. I know other people have written peg solitaire solvers. Some have actually explicitly created tree data structures to… Need Help Moving cards on solitaire Programming Software Development by aimmnrsy hi, i have to create a solitaire game, i'm having trouble moving cards, if i move one the program will repaint it but will replace the moved card with another one if you try to move another card from a different pile. the code i currently have for this project is attached Memory game (Solitaire) Programming Software Development by nader_shadi2002 … the forum members. So I have project of memory game (Solitaire). I try many times writing the code, but I guess… Text based solitaire game for windows and linux Programming Software Development by _Nestor This is a text based solitaire game I wrote. It tested it on Ubuntu Linux and Windows and it worked okay for me. Move cards between rows using their row number (7 for the deck) Let me know what people think. Critiques welcome..... don't be too harsh ;) Recursion problems in solitaire Programming Software Development by patrick k …, I'm trying to write a program to simulate a solitaire game that my math teacher showed me so that I… Pairs in Middle Suits in End Solitaire Programming Software Development by TrustyTony One solitaire game practice until the first win or 'q' after game. Re: Recursion problems in solitaire Programming Software Development by TrustyTony You might be interested that I [URL="http://www.daniweb.com/software-development/python/code/366973/1574999#post1574999"]posted in Python forum[/URL], pure chance of course ;), very similar solitaire game. It could give ideas how to structure your C program. Text based English Solitaire from Wikipedia Programming Software Development by TrustyTony Got inspired to make computer to make moves in English Solitaire, I learned in childhood days to solve by myself consistently, … Re: MS-Solitaire Community Center Geeks' Lounge by mattyd I love MS-Solitaire. When all other modern video games fail me and my system is overloaded due to the heavy graphics, I can always depend on this game to satisfy my gaming craving while actually exercising my brain. I often play this before or on breaks from coding to get my brain back in logical shape. solitaire tableau! Programming Software Development by Roberto9 so what i have is a list of lists each individual list is a list of cards cards1 = [AS, 10H, 3D, ...ect.] cards2 = [4H, KS, 6S, 9D,....ect] ColumnList = [cards1, cards2, cards3...etc] It should print out a spider solitare tableau, but as you play the game, this columns become different lengths ex: tableau: 1 2 3 … Re: solitaire tableau! Programming Software Development by Gribouillis If you are using python >= 2.6, you could use the Tabular class from this post [url]http://www.daniweb.com/code/snippet232375-2.html#post1025743[/url] . Here is an example use [code=python] from tabular import Tabular from random import randint suits = "CDHS" cvalues = list("AKQJ") + list(str(i) for i in range(2, 11)) deck =… Re: solitaire tableau! Programming Software Development by Roberto9 thanks a lot! is there any way to do it without using tabular? Re: solitaire tableau! Programming Software Development by hondros The escape character "\t" for tabs works wonders ;) Re: solitaire tableau! Programming Software Development by TrustyTony [QUOTE=hondros;1182396]The escape character "\t" for tabs works wonders ;)[/QUOTE] You mean like this: [CODE]import random suits = "CDHS" cvalues = list("AKQJ") + list(str(i) for i in range(2, 11)) deck = ([cv + cs for cs in suits for cv in cvalues]) columns =[list() for i in range(10)] ## real dealing … Re: Triangle / Peg Solitaire Solver Programming Software Development by TrustyTony As I see, you are not getting any use out of your recursion, no modified self variables or using a return value from recursion (and actually no returned value in any case). And you should have one stack to keep saved states not new each time or I do not understand what you are doing. Did you do your algorithm by hand for some simple end game … Re: Triangle / Peg Solitaire Solver Programming Software Development by Gribouillis I don't have the time to study your code now (the whole program could be useful) but I think it could be a use case for this snippet that I wrote some weeks ago [url]http://www.daniweb.com/software-development/python/code/395270[/url] . See if it applies to your problem. Re: Triangle / Peg Solitaire Solver Programming Software Development by zekish [QUOTE=pyTony;1724462]As I see, you are not getting any use out of your recursion, no modified self variables or using a return value from recursion (and actually no returned value in any case).[/QUOTE] I had a version where I was popping from the temp stack and undoing board updates but that wasn't working right, either. I was able to get it to… Re: Triangle / Peg Solitaire Solver Programming Software Development by zekish [QUOTE=Gribouillis;1724463]I don't have the time to study your code now (the whole program could be useful) but I think it could be a use case for this snippet that I wrote some weeks ago [url]http://www.daniweb.com/software-development/python/code/395270[/url] . See if it applies to your problem.[/QUOTE] It might but it's quite a bit to read … Re: Triangle / Peg Solitaire Solver Programming Software Development by woooee [code] def move(self, board, temp_stack): if board.game_end(): [/code]What does the function game_end test? Definitely not new_board or new_stack since they are not instance variables and are not passed to the function, so the game_end function is testing some container that does not change. Add a print statement to the function to … Re: Triangle / Peg Solitaire Solver Programming Software Development by zekish [QUOTE=woooee;1724522][code] def move(self, board, temp_stack): if board.game_end(): [/code]What does the function game_end test? Definitely not new_board or new_stack since they are not instance variables and are not passed to the function, so the game_end function is testing some container that does not change. Add a print … Re: Triangle / Peg Solitaire Solver Programming Software Development by woooee Is "board" a class instance with a function named "game_end" or some other container, as a class instance can not be tested, but only a container in that class can contain moves. Perhaps you should include the end_game function as well as the code that creates the instance of the class board. [code] def move(self, board, … Re: Triangle / Peg Solitaire Solver Programming Software Development by zekish [QUOTE=woooee;1724595]Is "board" a class instance with a function named "game_end" or some other container, as a class instance can not be tested, but only a container in that class can contain moves. Perhaps you should include the end_game function as well as the code that creates the instance of the class board. [code] def … Re: Memory game (Solitaire) Programming Software Development by cbarton.a nader_shadi2002, You are correct in that we like you to attempt the problem and let us lead you to the light. Saying that you have tried many times at it is great news and makes you unlike most participants in the forums, however if you post some code we can point you in the right direction. First off your using GUI so make sure you have a … Re: Text based solitaire game for windows and linux Programming Software Development by _Nestor One line of needs to be changed. In the print deck function of Deck.cpp the .GetBlackjack function should be removed as the function no longer exists Re: Recursion problems in solitaire Programming Software Development by TrustyTony I think you have infinite loop with recursions, as you do not return the result of the recursive calls. Re: Recursion problems in solitaire Programming Software Development by patrick k Ok. Does that mean that the problem will be fixed simply by making sure to return a value with each call? Re: Recursion problems in solitaire Programming Software Development by TrustyTony You should simpify also your control structure, let's say call in line 69 returns value 1 or 0, what happens then. You seem to do the iteration both with while and recursion, write down your algorithm and check the logic. Test with almost finished pack of cards (end game) by hand (both before writing the new version of the function and after … Re: Recursion problems in solitaire Programming Software Development by patrick k Recursion is not a requirement. My only question if I use something other than recursion is how to ensure that the function can continue testing. The use of the while loops is mainly to reposition the x and y pointers so that it is set up for the next function call. Is there a way that I could modify them so that I could avoid the recursion … Re: Recursion problems in solitaire Programming Software Development by patrick k I came up with an idea that might have some potential, but it isn't working the way I thought it would. As opposed to recursively calling the function, I had the function return a -1 where I previously had the recursive calls. Then I changed the game function so that whenever it received a -1, it called the test function again. I think this should … Re: Recursion problems in solitaire Programming Software Development by patrick k I looked at it, and I think it could help some. There are a few things I don't quite understand about it though. The most complicated part of what I have so far seems to be moving the pointers after some cards have been taken out. I think (correct me if I'm wrong) that instead of doing that the way I did, the Python program you have deleted the …