A generating device for a single-player card game

Through non-random card assignment method and puzzle generation module, the TriPeaks card game puzzle problem that is difficult to generate in the prior art that meets the winning rate requirements is solved, and the puzzle with a stable winning rate is quickly generated.

CN115430128BActive Publication Date: 2025-06-17HANGZHOU NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211084729.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-06
Publication Date
2025-06-17
Estimated Expiration
2042-09-06

AI Technical Summary

Technical Problem

It is difficult to quickly generate TriPeaks card game riddles that meet the winning rate requirements in the existing technology, especially when there are many cards in the table area, the random assignment method results in a low winning rate of the riddle, making it difficult to meet the riddle generation with a certain winning rate requirement.

Method used

The cards in the card table area are assigned in a non-random way, and the puzzle generation module and the puzzle winning rate calculation module are used to generate single-player card game puzzles with different winning rates according to the specified card stacking structure. The specific steps include determining the number of cards in the table area and the trump card area, setting continuous strings and assignment rules, gradually completing the generation of riddles, and calculating the winning rate of the riddles through multiple agent games.

Benefits of technology

It realizes the rapid generation of TriPeaks card game riddles that meet the specified winning rate range. Compared with the existing technology, the generation speed is faster and is not affected by changes in the card stacking structure, and can generate puzzles with stable winning rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115430128B_ABST
    Figure CN115430128B_ABST
Patent Text Reader

Abstract

The present invention discloses a generating device for a single-player card game, comprising a puzzle generating module and a puzzle winning rate calculating module. The puzzle winning rate calculating module conducts multiple proxy plays according to the input single-player card game puzzle, and counts the proportion of the number of successful plays to the total number of plays as the winning rate of this puzzle. The puzzle generating module assigns values to the cards in the bottom card area and the table area according to the specified card stacking structure, generates a specified number of single-player card game puzzles, inputs them into the puzzle winning rate calculating module, and saves the puzzles that meet the winning rate requirements among them. The present invention can be used for any specified card stacking structure, assigns values to the cards in the table area in a non-random manner, so as to quickly generate puzzles that meet the winning rate requirements. It solves the problem that the randomness in the prior art is too strong, resulting in unstable puzzle winning rates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer design, and particularly relates to a generating device for a single-player solitaire game. Background Art

[0002] TriPeaks is a classic single-player solitaire game. The playing cards with points A, 2, 3... J, Q, K are used to form the card face. The card face includes two parts: the table area and the bottom card area. The playing cards in the table area are stacked in layers to form a tree-like topological structure. Among them, the playing card stacked on the top layer is in the face-up state, that is, the number side is facing up, and the numbers of the remaining playing cards are facing down. The playing cards in the bottom card area are stacked horizontally in a random order. Similarly, the playing card stacked on the top layer has its number side facing up, and the numbers of the remaining playing cards are all facing down. According to the points of the face-up playing card in the bottom card area, select the playing cards with adjacent points among the face-up playing cards in the table area for recycling. The recycled playing cards in the table area become the face-up playing cards in the bottom card area, and the originally face-up playing card in the bottom card area is discarded. If there are no recyclable playing cards in the table area, the face-up playing card in the bottom card area is discarded, and the playing card originally stacked below it is turned face up. When there is no playing card stacked above the playing card with the number facing down in the table area, turn this playing card face up as a recyclable playing card. And so on, until all the playing cards in the table area are recycled and the game is successful. If all the playing cards in the bottom card area are discarded, but there are still unrecycled playing cards in the table area, the game fails.

[0003] In the classic TriPeaks solitaire game, the playing cards in the table area are generally stacked in a pyramid shape or an inverted pyramid shape, and the difference is only in the number of stacked layers. Researchers have improved the fun of the game by designing different playing card stacking structures. And the playability of the game usually depends on the winning rate of the card face.

[0004] The existing generation method, after determining the card face structure, uses a random assignment method to determine the points of the playing cards in the table area, and then obtains the winning rate of this puzzle through a depth-first search method. When the number of playing cards in the table area is large, using the random assignment method has great uncertainty, and the winning rate of the obtained puzzle is usually very low. Therefore, it is very difficult to obtain a puzzle that meets the required winning rate through this method. Summary of the Invention

[0005] Aiming at the deficiencies of the prior art, the present invention proposes a generating device for a single-player solitaire game. For a specified card face stacking structure, the playing cards in the table area are assigned values in a non-random manner, so as to quickly generate a puzzle that meets the winning rate requirements.

[0006] A generating device for a single-player solitaire game includes a puzzle generating module and a puzzle winning rate calculating module.

[0007] The riddle winning rate calculation module conducts multiple proxy plays based on the input single-player solitaire game riddle, and calculates the proportion of the number of successful plays in the total number of plays as the winning rate of this riddle.

[0008] The riddle generation module assigns values to the cards in the bottom card area and the table area according to the specified card stacking structure, and generates single-player solitaire game riddles with different winning rates. The specific steps are as follows:

[0009] s1.1. Determine the number of cards m and n in the table area and the bottom card area according to the specified card stacking structure. Set the generation quantity and winning rate range of the riddle.

[0010] s1.2. Set the consecutive string L i ={x1, x2,..., x j ,..., x ai}, where the first card x1 of the consecutive string comes from the bottom card area, and the rest of the cards come from the table area. a i represents the length of the consecutive string L i starting with the i-th bottom card, i ∈ [1, n], a i ∈ [1, 1 + m] and

[0011] s1.3. Randomly assign values to the cards in the bottom card area, and judge the winning rate range set in s1.1. When the winning rate range is not 0, assign values to the cards in the consecutive string L j+1 according to x j = x i ±1. When the winning rate range is 0, assign values to the cards in the consecutive string L j+1 according to x j ≠ x i ±1. x j+1 is any face-up card in the current table area, and after the value assignment is completed, it is regarded as recycled. And so on, until the value assignment of all the cards in the table area is completed, and output the single-player solitaire game riddle.

[0012] s1.4. Input the single-player solitaire game riddle obtained in s1.3 into the riddle winning rate calculation module, calculate the winning rate of this riddle, and if the winning rate of this riddle meets the winning rate range set in s1.1, save it, otherwise discard it.

[0013] s1.5. Repeat s1.3 - 1.4 until the specified number of riddles are saved.

[0014] The present invention has the following beneficial effects:

[0015] This application utilizes a puzzle generation module to generate puzzles for the TriPeaks solitaire game according to requirements of different winning rate ranges. Compared with the method of randomly assigning values in the prior art, this application can generate puzzles within a specified winning rate range faster and is not affected by changes in the card stacking structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic flowchart of a puzzle winning rate determination module;

[0017] Figure 2 It is a schematic diagram of the TriPeaks interface shown in the embodiment;

[0018] Figure 3 It is a schematic flowchart of a puzzle generation module;

[0019] Figure 4 It is a schematic diagram of a puzzle stacking structure designed in the embodiment;

[0020] Figure 5 It is a schematic diagram of the puzzle after assigning values to the bottom card area in the embodiment;

[0021] Figure 6(a) , 6(b) , 6(c) is a schematic diagram of assigning values to the first consecutive string in Embodiment 1;

[0022] Figure 7(a) , 7(b) It is a schematic diagram of assigning values to the second consecutive string in Embodiment 1;

[0023] Figure 8(a) , 8(b) , 8(c) is a schematic diagram of assigning values to the first consecutive string in Embodiment 2;

[0024] Figure 9(a) , 9(b) It is a schematic diagram of assigning values to the second consecutive string in Embodiment 2. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The following further explains the present invention with reference to the accompanying drawings;

[0026] Embodiment 1

[0027] A generation device for a single-player solitaire game includes a puzzle generation module and a puzzle winning rate calculation module.

[0028] Describe the puzzle structure of the single-player solitaire game in JSON format and input it into the puzzle winning rate calculation module. Conduct 10,000 proxy plays based on a random strategy, an optimal card collection strategy, or an optimal redeal strategy, and count the proportion of the number of successful plays in the total number of plays as the winning rate of this puzzle, as Figure 1 shown.

[0029] The random strategy is as follows: at each step of the game, randomly perform any possible card collection action. The optimal card collection strategy is as follows: at each step of the game, make a choice that results in a longer consecutive card collection action. The optimal flip card strategy is as follows: at each step of the game, make a choice that allows new cards to be flipped after collection. As Figure 2 shown, all the cards flipped in the current table area are 6, 7, 9, 10, J, and the card in the bottom card area is 8. At this time, the cards that can be collected are 7 or 9. Under the random strategy, the probabilities of selecting 7 or 9 are the same. Under the currently known conditions, if 9 is selected for collection, then 10 and J can be collected in sequence. If 7 is selected for collection, then 6 can be collected again. That is, collecting 9 can result in a longer consecutive card collection action. Therefore, under the optimal card collection strategy, the probability of selecting 9 is greater than that of 7. After 7 is collected, one card can be flipped, while after 9 is collected, no cards can be flipped. Therefore, under the optimal flip card strategy, the probability of selecting 7 is greater than that of 9.

[0030] As Figure 3 shown, the puzzle generation module assigns values to the cards in the bottom card area and the table area according to the specified card stack structure, generating single-player solitaire game puzzles with different winning probabilities, specifically including the following steps:

[0031] s1.1. Input the card stack structure as Figure 4 shown. In the table area, white represents the card with the number face up, and black represents the card with the number face down. The number of cards in the table area and the bottom card area are 5 and 2 respectively. Set the number of puzzles generated to 20, and the winning probability range to 50% - 100%.

[0032] s1.2. Set the consecutive string L i = {x1, x2,..., x j ,..., x ai}, where the first card x1 of the consecutive string comes from the bottom card area, and the remaining cards come from the table area. a i represents the length of the consecutive string L i starting with the i-th bottom card, i ∈ [1, n], a i ∈ [1, 1 + m] and

[0033] s1.3. Randomly assign values to the cards in the bottom card area, as Figure 5 shown. The length of the consecutive string starting with 11 is a1, and the length of the consecutive string starting with 3 is a2. Then (a1, a2) = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}.

[0034] Assume that the length of the continuous string starting with 11 is 4, and the length of the continuous string starting with 3 is 3. According to the winning rate range set in s1.1, which is 50% - 100%, assign values to the playing cards in the two continuous strings according to x j+1 = x j ±1. First, randomly select a face-up playing card from the table area and assign it a value of 11 + 1 or 11 - 1. As shown in Figure 6(a), assign it a value of 10. Then, randomly select another face-up playing card from the table area and assign it a value of 10 + 1 or 10 - 1. As shown in Figure 6(b), assign it a value of 11. For the playing cards with values assigned, consider them as recycled. Therefore, at this time, new playing cards in the table area are considered face-up, and this playing card can also be selected during the next assignment. As shown in Figure 6(c), randomly select another face-up playing card from the table area and assign it a value of 11 + 1 or 11 - 1. Thus, the assignment of all the playing cards in the continuous string starting with 11 is completed. Next, assign values to the playing cards in the continuous string starting with 3, as shown in Figures 7(a) and (b). Thus, the generation of a riddle is completed.

[0035] s1.4. Input the single-player solitaire riddle obtained in s1.3 into the riddle winning rate calculation module to calculate the winning rate of this riddle. If the winning rate of this riddle is within the range of 50% - 100%, save it; otherwise, discard it.

[0036] s1.5. Repeat s1.3 - 1.4 until the specified number of riddles is saved.

[0037] Embodiment 2

[0038] In this embodiment, also taking the card stack structure shown in Figure 6 as an example, the method for generating a riddle with a winning rate of 0 is described.

[0039] Also assign the playing cards in the bottom card area the values of 11 and 3, and assume that the length of the continuous string starting with 11 is 4, and the length of the continuous string starting with 3 is 3. Assign values to the playing cards in the two continuous strings according to x j+1 ≠ x j ±1. First, randomly select a face-up playing card from the table area and assign it a number from 1 to 13 that is not equal to 11 ± 1. As shown in Figure 8(a), assign it a value of 5. Then, randomly select another face-up playing card from the table area and assign it a number from 1 to 13 that is not equal to 5 ± 1. As shown in Figure 8(b), assign it a value of 8. As shown in Figure 8(c), randomly select another face-up playing card from the table area and assign it a value of 1. Thus, the assignment of all the playing cards in the continuous string starting with 11 is completed. Next, also according to x j+1 ≠ x j±1 rule, assign values ​​to the cards in a series starting with 3, as shown in Figure 9 (a) and (b). At this point, the generation of a puzzle is completed.

[0040] In order to ensure that the winning rate of the obtained puzzle is 0, it is also necessary to input the generated puzzle into the puzzle winning rate calculation module to calculate the winning rate.

[0041] Example 3

[0042] The device of the present invention and the random assignment method are used to generate 100 puzzles with different numbers of cards on the table area, and the proportion of puzzles with a winning rate of more than 50% is calculated. The statistical results are shown in Table 1:

[0043] Number of playing cards in the card table area Random assignment The present invention 13 11% 72% 17 18% 45% 22 33% 68% 24 5% 36% 30 0% 15% 36 0% 28%

[0044] Table 1

[0045] As can be seen from Table 1, the number of puzzles generated by the random assignment method in the prior art that meet the winning rate requirements is far less than that of the present invention, especially when the number of cards in the card table area increases, none of the 100 puzzles generated by random assignment has a winning rate of more than 50%. Therefore, the puzzle generation method in the prior art has great randomness, and it is difficult to generate a puzzle with a specified winning rate. Especially when the number of cards in the card table area is large, if you want to obtain a puzzle with a stable winning rate, you need to spend a lot of resources and time.

[0046] The above embodiments are only some embodiments of the present invention, not all embodiments, and the protection scope of the present invention is not limited thereto. A person skilled in the art can understand that even without these technical details and various changes and modifications based on the above embodiments, the technical solutions claimed in the claims of this application can be implemented.

Claims

1. A generating device for a single-player card game, characterized in that: It includes a puzzle generation module and a puzzle winning rate calculation module; The puzzle winning rate calculation module conducts multiple proxy plays based on the input solitaire game puzzle, and calculates the proportion of the number of successful plays to the total number of plays as the winning rate of this puzzle; The puzzle generation module assigns values to the cards in the bottom card area and the table area according to the specified card stacking structure to generate solitaire game puzzles with different winning rates. The specific steps are as follows: s1.

1. Determine the number of cards m and n in the table area and the bottom card area according to the specified card stacking structure; set the generation quantity and winning rate range of the puzzle; s1.

2. Set the continuous sequence L i = {x1, x2,..., x j ,..., x ai}, where the first card x1 of the continuous sequence comes from the bottom card area, and the remaining cards come from the table area; a i represents the length of the continuous sequence L i starting with the i-th bottom card, i ∈ [1, n], a i ∈ [1, 1 + m] and S1.3, randomly assign values ​​to the cards in the bottom card area, determine the winning rate range set in S1.1, and if the winning rate range is not 0, follow x j+1 =x j ±1 pair of continuous strings L i Assign values ​​to the cards in; when the winning rate range is 0, follow x j+1 ≠x j ±1 pair of continuous strings L i Assign the cards in the game; x j+1 Any card that is turned over in the current card table area is considered to be recycled after the assignment is completed; and so on, until the assignment of cards in all card table areas is completed, and the puzzle of the solitaire game is output; s1.

4. Input the solitaire game puzzle obtained in s1.3 into the puzzle winning rate calculation module to calculate the winning rate of this puzzle. If the winning rate of this puzzle meets the winning rate range set in s1.1, save it; otherwise, discard it; s1.

5. Repeat s1.3 to 1.4 until the specified number of puzzles are saved.

2. The generating device for a single-player card game according to claim 1, characterized in that: The puzzle winning rate calculation module conducts proxy plays based on a random strategy, an optimal card collection strategy, or an optimal redeal strategy.

3. The generating device for a single-player card game according to claim 2, characterized in that: The random strategy is: at each step of the game, randomly perform any possible card collection action; the optimal card collection strategy is: at each step of the game, make a choice that makes the consecutive card collection actions longer; the optimal redeal strategy is: at each step of the game, make a choice that allows new cards to be turned over after recycling.

4. The generating device for a single-player card game according to claim 1, characterized in that: The puzzle winning rate calculation module conducts more than 10,000 proxy plays on the input puzzle.

5. The generating device for a single-player card game according to claim 1, characterized in that: When the winning rate range is 0, the continuous string L i ={x1, x2≠x1±1, x3≠x2±1, …, x j ≠x j -1±1, …, x ai ≠x ai-1 ±1}, when the winning rate range is greater than 0, the continuous string L i ={x1, x2=x1±1, ……, x j =x j-1 ±1, ……, x ai =x ai-1 ±1}.

6. The generating device for a single-player card game according to claim 1, characterized in that: The puzzle generation module saves the puzzles that meet the winning rate requirements in JSON format.

Citation Information

Patent Citations

  • Data processing method and system based on fitness function and storage medium

    CN113893547A

  • Card face generation device of card game based on tree topology

    CN114870391A