[go: up one dir, main page]

CN114870391B - Card face generating device of card game based on tree topology - Google Patents

Card face generating device of card game based on tree topology

Info

Publication number
CN114870391B
CN114870391B CN202210473245.0A CN202210473245A CN114870391B CN 114870391 B CN114870391 B CN 114870391B CN 202210473245 A CN202210473245 A CN 202210473245A CN 114870391 B CN114870391 B CN 114870391B
Authority
CN
China
Prior art keywords
nodes
topology
card
cards
generation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210473245.0A
Other languages
Chinese (zh)
Other versions
CN114870391A (en
Inventor
高奕杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Normal University
Original Assignee
Hangzhou Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Normal University filed Critical Hangzhou Normal University
Priority to CN202210473245.0A priority Critical patent/CN114870391B/en
Publication of CN114870391A publication Critical patent/CN114870391A/en
Application granted granted Critical
Publication of CN114870391B publication Critical patent/CN114870391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F1/00Card games
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F1/00Card games
    • A63F2001/008Card games adapted for being playable on a screen

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A card face generating device of a card game based on tree topology comprises a parameter initializing module, a topology structure generating module, a card face point number generating module and a display module. The parameter initialization module is used for setting basic parameters of the card face. The topological structure generation module randomly generates a topological structure meeting the quantity requirement according to the quantity parameters of the cards in the table area set in the parameter initialization module. And the brand point number generation module is used for giving points meeting the quantity requirement and the clearance requirement to each node according to the topological structure E stored by the topological structure generation module and the parameters set in the parameter initialization module. And the display module displays the cards output by the card point number generation module in a form conforming to the stacking sequence and loads the cards to the game interface. The device not only can obtain various card surface structures with rich forms, but also can reduce the problem of clamping of the game device caused by loading of mass models.

Description

Card face generating device of card game based on tree topology
Technical Field
The invention belongs to the field of computer design, relates to a card face generating device for a single-player card game, and in particular relates to a card face generating device for a card game based on tree topology.
Background
TriPeaks is a classical single-player card game using cards with rank a, 2, 3.. J, Q, K to form a deck, the deck comprising two sections, a table section and a bottom section, the cards in the table section being stacked in layers, as shown in fig. 1, to form a pyramid or inverted pyramid, wherein the cards stacked on top are in an open position, i.e. with the numbers facing up, and the numbers of the remaining cards facing down. Cards in the bottom card section are stacked in a random order with the uppermost card number face facing up and the remaining cards facing down.
Selecting the cards turned over by the card table area according to the number of the cards turned over by the bottom card area, recovering the cards adjacent to the number of the cards, wherein the cards recovered by the card table area become the cards turned over by the bottom card area, and discarding the cards originally turned over by the bottom card area. If there are no cards in the table section that can be retrieved, the cards with the bottom card section flipped open are discarded and the cards originally stacked thereunder are flipped open. When no cards are stacked above the cards with the digits down in the table area, the cards are flipped open as cards that can be retrieved. And so on until all cards in the table area are recovered, and the game is successful. If all cards in the bottom card section are discarded, but there are cards in the table section that have not been recycled, the game fails.
In the prior TriPeaks card game, the cards in the table area are generally stacked in a pyramid shape or an inverted pyramid shape, and the difference is only that the number of stacked layers is different, the form is single, the playability is low, and the difficulty setting of the game is also unfavorable. If different card face structures are designed by means of manual mode, the richness of forms can be guaranteed, but the workload is too great, and in addition, the performance of the game device is also highly required in the game running process.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a card face generating device for a card game based on tree topology, which takes the tree topology generated randomly as a stacking structure of cards in a table area, enriches the card face forms of the table area and simultaneously avoids the problem of clamping caused by model loading.
A card face generating device of a card game based on tree topology comprises a parameter initializing module, a topology structure generating module, a card face point number generating module and a display module.
The parameter initialization module is used for setting basic parameters of the card surface, including minimum MIN_N and maximum MAX_N of the number of cards in the table area, maximum MAX_I of the number of cards in the table area, count of the number of cards in the bottom card area, and minimum MIN_R and maximum MAX_R of the clearance. Wherein MIN_N < MAX_ N, G < MAX_ I, count > 1, MIN_R < MAX_R.
The topological structure generation module randomly generates topological structures meeting the quantity requirements according to the quantity parameters of the cards in the card table area set in the parameter initialization module, and specifically comprises the following steps:
s1.1, randomly generating n nodes as a generation node, wherein n is more than or equal to 2. Then generating n-1, n or n+1 nodes from one generation node to the upper and lower sides as an upper layer second generation node and a lower layer second generation node, and so on, and generating a plurality of generation nodes, namely, the number of each generation node and the number of the upper generation node are equal, one more or one less. Of course, if the number of nodes in the same generation is greater than or equal to 2, the nodes in the same generation can be split into a plurality of groups, and each group generates own second-generation nodes after grouping, wherein the difference is that the number of the second-generation nodes can only be 1 less than or equal to the number of the nodes in the previous generation.
S1.2, after each generation of next generation node, each generation node is connected with the next generation node, and the connection lines of the nodes between the two generations cannot be crossed to establish a topological structure. Each node is connected with two nodes at adjacent positions in the next generation if the number of the next generation nodes is more, each node is connected with one of the adjacent positions in the next generation if the number of the next generation nodes is less, each node can be connected with the nodes at the same positions in the next generation if the number of the two generation nodes is the same, or the nodes except the leftmost or rightmost node are only connected with the nodes at the same positions in the next generation, and the rest nodes are connected with the corresponding positions in the second generation nodes and the adjacent one. And when all the nodes are connected with other nodes, obtaining a topological structure A.
And s1.3, judging whether the topological structure A obtained in s1.2 meets the bilateral symmetry relation. When the topological structure A meets the bilateral symmetry relation, judging whether the total node number in the topological structure A exceeds the maximum value MAX_N of the card number in the table area, returning to s1.1 if the total node number exceeds the maximum value MAX_N, taking the total node number as the topological structure B if the total node number does not exceed the maximum value MAX_N, and entering into s1.4. When the topological structure A does not meet the bilateral symmetry relation, judging whether the total node number in the topological structure A exceeds half of the maximum value of the number of cards in the table area MAX_N/2, returning to s1.1 if the total node number exceeds the maximum value, and taking the total node number as the topological structure B after meeting the bilateral symmetry relation by a mirror copy method if the total node number does not exceed the maximum value of the number of cards in the table area MAX_N/2, and entering into s1.4.
S1.4, dividing the maximum value MAX_N of the number of cards in a card table area by the total node number of the topological structure B obtained in S1.3, after the calculation result B is rounded downwards, judging whether B-1 is larger than 0, randomly copying the topological structure B0~b-1 times when B-1>0 is carried out to obtain a topological structure C, entering into S1.5, and directly taking the topological structure B as the topological structure C and entering into S1.5 when B-1 is smaller than or equal to 0.
And S1.5, judging whether the total node number of the topological structure C obtained in the step S1.4 is larger than the minimum value MIN_N of the card number of the table area, if so, entering the step S1.6, if so, judging whether the difference value between the total node number of the topological structure C and the maximum value MAX_N of the card number of the table area is larger than 6, if so, entering the step S1.6, and if so, taking the topological structure C as a topological structure E, and directly entering the step S1.7.
And s1.6, limiting the total node number to be smaller than the difference value between the total node number of the topological structure C and the maximum value MAX_N of the number of cards in the card table area, and generating the topological structure D according to the method of s 1.1-s 1.4. And combining the topological structure D with the topological structure C to obtain a new topological structure E. The number of independent tree topologies in the topology structure is defined as the number of groups of the topology structure, when the number of groups of the topology structure C is odd, only the topology structure D with even number of groups can be combined with the topology structure D to form the topology structure E, otherwise, the topology structure D needs to be regenerated. Topology E is then processed by the method of s 1.5.
And S1.7, judging whether the group number of the topological structure E is equal to the group number G of the cards in the table area set in the parameter initialization module, and if so, storing the topological structure E. If not, returning to s1.1, and regenerating a new topology structure.
And the brand point number generation module is used for giving points meeting the quantity requirement and the clearance requirement to each node according to the topological structure E stored by the topological structure generation module and the parameters set in the parameter initialization module. The method specifically comprises the following steps:
s2.1, generating a group of nodes according to the number Count of cards in the bottom card area, and then randomly placing a card for the positions of the group of nodes and each node in the topological structure E, wherein the range of the card is A, 2 and 3.
And s2.2, randomly selecting a plurality of continuous nodes of a certain row in the topological structure E as initial turning-over nodes, and taking the cards on the initial turning-over nodes as initial turning-over cards. The number of the initial turn-up nodes is between the grouped number G of cards in the table area and the maximum value MAX_I of the initial turn-up cards, and the positions of all the initial turn-up nodes are required to meet the bilateral symmetry.
S2.3, setting the initial opening node selected in s2.2 as a layer 0 node, setting a node with a connecting line between the node and the layer 0 node in the topological structure E as a layer 1 node, setting a node with a connecting line between the node and the layer 1 node as a layer 2 node, and so on until all the nodes in the topological structure E are endowed with a hierarchy. And then arranging the cards of the e-th layer node to be covered on the cards of the e+1-th layer node with the connection relation, so as to obtain the stacking sequence of the cards of the table area.
And s2.4, selecting the card stacking sequence of the table area and the bottom card area obtained in s2.1 and s2.3 and the number of cards as a card surface by using a depth-first search mode according to the rule of TriPeaks, calculating the clearance probability R of the card surface, storing the card surface when MIN_R is less than or equal to R is less than or equal to MAX_R, and otherwise returning to s2.1.
And the display module displays the cards output by the card point number generation module in a form conforming to the stacking sequence and loads the cards to the game interface.
The invention has the following beneficial effects:
Based on the basic parameters generated in the parameter initialization module, the topology structure generation module and the card face point number generation module generate results with certain randomness each time, so that various card face structures with rich forms can be obtained, and game difficulty gradient can be reasonably set by changing clearance probability. And the problem of the locking of the game device caused by loading of a mass model can be reduced.
Drawings
FIG. 1 is a conventional TriPeaks card game rules;
FIG. 2 is a flow chart of a card face generation step;
FIG. 3 is a node generation schematic;
fig. 4 (a), fig. 4 (b), fig. 4 (c), and fig. 4 (d) are schematic diagrams of different situations when an inter-node topology is constructed;
FIG. 5 is a schematic diagram of a topology mirror copy;
FIG. 6 is a schematic diagram of topology replication;
FIG. 7 is a schematic diagram of a face generated by the face point number generation module in an embodiment;
Fig. 8 is a schematic diagram of a card face shown by the display module in an embodiment.
Detailed Description
The application will be described in detail below with reference to the drawings and the detailed description, but the scope of the application is not limited thereto. It will be understood by those skilled in the art that the claimed application may be practiced without these specific details and with various changes and modifications from the embodiments that follow.
A card face generating device of a card game based on tree topology comprises a parameter initializing module, a topology structure generating module, a card face point number generating module and a display module.
The parameter initialization module is used for setting basic parameters of the card surface, including minimum MIN_N and maximum MAX_N of the number of cards in the table area, maximum MAX_I of the number of cards in the table area, count of the number of cards in the bottom card area, and minimum MIN_R and maximum MAX_R of the clearance. Wherein MIN_N < MAX_ N, G < MAX_ I, count > 1, MIN_R < MAX_R.
The topology structure generation module randomly generates a topology structure meeting the number requirement according to the number parameters of the cards in the card table area set in the parameter initialization module, as shown in fig. 2, and specifically comprises the following steps:
s1.1, as shown in fig. 3, 3 nodes are randomly generated as a generation node. And then adding four nodes above the first generation node to form an upper second generation node. Then, to generate second generation nodes below the first generation nodes, the node number of the first generation nodes is 3, and grouping can be performed. The three nodes of the first generation node are divided into two parts of 1:2, the first part only has one node, the number of the corresponding lower second generation nodes can be zero or one, the number of the corresponding lower second generation nodes is one, and the second part has two nodes, and the number of the corresponding lower second generation nodes is one.
S1.2, after each new generation of nodes are added, two generations of nodes need to be connected, connecting lines of the nodes between the two generations cannot be crossed, and a topological structure is built. If the number of nodes in two generations is the same, each node may be connected to the node in the same position in the next generation, or may be connected to the corresponding position in the second generation node and an adjacent node except for the leftmost or rightmost node which is connected to the node in the same position in the next generation.
As shown in fig. 4 (a), 4 (b), the number of the first-generation nodes and the second-generation nodes are the same, and thus the nodes in the first-generation nodes and the nodes in the same position in the second-generation nodes can be continuous as in fig. 4 (a). Of course, as in fig. 4 (b), only the leftmost first-generation node is connected to the corresponding position in the second-generation node, and the rest of nodes are connected to the corresponding position in the second-generation node and an adjacent node. .
If the number of next generation nodes is greater, each node connects with two adjacent nodes in the next generation.
As shown in fig. 4 (c), in which the number of lower-level second-generation nodes is greater than that of the first-generation nodes, a first node of the first-generation nodes may be connected to both the first and second nodes of the second-generation nodes. Similarly, a second node of the first generation of nodes may be connected to both a second and third node of the second generation of nodes.
If the number of nodes of the next generation is smaller, every two nodes are connected to one of the adjacent positions in the next generation.
As shown in fig. 4 (d), in which the number of the first generation nodes is 3 and the number of the second generation nodes is 2, the first and second nodes of the first generation nodes are connected to the first node of the second generation nodes, and the second and third nodes of the first generation nodes are connected to the second node of the second generation nodes.
And when all the nodes are connected with other nodes, obtaining a topological structure A.
And s1.3, judging whether the topological structure A obtained in s1.2 meets the bilateral symmetry relation. When the topological structure A meets the bilateral symmetry relation, judging whether the total node number in the topological structure A exceeds the maximum value MAX_N of the card number in the table area, returning to s1.1 if the total node number exceeds the maximum value MAX_N, taking the total node number as the topological structure B if the total node number does not exceed the maximum value MAX_N, and entering into s1.4. When the topological structure A does not meet the bilateral symmetry relation, judging whether the total node number in the topological structure A exceeds half of MAX_N/2 of the maximum number of cards in the table area, returning to s1.1 if the total node number exceeds half of MAX_N/2, and taking the total node number as the topological structure B after meeting the bilateral symmetry relation by a mirror copy method if the total node number does not exceed MAX_N/2, and entering s1.4 as shown in fig. 5.
S1.4, dividing the maximum value MAX_N of the number of cards in the card table area by the total node number of the topological structure B obtained in s1.3, after the calculation result B is rounded downwards, judging whether B-1 is larger than 0, randomly copying the topological structure B0~b-1 times when B-1>0 is carried out to obtain a topological structure C, entering s1.5, and directly taking the topological structure B as the topological structure C and entering s1.5 when B-1 is smaller than or equal to 0 as shown in a figure 6.
And S1.5, judging whether the total node number of the topological structure C obtained in the step S1.4 is larger than the minimum value MIN_N of the card number of the table area, if so, entering the step S1.6, if so, judging whether the difference value between the total node number of the topological structure C and the maximum value MAX_N of the card number of the table area is larger than 6, if so, entering the step S1.6, and if so, taking the topological structure C as a topological structure E, and directly entering the step S1.7.
And s1.6, limiting the total node number to be smaller than the difference value between the total node number of the topological structure C and the maximum value MAX_N of the number of cards in the card table area, and generating the topological structure D according to the method of s 1.1-s 1.4. And combining the topological structure D with the topological structure C to obtain a new topological structure E. The number of independent tree topologies in the topology structure is defined as the number of groups of the topology structure, when the number of groups of the topology structure C is odd, only the topology structure D with even number of groups can be combined with the topology structure D to form the topology structure E, otherwise, the topology structure D needs to be regenerated. Topology E is then processed by the method of s 1.5.
And S1.7, judging whether the group number of the topological structure E is equal to the group number G of the cards in the table area set in the parameter initialization module, and if so, storing the topological structure E. If not, returning to s1.1, and regenerating a new topology structure.
And the brand point number generation module is used for giving points meeting the quantity requirement and the clearance requirement to each node according to the topological structure E stored by the topological structure generation module and the parameters set in the parameter initialization module. The method specifically comprises the following steps:
s2.1, generating a group of nodes according to the number Count of cards in the bottom card area, and then randomly placing a card for the positions of the group of nodes and each node in the topological structure E, wherein the range of the card is A,2 and 3. In this embodiment, count=16, the number of nodes in the topology E is 16, and the number of groups is 2. The result of randomly placing cards is shown in fig. 7, with the numbers in the nodes as the card points for ease of presentation. Wherein the leftmost digit of the bottom card section indicates that the bottom card section is flipped open with the cards corresponding from left to right in a stacking sequence from top to bottom.
S2.2, randomly selecting 4 nodes in the topological structure E as initial turning-over nodes, wherein the positions of the initial turning-over nodes meet bilateral symmetry, and the initial turning-over nodes are shown as circles in fig. 7.
S2.3, setting the initial turn-on node selected in s2.2 as a layer 0 node, setting a node with a connecting line between the node and the layer 0 node in the topological structure E as a layer 1 node, and displaying the node as an ellipse in fig. 7. The arrangement with the layer 1 nodes having connection lines is a layer 2 node, shown as a rectangle in fig. 7. And so on, all nodes in topology E are assigned a hierarchy and accordingly the 3-level nodes are shown as triangles and the 4-level nodes are shown as stars in fig. 7.
And then arranging the cards of the e-layer nodes to be covered on the cards of the e+1-layer nodes with the connection relation, so as to obtain the stacking sequence of the cards of the table area.
And s2.4, taking the card stacking sequence of the table area and the bottom card area obtained in s2.1 and s2.3 and the card number as a card surface, clicking according to a TriPeaks rule by using a depth-first search mode, calculating the clearance probability R of the card surface, and storing the card surface when MIN_R is less than or equal to R is less than or equal to MAX_R, otherwise returning to s2.1.
The display module displays the cards output by the card point number generation module in a form conforming to the stacking sequence, and loads the cards onto a game interface, as shown in fig. 8.

Claims (2)

1.一种基于树状拓扑的纸牌游戏的牌面生成装置,其特征在于:包括参数初始化模块、拓扑结构生成模块、牌面点数生成模块和展示模块;1. A card game card generation device based on tree topology, characterized by comprising a parameter initialization module, a topology structure generation module, a card point generation module, and a display module; 所述参数初始化模块用于设置牌面的基本参数,包括牌桌区纸牌数量最小值MIN_N和最大值MAX_N,牌桌区纸牌分组数量G与初始翻开纸牌数量最大值MAX_I,底牌区纸牌数量Count,通关率最小值MIN_R与最大值MAX_R;其中,MIN_N<MAX_N、G<MAX_I、Count≥1、MIN_R<MAX_R;The parameter initialization module is used to set the basic parameters of the card face, including the minimum value MIN_N and the maximum value MAX_N of the number of cards in the table area, the number of card groups G and the maximum value MAX_I of the initial number of cards turned over in the table area, the number of cards in the bottom card area Count, and the minimum value MIN_R and the maximum value MAX_R of the clearance rate; wherein MIN_N<MAX_N, G<MAX_I, Count≥1, MIN_R<MAX_R; 所述拓扑结构生成模块根据参数初始化模块中设置的牌桌区纸牌数量参数,随机生成符合数量要求的拓扑结构,具体包括以下步骤:The topology structure generation module randomly generates a topology structure that meets the quantity requirement according to the card quantity parameter of the table area set in the parameter initialization module, specifically comprising the following steps: s1.1、随机生成n个节点作为一代节点,n≥2;然后在一代节点的上方和下方生成n-1、n或n+1个节点作为上层二代节点和下层二代节点,以此类推,生成多代节点,即每一代节点的数量与其上一代节点的数量的关系为相等、多一个或少一个;在下一代节点生成前,如果当前一代的节点数大于等于2时,随机将其拆分成若干组或不拆分,分组后每组各自生成下一代节点,拆分后生成的下一代节点的数量与上一代节点的数量相等或少一个;s1.1. Randomly generate n nodes as the first generation of nodes, where n ≥ 2. Then, generate n-1, n, or n+1 nodes above and below the first generation of nodes as upper and lower second generation nodes, and so on, to generate multiple generations of nodes. That is, the number of nodes in each generation is equal to, one more, or one less than the number of nodes in the previous generation. Before generating the next generation of nodes, if the number of nodes in the current generation is greater than or equal to 2, randomly split them into several groups or not. After grouping, each group generates its own next generation of nodes. The number of next generation nodes generated after the split is equal to or one less than the number of nodes in the previous generation. s1.2、在每次生成完下一代节点的之后,将相邻两代的节点进行连接,两代之间节点的连接线不能交叉,建立拓扑结构;如果下一代节点的数量更多,则每个节点与下一代中相邻位置的两个节点同时连接;如果下一代的节点数量更少,那么每两个节点与下一代中相邻位置的一个相连接;如果两代的节点数量相同,则每个节点均可以与下一代中相同位置的节点连接,或者除了最左边或最右边的节点只连接与下一代中相同位置的节点,其余的节点连接其在二代节点中的对应位置以及相邻的一个节点;当所有节点均与其他节点连接后,得到拓扑结构A;s1.2. After each generation of the next generation of nodes, connect the nodes of the two adjacent generations. The connection lines between the nodes of the two generations cannot cross, and establish a topological structure. If the number of nodes in the next generation is larger, each node is connected to two adjacent nodes in the next generation at the same time. If the number of nodes in the next generation is smaller, then every two nodes are connected to one adjacent node in the next generation. If the number of nodes in the two generations is the same, then each node can be connected to the node in the same position in the next generation, or, except for the leftmost or rightmost node, only connected to the node in the same position in the next generation, and the remaining nodes are connected to their corresponding positions in the second generation nodes and an adjacent node. When all nodes are connected to other nodes, the topological structure A is obtained. s1.3、判断s1.2得到的拓扑结构A是否满足左右对称关系;当拓扑结构A满足左右对称关系时,判断拓扑结构A中的总节点数是否超过牌桌区纸牌数量最大值MAX_N,若超过则返回s1.1,若不超过则将其作为拓扑结构B,并进入s1.4;当拓扑结构A不满足左右对称关系时,判断拓扑结构A中的总节点数是否超过牌桌区纸牌数量最大值的一半MAX_N/2,若超过则返回s1.1,若不超过则通过镜面复制的方法,使其满足左右对称关系后作为拓扑结构B,并进入s1.4;s1.3. Determine whether topology A obtained in s1.2 satisfies bilateral symmetry. If so, determine whether the total number of nodes in topology A exceeds the maximum number of cards on the table (MAX_N). If so, return to s1.1. If not, treat it as topology B and proceed to s1.4. If not, determine whether the total number of nodes in topology A exceeds half of the maximum number of cards on the table (MAX_N/2). If so, return to s1.1. If not, mirror copy it to ensure bilateral symmetry and treat it as topology B, then proceed to s1.4. s1.4、使用牌桌区纸牌数量最大值MAX_N除以s1.3得到的拓扑结构B的总节点数,将计算结果b向下取整后,判断b-1是否大于0,当b-1>0时,将拓扑结构B随机复制0~b-1次,得到拓扑结构C,并进入s1.5;当b-1≤0时,直接将拓扑结构B作为拓扑结构C,并进入s1.5;S1.4. Divide the maximum number of cards on the table (MAX_N) by the total number of nodes in topology B obtained in S1.3. Round down the calculated result b and determine whether b-1 is greater than 0. If b-1>0, randomly replicate topology B 0 to b-1 times to obtain topology C, and proceed to S1.5. If b-1≤0, directly use topology B as topology C and proceed to S1.5. s1.5、判断s1.4得到的拓扑结构C的总节点数是否大于牌桌区纸牌数量最小值MIN_N,若小于则进入s1.6;若大于则判断拓扑结构C的总节点数与牌桌区纸牌数量最大值MAX_N的差值是否大于6,若大于则进入s1.6,若小于则将拓扑结构C作为拓扑结构E,并直接进入s1.7;s1.5. Determine whether the total number of nodes in topology C obtained in s1.4 is greater than the minimum number of cards on the table, MIN_N. If so, proceed to s1.6. If so, determine whether the difference between the total number of nodes in topology C and the maximum number of cards on the table, MAX_N, is greater than 6. If so, proceed to s1.6. If not, treat topology C as topology E and proceed directly to s1.7. s1.6、限制总节点数小于拓扑结构C的总节点数与牌桌区纸牌数量最大值MAX_N的差值,根据s1.1~s1.4的方法,生成拓扑结构D;然后将拓扑结构D与拓扑结构C合并,得到新的拓扑结构E;定义拓扑结构中独立树状拓扑的个数为该拓扑结构的组数,为了保证拓扑结构E的左右对称关系,当拓扑结构C的组数为奇数时,只有组数为偶数的拓扑结构D才能与其合并组成拓扑结构E,否则需要重新生成拓扑结构D;然后通过s1.5的方法对拓扑结构E进行处理;S1.6. Limit the total number of nodes to less than the difference between the total number of nodes in topology C and the maximum number of cards on the table (MAX_N). Generate topology D using the methods in S1.1 to S1.4. Then merge topology D with topology C to obtain a new topology E. Define the number of independent tree topologies in the topology as the number of groups in the topology. To ensure the bilateral symmetry of topology E, when the number of groups in topology C is odd, only topology D with an even number of groups can be merged with it to form topology E. Otherwise, regenerate topology D. Then, process topology E using the method in S1.5. s1.7、判断拓扑结构E的组数是否与参数初始化模块中设置的牌桌区纸牌分组数量G相等,若相等则保存该拓扑结构E;若不相等则返回s1.1,重新生成新的拓扑结构;所述牌面点数生成模块,根据拓扑结构生成模块保存的拓扑结构E与参数初始化模块中设置的参数,为每个节点赋予符合数量要求和通关率要求的点数;具体包括以下步骤:s1.7. Determine whether the number of groups in the topology structure E is equal to the number of card groupings G in the table area set in the parameter initialization module. If so, save the topology structure E. If not, return to s1.1 and regenerate a new topology structure. The card point generation module assigns points to each node that meet the quantity requirements and the clearance rate requirements based on the topology structure E saved by the topology structure generation module and the parameters set in the parameter initialization module. Specifically, the following steps are included: s2.1、根据底牌区纸牌数量Count生成一组节点,然后为该组节点与拓扑结构E中的每一个节点的位置随机放置一张纸牌,纸牌的点数范围为A、2、3...J、Q、K;s2.1. Generate a set of nodes based on the number of cards in the bottom card area, Count. Then randomly place a card between the nodes in this set and each node in the topology E. The card values range from A, 2, 3...J, Q, K. s2.2、随机选取拓扑结构E中某行的若干连续节点作为初始翻开节点,则初始翻开节点上的纸牌为初始翻开纸牌;初始翻开节点的数量在牌桌区纸牌分组数量G与初始翻开纸牌数量最大值MAX_I之间,且所有初始翻开节点所在的位置应该满足左右对称性;s2.2. Randomly select several consecutive nodes in a row of the topological structure E as the initial turn-over nodes. The cards on the initial turn-over nodes are the initial turn-over cards. The number of initial turn-over nodes must be between the number of card groups G on the table area and the maximum number of initial turn-over cards MAX_I. The positions of all initial turn-over nodes must be bilaterally symmetric. s2.3、将s2.2中选取的初始翻开节点设置为第0层节点,将拓扑结构E中与第0层节点之间具有连接线的节点设置为第1层节点,与第1层节点具有连接线的设置为第2层节点,以此类推,直至拓扑结构E中所有的节点都被赋予了层级;然后将第e层节点的纸牌设置为覆盖在与其具有连接关系的第e+1层节点的纸牌上方,得到牌桌区纸牌堆叠顺序;s2.3. Set the initially opened node selected in s2.2 as the 0th level node. Set the nodes in topology structure E that are connected to the 0th level nodes as the 1st level nodes. Set the nodes that are connected to the 1st level nodes as the 2nd level nodes. And so on, until all nodes in topology structure E have been assigned levels. Then, set the cards of the eth level nodes to cover the cards of the e+1th level nodes that are connected to them, to obtain the stacking order of the cards on the table area. s2.4、将s2.1和s2.3得到的牌桌区和底牌区纸牌堆叠顺序与纸牌点数作为牌面,使用深度优先搜索的方式,按照TriPeaks的规则进行选择,计算该牌面的通关概率r,当MIN_R≤r≤MAX_R时,保存该牌面,否则返回s2.1;s2.4. Use the stacking order and card counts of the cards on the table and in the hole area obtained in s2.1 and s2.3 as the face. Use a depth-first search, following the TriPeaks rules, to select the face. Calculate the probability r of passing the level for this face. If MIN_R ≤ r ≤ MAX_R, save the face. Otherwise, return to s2.1. 所述展示模块根据牌面点数生成模块输出的牌面,将其展示为符合堆叠顺序的形式,加载到游戏界面上。The display module displays the cards output by the card point generation module in a form that conforms to the stacking order and loads it onto the game interface. 2.如权利要求1所述一种基于树状拓扑的纸牌游戏的牌面生成装置,其特征在于:在s2.4中使用深度优先搜索的方式进行牌面通过概率的计算。2. A card face generation device for a card game based on tree topology as described in claim 1, characterized in that: in s2.4, a depth-first search method is used to calculate the probability of the card face passing.
CN202210473245.0A 2022-04-29 2022-04-29 Card face generating device of card game based on tree topology Active CN114870391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210473245.0A CN114870391B (en) 2022-04-29 2022-04-29 Card face generating device of card game based on tree topology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210473245.0A CN114870391B (en) 2022-04-29 2022-04-29 Card face generating device of card game based on tree topology

Publications (2)

Publication Number Publication Date
CN114870391A CN114870391A (en) 2022-08-09
CN114870391B true CN114870391B (en) 2025-08-12

Family

ID=82674224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210473245.0A Active CN114870391B (en) 2022-04-29 2022-04-29 Card face generating device of card game based on tree topology

Country Status (1)

Country Link
CN (1) CN114870391B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115430128B (en) * 2022-09-06 2025-06-17 杭州师范大学 A device for generating a solitaire game

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101044525A (en) * 2004-09-13 2007-09-26 纸牌游艺技术公司 System and method for providing a card tournament using one or more electronic card tables
CN101920104A (en) * 2004-03-19 2010-12-22 天使游戏纸牌股份有限公司 card game system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8651933B2 (en) * 2006-10-25 2014-02-18 Gadi Werkstell System for playing a game of skill
AU2013203316B2 (en) * 2012-09-25 2015-09-24 Angel Group Co., Ltd. Card shoe apparatus and table game system
AU2013204282B2 (en) * 2013-04-12 2016-03-03 Angel Group Co., Ltd. Card game system and a method of a table game
EP2887237B1 (en) * 2013-12-19 2017-06-14 Facebook, Inc. Generating recommended search queries on online social networks
CN109011580B (en) * 2018-06-29 2021-12-21 腾讯科技(深圳)有限公司 Incomplete game card face obtaining method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101920104A (en) * 2004-03-19 2010-12-22 天使游戏纸牌股份有限公司 card game system
CN101044525A (en) * 2004-09-13 2007-09-26 纸牌游艺技术公司 System and method for providing a card tournament using one or more electronic card tables

Also Published As

Publication number Publication date
CN114870391A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
Ebeling All the right moves: a VLSI architecture for chess
CN107688999A (en) A kind of parallel transaction based on block chain performs method
CN114870391B (en) Card face generating device of card game based on tree topology
CN103455534B (en) Document clustering method and device
CN112561051B (en) A method and device for parallel processing of deep learning models
Menton et al. Control Complexity of Schulze Voting.
CN114997088A (en) Wiring and TDM ratio fast optimization method
CN106980539A (en) The Method for HW/SW partitioning for the algorithm that leapfrogs is shuffled based on improvement
Agarwal et al. Algorithms for special cases of rectilinear Steiner trees: I. points on the boundary of a rectilinear rectangle
CN115204079A (en) Logic partitioning method, system, equipment and storage medium of digital circuit
CN112651488A (en) Method for improving training efficiency of large-scale graph convolution neural network
Chang et al. Multiple crossover and mutation operators enabled genetic algorithm for non-slicing VLSI floorplanning
CN115430128B (en) A device for generating a solitaire game
CN114202609B (en) Mixed heuristic graph coloring method
CN115906748A (en) 3D layout optimization method based on sliding window and discrete differential evolution algorithm
CN115562618A (en) Data ranking method, system, equipment and storage medium based on hardware
CN113516667A (en) Cost-balanced gate-level circuit diagram segmentation method, computer storage medium
Meuffels et al. Puzzle—Solving the Battleship puzzle as an integer programming problem
CN112035576A (en) Distributed storage method of blockchain ledger
CN117852479B (en) Multi-project wafer layout splicing method and device based on self-adaptive search and storage medium
Wang et al. A probabilistic approach to fault-tolerant routing algorithm on mesh networks
CN118590397A (en) A distributed cluster and a distributed cluster determination method
CN116756433B (en) Social network unrealistic information control method and device
CN120509375B (en) Automatic layout method of circuit diagram, storage medium and electronic equipment
CN119416730B (en) Method for realizing automatic connection of analog layout differential pairs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant