Method and tool for calculating connection path in contiguous watching game
By defining the path set and its subordinate relationship, the calculation process is simplified, and the problem of high path computing complexity in the existing technology is solved, and the computing efficiency and user experience of Lianlian Watching games are improved.
Patent Information
- Application Number
- CN202411230962.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-01-03
AI Technical Summary
When the prior art calculates the paths in the game, it is difficult to ensure the optimal path while reducing the complexity of the execution program and improving the computing efficiency, especially when processing large-scale game interfaces, it consumes a lot of computing resources.
By defining three path sets (minimum subset, parent set and maximum set) and their affiliation, creating corresponding logical units, recursively calling these logical units to calculate connection paths, including straight lines, one corner and two corner connection paths, simplifying Computation process to reduce complexity.
It realizes a simpler calculation method, reduces the computational complexity, improves program execution efficiency, and improves the user's gaming experience.
Smart Images

Figure CN119236409A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path calculation, and in particular to a method and a tool for calculating connection paths in a connect-the-dots game. Background Art
[0002] In the development of the Lianliankan game, path calculation is a key technology used to determine the connection path between two pattern elements. The following are some existing technologies and algorithms:
[0003] (1) Breadth-first search (BFS): Breadth-first search is one of the most commonly used algorithms for calculating paths. It starts from the starting pattern and searches for connectable patterns by traversing layer by layer until the target pattern is found or all possible paths are traversed. The BFS algorithm can ensure that the path found is the shortest path, but it may consume a lot of computing resources when processing large-scale game interfaces.
[0004] (2) Bidirectional search is an optimization technique that starts searching from both the starting pattern and the target pattern until the search paths on both sides intersect. By performing forward and reverse searches simultaneously, the search scope and time complexity can be reduced, thereby speeding up the path calculation.
[0005] These existing technologies provide a basis for the development and optimization of the Connect the Dots game, but there are still some challenges and room for improvement, such as how to improve the accuracy of path calculation, how to reduce the complexity of program execution while determining the optimal path, and how to improve computing efficiency. Summary of the invention
[0006] In view of the needs and shortcomings of current technology development, the present invention provides a method and tool for calculating connection paths in a connect-the-dots game, thereby solving the problem of calculating connection paths in the connect-the-dots game.
[0007] In a first aspect, the present invention provides a method for calculating a connection path in a Lianliankan game, and the technical solution adopted to solve the above technical problem is as follows:
[0008] A method for calculating a connection path in a Lianliankan game comprises the following steps:
[0009] S1. According to the rules of the Lianliankan game, three path sets are defined, the subordinate relationship between the three path sets is determined, and a logical unit for calculating each path set is formed;
[0010] S2. After the connect-the-dots game starts, first mark the pattern elements displayed on the game interface in the form of coordinates, then determine the two elements to be connected, recursively call the corresponding logic unit according to the subordinate relationship of the path set, calculate the connection path, and achieve the connection elimination of the two elements, or obtain a calculation result that the connection path is infeasible.
[0011] Optionally, the step S1 involved specifically includes:
[0012] According to the rules of the Lianliankan game, three path sets are defined: minimum subset, parent set and maximum set. The minimum subset includes straight-line connection paths, the parent set includes one-corner connection paths, and the maximum set includes two-corner connection paths.
[0013] Based on the inclusion relationship among the straight line connection path, the one-corner connection path and the two-corner connection path, it is determined that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set;
[0014] For the straight line connection path of the minimum subset, create a logic unit 1 for calculating whether two points can be connected by a straight line; for the one-corner connection path of the parent set, based on logic unit 1, create a logic unit 2 for calculating whether a one-corner connection can be made after adding an inflection point between the two points; for the two-corner connection path of the maximum set, based on logic unit 1 and logic unit 2, create a logic unit 3 for calculating whether two-corner connection can be made after adding two inflection points between the two points.
[0015] Further optionally, step S2 is performed to determine two identical elements to be connected, recursively call corresponding logic units according to the subordinate relationship of the path set, calculate the connection path, and eliminate the connection between the two elements, or obtain a calculation result that the connection path is infeasible. This process specifically includes:
[0016] S2.1. The elements A and B to be connected have the same content, and the x-coordinates and y-coordinates of the elements A and B are obtained;
[0017] S2.2, determine whether the x-coordinate or y-coordinate of element A is equal to that of element B. If so, execute step S2.3; if not, execute step S2.4 or step S2.5;
[0018] S2.3, calling logic unit 1, calculating whether there is an uneliminated element on the straight line connecting element A and element B, i) if there is no uneliminated element, the calculation is completed, and the straight line connection path between element A and element B is obtained, ii) if there is an uneliminated element, it is concluded that element A and element B cannot be connected by a straight line;
[0019] S2.4, call logic unit 2, calculate the intersection between the x-axis and the y-axis of element A and element B, when the intersection position corresponds to a blank element, set the intersection point to the effective inflection point m, call logic unit 1, calculate whether there is an uneliminated element on the straight line connecting element A and the effective inflection point m, and calculate whether there is an uneliminated element on the straight line connecting element B and the effective inflection point m, i) if there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are obtained, and a corner connection path is obtained by merging these two straight line connection paths, ii) if there are uneliminated elements, it is concluded that a straight line connection cannot be made between element A and / or element B and the effective inflection point m, that is, a corner connection cannot be made between element A and element B;
[0020] S2.5. Call logic unit three, take element A as the starting point, traverse on the x-axis and y-axis of element A toward element B, take the blank elements in the traversal process as potential turning points, and then call logic unit two to calculate whether any potential turning point can be connected to element B by a corner. i) If so, the calculation is completed, and the straight line connection path between element A and potential turning point q, the straight line connection path between potential turning point q and effective turning point m, and the straight line connection path between effective turning point m and element B are obtained. Merging these three straight line connection paths will obtain two corner connection paths. ii) If not, it is concluded that a corner connection cannot be made between potential turning point q and element B, that is, two corner connections cannot be made between element A and element B.
[0021] Preferably, execute step S2.5, call logic unit three, take element A as the starting point, and when traversing on the x-axis and y-axis of element A toward element B, first call logic unit one to calculate whether there are any uneliminated elements on the connecting line between the blank element and element A during the traversal process. If there are no uneliminated elements, use the blank element as a potential turning point, and then call logic unit two to calculate whether a corner connection can be made between the potential turning point and element B.
[0022] Optionally, step S2 is performed to mark the pattern elements displayed on the game interface in the form of coordinates, and the specific operations include:
[0023] Placing the pattern elements displayed on the game interface in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements;
[0024] All elements in the coordinate system are expressed in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
[0025] In a second aspect, the present invention provides a tool for calculating connection paths in a Lianliankan game. The technical solution adopted to solve the above technical problems is as follows:
[0026] A tool for calculating connection paths in a Lianliankan game, comprising:
[0027] A rule definition module is used to define three sets of paths according to the rules of the Lianliankan game;
[0028] A relationship determination module is used to determine the subordinate relationship of the three path sets;
[0029] A logic design module, used for designing and calculating a logic unit 1, a logic unit 2 and a logic unit 3 of the three path sets according to the subordinate relationship of the three path sets;
[0030] An element representation module is used to mark the pattern elements displayed on the game interface in the form of coordinates after the Lianliankan game starts;
[0031] A recursive calling module is used to call logic unit 1, logic unit 2 and logic unit 3 according to the subordinate relationship of the path set after determining two elements to be connected, and calculate the connection path;
[0032] The result output module is used to output the calculation result of a feasible connection path to eliminate the connection between the two elements, or output the calculation result of an infeasible connection path.
[0033] Optionally, the rule definition module involved defines three path sets, namely, a minimum subset, a parent set and a maximum set, according to the rules of the connect-the-dots game, wherein the minimum subset includes a straight line connection path, the parent set includes a corner connection path, and the maximum set includes two corner connection paths;
[0034] The involved relationship determination module determines that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set based on the inclusion relationship among the straight line connection path, the one corner connection path and the two corner connection paths;
[0035] The logic design module involved creates a logic unit 1 for calculating whether a straight line connection can be made between two points for the straight line connection path of the minimum subset; the logic design module involved creates a logic unit 2 for calculating whether a one-corner connection can be made between two points after adding an inflection point for the one-corner connection path of the parent set based on the logic unit 1; the logic design module involved creates a logic unit 3 for calculating whether two corner connections can be made between two points after adding two inflection points for the two-corner connection path of the maximum set based on the logic units 1 and 2.
[0036] Optionally, the recursive call modules involved specifically include:
[0037] A coordinate acquisition unit, used to acquire the x coordinate and y coordinate of element A and element B;
[0038] The judgment calling unit is used to judge whether the x coordinates or y coordinates of element A and element B are equal. If they are equal, the logic unit 1 is called; if they are not equal, the logic unit 2 or the logic unit 3 is called;
[0039] The logic unit 1 is used to calculate whether there is an uneliminated element on the straight line connecting element A and element B. i) If there is no uneliminated element, the calculation is completed, and the straight line connection path between element A and element B is output through the result output module. ii) If there is an uneliminated element, the result output module outputs a conclusion: element A and element B cannot be connected by a straight line.
[0040] The logic unit 2 calculates the intersection between the x-axis and the y-axis of element A and element B. When the intersection position corresponds to a blank element, the intersection is set as the effective inflection point m, and the logic unit 1 is called to calculate whether there are uneliminated elements on the straight line connecting element A and the effective inflection point m, and at the same time calculate whether there are uneliminated elements on the straight line connecting element B and the effective inflection point m. i) If there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are output through the result output module. The two straight line connection paths are merged to obtain a corner connection path. ii) If there are uneliminated elements, the result output module outputs a conclusion: element A and / or element B cannot be connected to the effective inflection point m in a straight line, that is, element A and element B cannot be connected at an angle.
[0041] Logical unit three takes element A as the starting point, traverses element A on the x-axis and y-axis toward element B, and uses the blank elements in the traversal process as potential turning points. Then, logical unit two is called to calculate whether any potential turning point can be connected to element B by a corner. i) If so, the calculation is completed, and the straight line connection path between element A and potential turning point q, the straight line connection path between potential turning point q and effective turning point m, and the straight line connection path between effective turning point m and element B are obtained. These three straight line connection paths are merged to obtain two corner connection paths. ii) If not, it is concluded that a corner connection cannot be made between potential turning point q and element B, that is, two corner connections cannot be made between element A and element B.
[0042] Further optionally, the logic unit three involved takes element A as the starting point, and when traversing on the x-axis and y-axis of element A toward element B, first calls logic unit one to calculate whether there are any uneliminated elements on the connecting line between the blank element and element A during the traversal process; if there are no uneliminated elements, the blank element is used as a potential turning point, and then logic unit two is called to calculate whether a corner connection can be made between the potential turning point and element B.
[0043] Optionally, after the Lianliankan game starts, the element representation module involved marks the pattern elements displayed on the game interface in the form of coordinates, and the specific operations include:
[0044] Placing the pattern elements displayed on the game interface in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements;
[0045] All elements in the coordinate system are expressed in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
[0046] Compared with the prior art, the method and tool for calculating connection paths in a Lianliankan game of the present invention have the following beneficial effects:
[0047] 1. The present invention avoids redundant calculations in a simpler way, can reduce the complexity of calculations as much as possible, improve the execution efficiency of the program, and thus enhance the user's gaming experience;
[0048] 2. The present invention simplifies the calculation process of the logic unit by means of the inclusion relationship between sets. This calculation idea is also applicable to other path calculation scenarios with inclusion relationships besides the Lianliankan game. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Attached Figure 1 is a flow chart of path connection calculation in Embodiment 1 of the present invention;
[0050] Attached Figure 2 is a module connection block diagram of the second embodiment of the present invention;
[0051] Attached Figure 3 Schematic diagram of three connection paths described in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.
[0053] Embodiment 1:
[0054] This embodiment provides a method for calculating a connection path in a Lianliankan game, which includes the following steps:
[0055] S1. According to the rules of the Lianliankan game:
[0056] Define three path sets: minimum subset, superset and maximum set. Figure 2 , the smallest subset includes straight-line connection paths, the superset includes one corner connection path, and the largest set includes two corner connection paths;
[0057] Based on the inclusion relationship among the straight line connection path, the one-corner connection path and the two-corner connection path, it is determined that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set;
[0058] For the straight line connection path of the minimum subset, create a logic unit 1 for calculating whether two points can be connected by a straight line; for the one-corner connection path of the parent set, based on logic unit 1, create a logic unit 2 for calculating whether a one-corner connection can be made after adding an inflection point between the two points; for the two-corner connection path of the maximum set, based on logic unit 1 and logic unit 2, create a logic unit 3 for calculating whether two-corner connection can be made after adding two inflection points between the two points.
[0059] S2. After the Lianliankan game starts, firstly, the pattern elements displayed on the game interface are placed in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements, and all elements in the coordinate system are represented in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
[0060] Then determine the two elements to be connected, recursively call the corresponding logic unit according to the subordinate relationship of the path set, calculate the connection path, and achieve the connection elimination of the two elements, or obtain the calculation result that the connection path is infeasible, refer to the attached Figure 1 , this process specifically includes:
[0061] S2.1, taking the determination of connecting element A and element B as an example, element A and element B should have the same content, and obtaining the x coordinate and y coordinate of element A and element B;
[0062] S2.2, determine whether the x-coordinate or y-coordinate of element A is equal to that of element B. If so, execute step S2.3; if not, execute step S2.4 or step S2.5;
[0063] S2.3, calling logic unit 1, calculating whether there is an uneliminated element on the straight line connecting element A and element B, i) if there is no uneliminated element, the calculation is completed, and the straight line connection path between element A and element B is obtained, ii) if there is an uneliminated element, it is concluded that element A and element B cannot be connected by a straight line; the time complexity of this calculation process is O(n);
[0064] S2.4, call logic unit 2, calculate the intersection between the x-axis and the y-axis of element A and element B, when the intersection position corresponds to a blank element, set the intersection point to the effective inflection point m, call logic unit 1, calculate whether there are uneliminated elements on the straight line connecting element A and the effective inflection point m, and calculate whether there are uneliminated elements on the straight line connecting element B and the effective inflection point m, i) if there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are obtained, and a corner connection path is obtained by merging these two straight line connection paths, ii) if there are uneliminated elements, it is concluded that element A and / or element B cannot be connected to the effective inflection point m by a straight line, that is, element A and element B cannot be connected by a corner; the time complexity of this calculation process is 4*O(n);
[0065] S2.5, call logic unit 3, take element A as the starting point, traverse on the x-axis and y-axis of element A toward element B, call logic unit 1①, calculate whether there is an uneliminated element on the connecting line between the blank element and element A during the traversal process, if there is no uneliminated element, take the blank element as a potential inflection point, then call logic unit 2②, calculate whether a corner connection can be made between any potential inflection point and element B, i) if yes, the calculation is completed, and the straight line connection path between element A and potential inflection point q, the straight line connection path between potential inflection point q and effective inflection point m, and the straight line connection path between effective inflection point m and element B are obtained, and the two corner connection paths are obtained by merging these three straight line connection paths, ii) if no, it is concluded that a corner connection cannot be made between potential inflection point q and element B, that is, two corner connections cannot be made between element A and element B. When calculating potential inflection point q, at most two axes are traversed plus one grid on each side, and the time complexity is 2*O(n), so the time complexity of this calculation process is 8*O(n2).
[0066] Embodiment 2:
[0067] Reference Figure 2 , 3 This embodiment provides a tool for calculating connection paths in a Lianliankan game, which includes:
[0068] A rule definition module, used to define three path sets, namely, a minimum subset, a parent set and a maximum set, according to the rules of the Lianliankan game, wherein the minimum subset includes a straight line connection path, the parent set includes a corner connection path, and the maximum set includes two corner connection paths;
[0069] A relationship determination module, for determining, based on the inclusion relationship among the straight line connection path, the one-corner connection path and the two-corner connection paths, that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set;
[0070] A logic design module is used to create a logic unit 1 for calculating whether a straight line connection can be made between two points for a straight line connection path of a minimum subset; a logic unit 2 for calculating whether a one-corner connection can be made between two points after adding an inflection point based on the logic unit 1 for a one-corner connection path of a parent set; and a logic unit 3 for calculating whether a two-corner connection can be made between two points after adding two inflection points based on the logic unit 1 and the logic unit 2 for a two-corner connection path of a maximum set;
[0071] An element representation module is used to mark the pattern elements displayed on the game interface in the form of coordinates after the Lianliankan game starts;
[0072] A recursive calling module is used to call logic unit 1, logic unit 2 and logic unit 3 according to the subordinate relationship of the path set after determining two elements to be connected, and calculate the connection path;
[0073] The result output module is used to output the calculation result of a feasible connection path to eliminate the connection between the two elements, or output the calculation result of an infeasible connection path.
[0074] In this embodiment, the element representation module involved marks the pattern elements displayed on the game interface in the form of coordinates, and the specific operations include:
[0075] Placing the pattern elements displayed on the game interface in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements;
[0076] All elements in the coordinate system are expressed in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
[0077] In this embodiment, the recursive call module involved specifically includes:
[0078] A coordinate acquisition unit, used to acquire the x coordinate and y coordinate of element A and element B;
[0079] The judgment calling unit is used to judge whether the x coordinates or y coordinates of element A and element B are equal. If they are equal, the logic unit 1 is called; if they are not equal, the logic unit 2 or the logic unit 3 is called;
[0080] The logic unit 1 is used to calculate whether there are uneliminated elements on the straight line connecting element A and element B. i) If there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and element B is output through the result output module. ii) If there are uneliminated elements, the result output module outputs the conclusion: element A and element B cannot be connected by a straight line. The time complexity of this calculation process is O(n).
[0081] The logic unit 2 calculates the intersection between the x-axis and the y-axis of element A and element B. When the intersection position corresponds to a blank element, the intersection is set as the effective inflection point m, and the logic unit 1 is called to calculate whether there are uneliminated elements on the connecting line between element A and the effective inflection point m, and at the same time calculate whether there are uneliminated elements on the connecting line between element B and the effective inflection point m. i) If there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are output through the result output module. The two straight line connection paths are merged to obtain a corner connection path. ii) If there are uneliminated elements, the conclusion is output through the result output module: element A and / or element B cannot be connected to the effective inflection point m by a straight line, that is, element A and element B cannot be connected by a corner. The time complexity of this calculation process is 4*O(n).
[0082] Logical unit three, starting from element A, traverses element A on the x-axis and y-axis toward element B. First, call logical unit one ① to calculate whether there are uneliminated elements on the connecting line between the blank element and element A during the traversal process. If there are no uneliminated elements, the blank element is used as a potential inflection point. Then call logical unit two ② to calculate whether any potential inflection point can be connected to element B with a corner. i) If yes, the calculation is completed, and the straight line connection path between element A and potential inflection point q, the straight line connection path between potential inflection point q and effective inflection point m, and the straight line connection path between effective inflection point m and element B are obtained. The two corner connection paths are obtained by merging these three straight line connection paths. ii) If no, it is concluded that the potential inflection point q and element B cannot be connected with a corner, that is, the elements A and B cannot be connected with two corners. When calculating the potential inflection point q, at most two axes are traversed plus one grid on each side. The time complexity is 2*O(n), so the time complexity of this calculation process is 8*O(n2).
[0083] In summary, the method and tool for calculating connection paths in a connect-the-dots game of the present invention can avoid redundant calculations in a simpler way, reduce the complexity of calculations as much as possible, improve the execution efficiency of the program, and thus enhance the user's gaming experience.
[0084] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.
Claims
1. A method for calculating a connection path in a Lianliankan game, characterized in that: The steps include: S1. According to the rules of the Lianliankan game, three path sets are defined, the subordinate relationship between the three path sets is determined, and a logical unit for calculating each path set is formed; S2. After the connect-the-dots game starts, first mark the pattern elements displayed on the game interface in the form of coordinates, then determine the two elements to be connected, recursively call the corresponding logic unit according to the subordinate relationship of the path set, calculate the connection path, and achieve the connection elimination of the two elements, or obtain a calculation result that the connection path is infeasible.
2. A method for calculating connection paths in a Lianliankan game according to claim 1, characterized in that: The step S1 specifically includes: According to the rules of the Lianliankan game, three path sets are defined: minimum subset, parent set and maximum set. The minimum subset includes straight-line connection paths, the parent set includes one-corner connection paths, and the maximum set includes two-corner connection paths. Based on the inclusion relationship among the straight line connection path, the one-corner connection path and the two-corner connection path, it is determined that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set; For the straight line connection path of the minimum subset, create a logic unit 1 for calculating whether two points can be connected by a straight line; for the one-corner connection path of the parent set, based on logic unit 1, create a logic unit 2 for calculating whether a one-corner connection can be made after adding an inflection point between the two points; for the two-corner connection path of the maximum set, based on logic unit 1 and logic unit 2, create a logic unit 3 for calculating whether two-corner connection can be made after adding two inflection points between the two points.
3. A method for calculating connection paths in a Lianliankan game according to claim 2, characterized in that: Execute step S2, determine two identical elements to be connected, recursively call corresponding logic units according to the subordinate relationship of the path set, calculate the connection path, and eliminate the connection between the two elements, or obtain a calculation result that the connection path is infeasible. This process specifically includes: S2.
1. The elements A and B to be connected have the same content, and the x-coordinates and y-coordinates of the elements A and B are obtained; S2.2, determine whether the x-coordinate or y-coordinate of element A is equal to that of element B. If so, execute step S2.3; if not, execute step S2.4 or step S2.5; S2.3, calling logic unit 1, calculating whether there is an uneliminated element on the straight line connecting element A and element B, i) if there is no uneliminated element, the calculation is completed, and the straight line connection path between element A and element B is obtained, ii) if there is an uneliminated element, it is concluded that element A and element B cannot be connected by a straight line; S2.4, call logic unit 2, calculate the intersection between the x-axis and the y-axis of element A and element B, when the intersection position corresponds to a blank element, set the intersection point to the effective inflection point m, call logic unit 1, calculate whether there is an uneliminated element on the straight line connecting element A and the effective inflection point m, and calculate whether there is an uneliminated element on the straight line connecting element B and the effective inflection point m, i) if there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are obtained, and a corner connection path is obtained by merging these two straight line connection paths, ii) if there are uneliminated elements, it is concluded that a straight line connection cannot be made between element A and / or element B and the effective inflection point m, that is, a corner connection cannot be made between element A and element B; S2.
5. Call logic unit three, take element A as the starting point, traverse on the x-axis and y-axis of element A toward element B, take the blank elements in the traversal process as potential turning points, and then call logic unit two to calculate whether any potential turning point can be connected to element B by a corner. i) If so, the calculation is completed, and the straight line connection path between element A and potential turning point q, the straight line connection path between potential turning point q and effective turning point m, and the straight line connection path between effective turning point m and element B are obtained. Merging these three straight line connection paths will obtain two corner connection paths. ii) If not, it is concluded that a corner connection cannot be made between potential turning point q and element B, that is, two corner connections cannot be made between element A and element B.
4. A method for calculating connection paths in a Lianliankan game according to claim 3, characterized in that: Execute step S2.5, call logic unit three, take element A as the starting point, and traverse on the x-axis and y-axis of element A toward element B. First, call logic unit one to calculate whether there are any uneliminated elements on the connecting line between the blank element and element A during the traversal process. If there are no uneliminated elements, use the blank element as a potential turning point, and then call logic unit two to calculate whether a corner connection can be made between the potential turning point and element B.
5. The method for calculating connection paths in a Lianliankan game according to claim 1, characterized in that: Execute step S2 to mark the pattern elements displayed on the game interface in the form of coordinates. The specific operations include: Placing the pattern elements displayed on the game interface in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements; All elements in the coordinate system are expressed in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
6. A tool for calculating connection paths in a Lianliankan game, characterized in that: It includes: A rule definition module is used to define three sets of paths according to the rules of the Lianliankan game; A relationship determination module is used to determine the subordinate relationship of the three path sets; A logic design module, used for designing and calculating a logic unit 1, a logic unit 2 and a logic unit 3 of three path sets according to the subordinate relationship of the three path sets; An element representation module is used to mark the pattern elements displayed on the game interface in the form of coordinates after the Lianliankan game starts; A recursive calling module is used to call logic unit 1, logic unit 2 and logic unit 3 according to the subordinate relationship of the path set after determining two elements to be connected, and calculate the connection path; The result output module is used to output the calculation result of a feasible connection path to eliminate the connection between the two elements, or output the calculation result of an infeasible connection path.
7. The tool for calculating connection paths in a Lianliankan game according to claim 6, characterized in that: The rule definition module defines three path sets, namely, a minimum subset, a superset and a maximum set, according to the rules of the Lianliankan game, wherein the minimum subset includes a straight line connection path, the superset includes a corner connection path, and the maximum set includes two corner connection paths; The relationship determination module determines that the minimum subset is subordinate to the parent set, and the parent set is subordinate to the maximum set based on the inclusion relationship among the straight line connection path, the one corner connection path and the two corner connection paths; The logic design module creates a logic unit 1 for calculating whether a straight line connection can be made between two points for the straight line connection path of the minimum subset; the logic design module creates a logic unit 2 for calculating whether a corner connection can be made between two points after an inflection point is added for the corner connection path of the parent set based on the logic unit 1; the logic design module creates a logic unit 3 for calculating whether two corner connections can be made between two points after two inflection points are added for the two corner connection path of the maximum set based on the logic units 1 and 2.
8. The tool for calculating connection paths in a Lianliankan game according to claim 7, characterized in that: The recursive call module specifically includes: A coordinate acquisition unit, used to acquire the x coordinate and y coordinate of element A and element B; The judgment calling unit is used to judge whether the x coordinates or y coordinates of element A and element B are equal. If they are equal, the logic unit 1 is called; if they are not equal, the logic unit 2 or the logic unit 3 is called; The logic unit 1 is used to calculate whether there is an uneliminated element on the straight line connecting element A and element B. i) If there is no uneliminated element, the calculation is completed, and the straight line connection path between element A and element B is output through the result output module. ii) If there is an uneliminated element, the result output module outputs a conclusion: element A and element B cannot be connected by a straight line. The logic unit 2 calculates the intersection between the x-axis and the y-axis of element A and element B. When the intersection position corresponds to a blank element, the intersection is set as the effective inflection point m, and the logic unit 1 is called to calculate whether there are uneliminated elements on the straight line connecting element A and the effective inflection point m, and at the same time calculate whether there are uneliminated elements on the straight line connecting element B and the effective inflection point m. i) If there are no uneliminated elements, the calculation is completed, and the straight line connection path between element A and the effective inflection point m and the straight line connection path between the effective inflection point m and element B are output through the result output module. The two straight line connection paths are merged to obtain a corner connection path. ii) If there are uneliminated elements, the result output module outputs a conclusion: element A and / or element B cannot be connected to the effective inflection point m in a straight line, that is, element A and element B cannot be connected at an angle. Logical unit three takes element A as the starting point, traverses element A on the x-axis and y-axis toward element B, and uses the blank elements in the traversal process as potential turning points. Then, logical unit two is called to calculate whether any potential turning point can be connected to element B by a corner. i) If so, the calculation is completed, and the straight line connection path between element A and potential turning point q, the straight line connection path between potential turning point q and effective turning point m, and the straight line connection path between effective turning point m and element B are obtained. These three straight line connection paths are merged to obtain two corner connection paths. ii) If not, it is concluded that a corner connection cannot be made between potential turning point q and element B, that is, two corner connections cannot be made between element A and element B.
9. The tool for calculating connection paths in a Lianliankan game according to claim 8, characterized in that: The logic unit three takes element A as the starting point, and when traversing on the x-axis and y-axis of element A toward element B, first calls logic unit one to calculate whether there are any uneliminated elements on the connecting line between the blank element and element A during the traversal process; if there are no uneliminated elements, the blank element is used as a potential turning point, and then logic unit two is called to calculate whether a corner connection can be made between the potential turning point and element B.
10. The tool for calculating connection paths in a Lianliankan game according to claim 6, characterized in that: After the Lianliankan game starts, the element representation module marks the pattern elements displayed on the game interface in the form of coordinates. The specific operations include: Placing the pattern elements displayed on the game interface in a coordinate system, wherein the coordinate system includes uneliminated elements and blank elements; All elements in the coordinate system are expressed in the form of coordinates (x, y), and the corresponding element content is marked at each coordinate point.
