{"id":27329448,"url":"https://github.com/csirmaz/basicsolitaire","last_synced_at":"2026-01-21T13:31:27.682Z","repository":{"id":24173599,"uuid":"27564099","full_name":"csirmaz/BasicSolitaire","owner":"csirmaz","description":"Classic Solitaire with autoplay written a long time ago (QBasic)","archived":false,"fork":false,"pushed_at":"2025-08-12T22:07:40.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-12T23:34:03.635Z","etag":null,"topics":["card-game","dos","qbasic","solitaire"],"latest_commit_sha":null,"homepage":"","language":"QuickBASIC","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csirmaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-04T22:58:38.000Z","updated_at":"2025-08-12T22:07:43.000Z","dependencies_parsed_at":"2022-08-26T06:42:33.157Z","dependency_job_id":null,"html_url":"https://github.com/csirmaz/BasicSolitaire","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/csirmaz/BasicSolitaire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csirmaz%2FBasicSolitaire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csirmaz%2FBasicSolitaire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csirmaz%2FBasicSolitaire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csirmaz%2FBasicSolitaire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csirmaz","download_url":"https://codeload.github.com/csirmaz/BasicSolitaire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csirmaz%2FBasicSolitaire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["card-game","dos","qbasic","solitaire"],"created_at":"2025-04-12T12:33:31.199Z","updated_at":"2026-01-21T13:31:27.677Z","avatar_url":"https://github.com/csirmaz.png","language":"QuickBASIC","funding_links":[],"categories":[],"sub_categories":[],"readme":"BasicSolitaire\n==============\n\nClassic Solitaire with autoplay written a long time ago in QBasic\n\n![screenshot](https://www.postminart.com/cdn/solit.gif)\n\nI uploaded this old project as it contains an algorithm to play classic solitaire\nthat might be interesting, although the code is a bit messy.\n\nDownload the compiled version\n[here](https://www.epcsirmaz.co.uk/binary/solit.exe) -\nyou can use [DosBox](http://www.dosbox.com/) to run it.\n\n# DOCUMENTATION\n\n## Contents\n\n* 1. Rules of Classic Solitaire\n* 2. Playing Solitaire with the Program\n   * 2.1. Initialization\n   * 2.2. Functions\n   * 2.3. The table\n        * 2.3.1. Possible cards \u0026 How to insert cards from the deck or from 'out'\n        * 2.3.2. Cards that can be moved out \u0026 How to move out a card\n        * 2.3.3. Cards that can be moved now \u0026 How to move a card\n        * 2.3.4. Cards that can be made movable\n   * 2.4. Further moves: inserting Kings from the deck \u0026 revealing a card\n   * 2.5. Command line arguments\n* 3. Technical Info\n   * 3.1. System requirements\n   * 3.2. Data files\n   * 3.3. Game numbers\n\n\n## 1. Rules of Classic Solitaire\n\nAt the beginning of each game, 28 cards are dealt on the table\nin 7 columns, face down, except for the lowermost cards, which are placed face\nup. The number of cards in each column equals the number of the column, so\nthere is one card in the first, are two cards in the second column, etc. The\nrest of the cards are left in the deck.\n\nDuring a game of classic solitaire, you can make the following moves:\n\n* a. Revealing a card. If there is no card under a card placed face down, you\nhave the option of flipping it over and use it afterwards to form ordered\ncolumns.\n\n* b. Moving cards out. There are four places on the table marked 'out'. Aces\ncan be immediately moved there; any other card can be moved out if and only\nif the card of the next smaller value of the matching colour has been already\nmoved out. That is, you can move cards out in the following order: A-2-3-4-\n5-6-7-8-9-10-J-Q-K. The topmost cards moved out can be taken back to the\ntable.\n\n* c. Moving a card or an ordered column. A card placed face up can be moved to\nunder another card also placed face up if the card moved is of the next\nsmaller value and of the opposite colour (that is, you can place black cards\nbelow red ones and red cards below black ones). For example, you can put\nHearts 3 under Spades 4. Also, you can move Kings to empty columns.\n\n   Moreover, with this method, you may move entire columns of cards placed face\nup, that is, which are ordered according to the above rules. In this case,\nthe value and the colour of the topmost card determines whether the move is\nlegal.\n\n   Kings and columns starting with kings can be moved to empty columns.\n\n* d. Inserting a card from the deck. You can insert a card from the deck to\nunder a face-up card according to the above described rules. For example, if\nHearts J is the lowermost card in a column, then you may put Club 10 from the\ndeck under it. Also, you can place Kings from the deck on the top of empty\ncolumns.\n\n* e. Inserting a card previously moved out. The topmost cards on the four 'out'\npositions can be moved to under a card placed face up on the table, according\nto the described rules.\n\nThe goal is to reveal all the cards, or (which is an equivalent task), to\nmove all cards out.\n\n## 2. Playing Solitaire with the Program\n\n### 2.1. Initialization\n\nIf you run the program for the first time, it will ask for your preferred\nlanguage. Choose English (press '1' and then ENTER).\n\nIf you deal a table for the first time, the program will notify you about\na missing file storing the next game number. By default, choose the first\noption (press '1' and ENTER), or follow instructions on-screen.\n\n### 2.2. Functions\n\nWhen the program starts, no game has been dealt yet on the table. Both\ndealing a new table and loading a previous one are among the various\nfunctions of the program, which are listed below.\n\nAll functions can be activated by the keyboard.\n\nName  |       Key  |     Description\n--- | --- | ---\nQuit   |     ESC  |     Press ESC to leave the game.\nDeal   |     D   |      Press 'd' to deal the next table. In the bottom right corner of the screen, the program prints out the number of the current game. This number can be used to reload the game later. Cards are dealt in a totally random method, unlike, it seems, the way the Windows solitaire program deals the table.\nLoad game |  L |        Press 'l' to load a previous table. Simply give the game number and press ENTER.\nUndo      |  U  |       Press 'u' to take back the last move unless it was revealing a face-down card. Only the last move can be taken back this way.\nRestart   |  R  |       Press 'r' the restart the current game.\nMark game |  M  |       In order to keep track of solvable/unsolvable games, the program has the option of marking the current game as Solved, Hopeless or TryAgain by pressing key 'm'. The program will create a directory named 'SOLUTION' and will create a null-length file for each game. The name of the file is determined as follows: the first eight characters denote the game number, the extension marks whether it is solved (SLD), hopeless (HLS) or TryAgain (TRY). Marking a game again will overwrite the previous mark. The program also places a '0README.TXT' in the directory describing its function and the extensions.\nShow hidden cards |       S |        Pressing 's' will show/hide the cards placed face down. This option is useful when you need to decide which card to reveal and you want to know desperately whether the actual game can be solved at all. Naturally, according to the originial rules of classic solitaire, this is cheating, as is Restart.\nAutoplay   | A,W  |     There is a strategy programmed into the game which can solve some of the games. Pressing 'w' will make the program do one move according to its strategy, while pressing 'a' will make it follow its strategy as far as it can. When it stops, the game requires your intervention to be solved, or it's stuck.\nColour cards according to parity |      P |        This option is intended to make life easier: pressing 'p' will make the program colour the cards in a way that red cards are placed on red ones and black cards on black ones. Practically, it means that cards A,3,5,7,9, J,K are displayed using the opposite colour. Pressing 'p' again will deactivate this feature.\n\n### 2.3. The table\n\nOnce a game has started, the program places many marks on the table to make\nplaying solitaire easier. (Note that solving a game can be hard enough even\nwith these helpers.) Many of the following notations are explained briefly\non the right side of the screen.\n\n#### 2.3.1. Possible cards \u0026 How to insert a card from the deck or from 'out'\n\nUnder actual cards (printed with white or cyan background), there might\nbe other cards listed of descending value, with green background. These\ncards, at the moment, are in the deck or 'out', but can be inserted under\nthe lowermost card in the noted order. If there are two symbols printed\nto the left of a number, then both cards are available.\n\nTo insert such a card, click on the symbol (colour) of the desired card\nwith the left button of the mouse. Only the topmost possible-card can be\ninserted in a given column.\n\n#### 2.3.2. Cards that can be moved out \u0026 How to move out a card\n\nCards which can be moved 'out' have a cyan background both on the table\nand in the deck. Click with the right button of the mouse on a card to\nmove it out.\n\nThe topmost cards 'out' are also noted in the deck, with green background.\n\n#### 2.3.3. Cards that can be moved now \u0026 How to move a card\n\nThere might be arrows to the right of face-up cards. If such an arrow is\nwhite or bright green, then the card (and other cards under it) in question\ncan be moved somewhere else. Simply click on the card to move it. If there\nare more than one places where the card might go, then select from the marked\npossibilities by clicking on one of them.\n\nThe colour of the arrow depends on whether the card is the topmost one or not.\nIf yes, the arrow is bright green in order to call attention to the\npossibility of making a card revealable or creating an empty column.\nOtherwise, the arrow is white.\n\n#### 2.3.4. Cards that can be made movable\n\nIf the arrow next to a card is black, then the card can be made movable\nby inserting some cards from the deck or from 'out'. Imagine, for example,\nthat you have Hearts 5 as the lowermost card in a column, under which the\npossibilities Spades 4 and Diamond 3 are listed. Now the card Spades 2 is\nmarked with a black arrow because if you insert Spades 4 and Diamond 3 from\nthe deck under Hearts 5, then it can be moved there.\n\n### 2.4. Further moves: inserting Kings from the deck \u0026 revealing a card\n\nMany of the possible actions (activating functions, moving, inserting, moving\nout cards) have been described in the previous two sections. All that is left\nto call attention to is that although inserting cards from the deck is\nprimarily done by clicking on possibilities, this is not the case when\ninserting Kings to empty columns from the deck. In these cases, click on the\nKing to be inserted in the deck.\n\nFace-down cards with no cards under them are automatically turned over.\n\n### 2.5. Command-line arguments\n\nThe program tries to load a game if the appropriate game number is given\nas its command line argument.\n\n## 3. Technical Info\n\n### 3.1. System requirements\n\nThe program is MS-DOS compatible and requires mouse.\n\n### 3.2. Data files\n\nThe program creates the following files in the working directory:\n\nName | Function\n--- | ---\nLANGUAGE.SOL |  Stores the chosen language. Delete the file to make the program ask for the desired language again.\nTABLE.SOL    |  Stores the absolute number of the next game.\nSOLUTION\\    |  A directory storing solvability info about the games. See the 'Mark game' function above. Created only if this function is used.\n\n### 3.3. Game numbers\n\nThe game numbers are generated by multiplying the absolute number of the\ngame (always increased by 1) by 1000 and adding a 3-digit-long checksum\nof the cards on the table. If the checksum does not match when loading a\ngame, the program notifies the user and tries to fall back on the closest\ntable, that is, continues using the present table anyway.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsirmaz%2Fbasicsolitaire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsirmaz%2Fbasicsolitaire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsirmaz%2Fbasicsolitaire/lists"}