├── LICENSE ├── README.md ├── gui.go ├── sim.cs └── sim.go /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kkdy 2 | 3 | 项目介绍地址: https://www.bilibili.com/video/BV1594y1D7hn 4 | 5 | sim.go 源码 6 | 7 | gui.go 图形化界面 8 | 9 | sim.cs 旧版源码 10 | -------------------------------------------------------------------------------- /gui.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fyne.io/fyne/v2" 5 | "fyne.io/fyne/v2/app" 6 | "fyne.io/fyne/v2/data/binding" 7 | "fyne.io/fyne/v2/container" 8 | "fyne.io/fyne/v2/widget" 9 | 10 | //"os" 11 | //"fmt" 12 | "time" 13 | "math" 14 | "runtime" 15 | "sync/atomic" 16 | "strconv" 17 | ) 18 | 19 | var log bool = true 20 | var debug bool = false 21 | var times int32 = 2148 // 2148 22 | var step int32 = 10000 // 1000000 23 | 24 | type Random struct{ 25 | inext int 26 | inextp int 27 | SeedArray [56]int32 28 | seed int32 29 | 30 | mp int 31 | } 32 | func (random *Random) init( Seed int32 ){ 33 | const MBIG int32 = 2147483647; 34 | const MSEED int32 = 161803398; 35 | 36 | const Int32_min int32 = -2147483648; 37 | const Int32_max int32 = 2147483647; 38 | 39 | var mj, mk int32 40 | 41 | mj = MSEED - Seed; 42 | random.SeedArray[55] = mj; 43 | mk = 1; 44 | for i := 1; i < 55; i++ { 45 | ii := (21 * i) % 55; 46 | random.SeedArray[ii] = mk; 47 | mk = mj - mk; 48 | if (mk < 0) { mk = mk + MBIG } 49 | mj = random.SeedArray[ii]; 50 | } 51 | for k := 1; k < 5; k++ { 52 | for i := 1; i < 56; i++ { 53 | random.SeedArray[i] = random.SeedArray[i] - random.SeedArray[1 + (i + 30) % 55] 54 | if random.SeedArray[i] < 0 { random.SeedArray[i] = random.SeedArray[i] + MBIG } 55 | } 56 | } 57 | random.inext = 0 58 | random.inextp = 31 59 | random.mp = 0 60 | random.seed = Seed 61 | } 62 | func (random *Random) NextDouble() float64{ 63 | const MBIG int32 = 2147483647; 64 | 65 | random.inext = random.inext + 1 66 | random.inextp = random.inextp + 1 67 | if random.inext >= 56 { 68 | random.inext = 1 69 | } 70 | if random.inextp >= 56 { 71 | random.inextp = 1 72 | } 73 | var retVal int32 = random.SeedArray[random.inext] - random.SeedArray[random.inextp] 74 | 75 | if (retVal < 0){ 76 | retVal = retVal + MBIG 77 | } 78 | 79 | random.SeedArray[random.inext] = retVal; 80 | 81 | return float64(retVal) * (1.0 / float64(MBIG)); 82 | } 83 | func (random *Random) attack (def int, hp int) int { 84 | const prob float64 = 0.20 85 | const kkdyAtk float64 = 446.0 86 | 87 | var normal int = int(math.Round(kkdyAtk)) 88 | var cirt int = int(math.Round(kkdyAtk * 1.6)) 89 | var skill int = int(math.Round(kkdyAtk * 1.4)) 90 | var skill_crit int = int(math.Round(kkdyAtk * 1.6 * 1.4)) 91 | 92 | damage := 0 93 | if random.mp == 4 { 94 | if random.NextDouble() > prob { 95 | damage = skill - def; 96 | } else { 97 | damage = skill_crit - def; 98 | } 99 | if hp > damage { 100 | if random.NextDouble() > prob { 101 | damage = damage + skill - def; 102 | } else { 103 | damage = damage + skill_crit - def; 104 | } 105 | } 106 | 107 | } else { 108 | if random.NextDouble() > prob { 109 | damage = normal - def; 110 | } else { 111 | damage = cirt - def; 112 | } 113 | } 114 | 115 | random.mp = random.mp + 1 116 | if random.mp > 4 { 117 | random.mp = 0; 118 | } 119 | 120 | return damage; 121 | } 122 | 123 | const ( 124 | def_g int = 0 125 | hp_g int = 1700 126 | 127 | def_s int = 100 128 | hp_s int = 2000 129 | 130 | def_t int = 85 131 | hp_t int = 2000 132 | 133 | def_d int = 250 134 | hp_d int = 2050 135 | 136 | def_l int = 50 137 | hp_l int = 5000 138 | 139 | def_w int = 100 140 | hp_w int = 10000 141 | ) 142 | var ( 143 | def []int 144 | max_hp []int 145 | 146 | process chan int32 147 | wait chan bool 148 | ) 149 | 150 | func print(args ...interface{}){ 151 | //fmt.Println(args...) 152 | //fmt.Fprintln(fout,args...) 153 | } 154 | 155 | // 统计 156 | var ( 157 | 统计_阶段_1 int32 = 0 158 | 统计_阶段_3 int32 = 0 159 | 统计_死亡_13 int32 = 0 160 | 统计_阶段_4 int32 = 0 161 | 统计_阶段_5_1 int32 = 0 162 | 统计_阶段_5_2 int32 = 0 163 | 统计_阶段_5_1_分支 int32 = 0 164 | 统计_阶段_5_2_分支 int32 = 0 165 | 统计_死亡_18 int32 = 0 166 | 统计_速死_18 int32 = 0 167 | 统计_速死_19 int32 = 0 168 | 统计_死亡_20 int32 = 0 169 | 统计_死亡_21 int32 = 0 170 | 统计_速死_21 int32 = 0 171 | 统计_死亡_22 int32 = 0 172 | 统计_速死_23 int32 = 0 173 | 统计_死亡_23 int32 = 0 174 | 统计_死亡_w int32 = 0 175 | 统计_阶段_w int32 = 0 176 | 177 | 统计_流未死 int32 = 0 178 | 统计_盾未死 int32 = 0 179 | 180 | TODO_T1 int32 = 0 181 | TODO_T2 int32 = 0 182 | TODO_T3 int32 = 0 183 | TODO_T4 int32 = 0 184 | 185 | DONE int32 = 0 186 | ) 187 | 188 | // timeline 189 | var ( 190 | 阶段_2 [][]int = [][]int{ 191 | {7,0,0}, 192 | {7,0,0}, 193 | {7,0,0}, 194 | {7,0,0}, 195 | {8,7,0}, 196 | {8,7,0}, 197 | {8,7,0}, 198 | {8,7,0}, 199 | {8,7,9}, 200 | {7,9,10}, 201 | {7,9,10}, 202 | {7,9,10}, 203 | {7,9,10}, 204 | {9,10,0}, 205 | {9,10,0}, 206 | {9,10,0}, 207 | } 208 | 阶段_3 [][]int = [][]int{ 209 | {11,0,0}, 210 | {11,0,0}, 211 | {11,12,0}, 212 | {11,13,12}, 213 | {11,13,12}, 214 | {11,13,12}, 215 | {13,11,12}, 216 | {11,12,0}, 217 | {12,0,0}, 218 | {12,0,0}, 219 | {12,0,0}, 220 | {12,0,0}, 221 | {12,0,0}, 222 | {12,0,0}, 223 | {12,0,0}, 224 | {12,0,0}, 225 | } 226 | 阶段_4 [][]int = [][]int{ 227 | {14,0,0}, 228 | {14,0,0}, 229 | {14,15,0}, 230 | {14,15,0}, 231 | {14,15,16}, 232 | {14,15,16}, 233 | {14,15,16}, 234 | {14,15,16}, 235 | {15,17,16}, 236 | {15,17,16}, 237 | {17,16,0}, 238 | {17,16,0}, 239 | {16,0,0}, 240 | {16,0,0}, 241 | {16,0,0}, 242 | {16,18,0}, 243 | {16,18,19}, 244 | } 245 | 阶段_5_1_S [][]int = [][]int{ 246 | {18,0,0}, 247 | {18,0,0}, 248 | {18,19,0}, 249 | {18,19,0}, 250 | {18,19,0}, 251 | {19,0,0}, // {19,20,0}, 252 | {19,20,21}, 253 | {19,20,21}, 254 | {19,20,21}, 255 | {20,21,0}, 256 | {21,0,0}, 257 | {21,0,0}, 258 | {21,0,0}, 259 | } 260 | 阶段_5_1_M [][]int = [][]int{ 261 | {22,21, 0, 0}, 262 | {22,21,23, 0}, 263 | {22,21,23, 0}, 264 | {22,21,23,24}, 265 | {22,21,23,24}, 266 | } 267 | 阶段_5_1_燃烧_不变 [][]int = [][]int{ 268 | {22,21}, 269 | {22,21,23}, 270 | {22,21,23}, 271 | {22,21,23,24}, 272 | {22,21,24,23}, 273 | {22,25,21,24,23}, 274 | {22,25,21,24,23}, 275 | {22,25,21,24,23}, 276 | {22,25,21,24,23}, 277 | {22,21,25,24,23}, 278 | {22,21,25,24,23}, 279 | {21,22,25,24,23}, 280 | {22,21,24,25,23}, 281 | {22,24,25,26,23}, 282 | {24,26,25,23}, 283 | {24,26,25,23}, 284 | {26,25,23}, 285 | {26,25,23}, 286 | {26,25,23}, 287 | {26,25,23}, 288 | {25,23}, 289 | {25,27,23}, 290 | {27,25,23,28}, 291 | {27,25,29,23,28}, 292 | {27,25,29,23,28}, 293 | {29,25,23,28}, 294 | {29,25,23,28}, 295 | {29,25,23,28}, 296 | {29,25,23,28}, 297 | {25,29,23,28}, 298 | {25,29,23,28}, 299 | {29,23,28}, 300 | {29,23,28}, 301 | {29,23,28}, 302 | {23,28}, 303 | {23,28}, 304 | {28,30}, 305 | {30}, 306 | {30}, 307 | {30}, 308 | {30}, 309 | {30}, 310 | {30}, 311 | {30}, 312 | {30}, 313 | {30}, 314 | {30}, 315 | {30}, 316 | {30}, 317 | {30}, 318 | {30}, 319 | } 320 | 阶段_5_1_燃烧_变 [][]int = [][]int{ 321 | {24,23}, 322 | {25,24,23}, 323 | {25,24,23}, 324 | {25,24,23}, 325 | {25,24,23}, 326 | {25,24,23}, 327 | {25,24,23}, 328 | {24,25,23}, 329 | {24,25,23}, 330 | {24,25,26,23}, 331 | {24,26,25,23}, 332 | {24,26,25,23}, 333 | {26,25,23}, 334 | {26,25,23}, 335 | {26,25,23}, 336 | {26,25,23}, 337 | {25,27,23}, 338 | {27,25,23}, 339 | {27,25,23,28}, 340 | {27,25,29,23,28}, 341 | {27,25,29,23,28}, 342 | {29,25,23,28}, 343 | {29,25,23,28}, 344 | {29,25,23,28}, 345 | {25,29,28,23}, 346 | {25,29,28,23}, 347 | {29,28,23}, 348 | {29,28,23}, 349 | {29,28,23}, 350 | {28,23}, 351 | {28,23}, 352 | {28,23}, 353 | {23,30}, 354 | {30}, 355 | {30}, 356 | {30}, 357 | {30}, 358 | {30}, 359 | {30}, 360 | {30}, 361 | {30}, 362 | {30}, 363 | {30}, 364 | } 365 | 阶段_5_1_双持_不变 [][]int = [][]int{ 366 | {22,21}, 367 | {22,21,23}, 368 | {22,21,23}, 369 | {22,21,23}, 370 | {22,21,23,24}, 371 | {22,21,25,23,24}, 372 | {22,21,25,23,24}, 373 | {22,21,25,23,24}, 374 | {22,21,25,23,24}, 375 | {22,21,25,23,24}, 376 | {22,21,25,23,24}, 377 | {21,22,25,23,24}, 378 | {22,21,25,24,23}, 379 | {22,25,26,24,23}, 380 | {26,25,24,23}, 381 | {26,25,24,23}, 382 | {26,25,24,23}, 383 | {26,25,24,23}, 384 | {26,25,24,23}, 385 | {26,24,25,23}, 386 | {24,25,23}, 387 | {24,25,27,23}, 388 | {24,27,25,23,28}, 389 | {24,27,25,29,23,28}, 390 | {27,25,29,23,28}, 391 | {29,25,23,28}, 392 | {29,25,23,28}, 393 | {29,25,23,28}, 394 | {29,25,23,28}, 395 | {25,29,23,28}, 396 | {25,29,23,28}, 397 | {29,23,28}, 398 | {29,23,28}, 399 | {29,23,28}, 400 | {23,28}, 401 | {23,28}, 402 | {28,30}, 403 | {30}, 404 | {30}, 405 | {30}, 406 | {30}, 407 | {30}, 408 | {30}, 409 | {30}, 410 | {30}, 411 | {30}, 412 | {30}, 413 | } 414 | 阶段_5_1_双持_变 [][]int = [][]int{ 415 | {24}, 416 | {25,24}, 417 | {25,24}, 418 | {25,24}, 419 | {25,24}, 420 | {25,24}, 421 | {25,24}, 422 | {25,24}, 423 | {25,24}, 424 | {25,26,24}, 425 | {26,25,24}, 426 | {26,25,24}, 427 | {26,25,24}, 428 | {26,25,24}, 429 | {26,24,25}, 430 | {26,24,25}, 431 | {24,25,27}, 432 | {24,27,25}, 433 | {24,27,25,28}, 434 | {27,25,29,28}, 435 | {27,25,29,28}, 436 | {29,25,28}, 437 | {29,25,28}, 438 | {29,25,28}, 439 | {25,29,28}, 440 | {25,29,28}, 441 | {29,28}, 442 | {29,28}, 443 | {29,28}, 444 | {28}, 445 | {28}, 446 | {28}, 447 | {30}, 448 | {30}, 449 | {30}, 450 | {30}, 451 | {30}, 452 | {30}, 453 | {30}, 454 | {30}, 455 | {30}, 456 | {30}, 457 | } 458 | 阶段_5_1_w_不变 [][]int = [][]int{ 459 | {22,21,25,24,23}, 460 | {22,21,25,24,23}, 461 | {22,21,25,24,23}, 462 | {22,21,25,24,23}, 463 | {22,21,25,24,23}, 464 | {22,21,25,24,23}, 465 | {22,21,25,24,23}, 466 | {22,21,25,24,23}, 467 | {22,25,26,24,23}, 468 | {26,25,24,23}, 469 | {26,25,24,23}, 470 | {26,25,24,23}, 471 | {26,25,24,23}, 472 | {26,25,24,23}, 473 | {26,24,25,23}, 474 | {24,25,23}, 475 | {24,25,27,23}, 476 | {24,27,25,23,28}, 477 | {24,27,25,29,23,28}, 478 | {27,25,29,23,28}, 479 | {29,25,23,28}, 480 | {29,25,23,28}, 481 | {29,25,23,28}, 482 | {29,25,23,28}, 483 | {29,25,28,23}, 484 | {29,25,28,23}, 485 | {29,25,23,28}, 486 | {29,28,25,23}, 487 | {29,28,23,25}, 488 | {28,23,25}, 489 | {23,28,25}, 490 | {28,25,23,30}, 491 | {23,25,30}, 492 | {30}, 493 | {30}, 494 | {30}, 495 | {30}, 496 | {30}, 497 | {30}, 498 | {30}, 499 | {30}, 500 | {30}, 501 | {30}, 502 | } 503 | 阶段_5_1_w_变 [][]int = [][]int{ 504 | {25,24,23}, 505 | {25,24,23}, 506 | {25,24,23}, 507 | {25,24,23}, 508 | {25,24,23}, 509 | {25,24,23}, 510 | {25,24,23}, 511 | {25,24,23}, 512 | {25,26,24,23}, 513 | {26,25,24,23}, 514 | {26,25,24,23}, 515 | {26,25,24,23}, 516 | {26,25,24,23}, 517 | {26,25,24,23}, 518 | {26,24,25,23}, 519 | {24,25,23}, 520 | {24,25,27,23}, 521 | {24,27,25,23,28}, 522 | {24,27,25,29,23,28}, 523 | {27,25,29,23,28}, 524 | {29,25,23,28}, 525 | {29,25,23,28}, 526 | {29,25,23,28}, 527 | {29,25,23,28}, 528 | {25,29,28,23}, 529 | {25,29,28,23}, 530 | {29,28}, 531 | {29,28}, 532 | {29,28}, 533 | {28}, 534 | {28}, 535 | {28,30}, 536 | {30}, 537 | {30}, 538 | {30}, 539 | {30}, 540 | {30}, 541 | {30}, 542 | {30}, 543 | {30}, 544 | {30}, 545 | } 546 | 阶段_5_21速死_w_不变 [][]int = [][]int{{22},{22,23},{22,23},{22,23},{22,23,24},{22,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,26,24,23},{22,25,26,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,24,25,23},{26,24,25,23},{24,25,27,23},{24,27,25,23},{24,27,25,23,28},{27,25,29,23,28},{27,25,29,23,28},{29,25,23,28},{29,25,23,28},{29,25,23,28},{29,25,28,23},{29,25,28,23},{29,25,28,23},{29,28,25,23},{29,28,23,25},{28,23,25},{28,23,25},{28,25,23,30},{23,25,30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30}} 547 | 阶段_5_21速死_w_变 [][]int = [][]int{{22},{22,23},{22,23},{22,23},{22,23,24},{22,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,26,24,23},{22,25,26,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,24,25,23},{26,24,25,23},{24,25,27,23},{24,27,25,23},{24,27,25,23,28},{27,25,29,23,28},{27,25,29,23,28},{29,25,23,28},{29,25,23,28},{29,25,23,28},{25,29,28},{25,29,28},{29,28},{29,28},{29,28},{28},{28},{28,30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30}} 548 | 阶段_5_21速死_燃烧_不变 [][]int = [][]int{ 549 | {22}, 550 | {22,23}, 551 | {22,23}, 552 | {22,23}, 553 | {22,23,24}, 554 | {22,24,23}, 555 | {22,25,24,23}, 556 | {22,25,24,23}, 557 | {22,25,24,23}, 558 | {22,25,24,23}, 559 | {22,25,24,23}, 560 | {22,25,24,23}, 561 | {22,24,25,23}, 562 | {22,24,25,26,23}, 563 | {22,24,25,26,23}, 564 | {24,26,25,23}, 565 | {24,26,25,23}, 566 | {26,25,23}, 567 | {26,25,23}, 568 | {26,25,23}, 569 | {26,25,23}, 570 | {25,27,23}, 571 | {27,25,23}, 572 | {27,25,23,28}, 573 | {27,25,29,23,28}, 574 | {27,25,29,23,28}, 575 | {29,25,23,28}, 576 | {29,25,23,28}, 577 | {29,25,23,28}, 578 | {25,29,23,28}, 579 | {25,29,23,28}, 580 | {29,28,23}, 581 | {29,23,28}, 582 | {29,23,28}, 583 | {23,28}, 584 | {23,28}, 585 | {23,28}, 586 | {30}, 587 | {30}, 588 | {30}, 589 | {30}, 590 | {30}, 591 | {30}, 592 | {30}, 593 | {30}, 594 | {30}, 595 | {30}, 596 | {30}, 597 | } 598 | 阶段_5_21速死_燃烧_变 [][]int = [][]int{ 599 | {23}, 600 | {23}, 601 | {23}, 602 | {24,23}, 603 | {25,24,23}, 604 | {25,24,23}, 605 | {25,24,23}, 606 | {25,24,23}, 607 | {25,24,23}, 608 | {25,24,23}, 609 | {25,24,23}, 610 | {24,25,23}, 611 | {24,25,26,23}, 612 | {24,26,25,23}, 613 | {24,26,25,23}, 614 | {24,26,25,23}, 615 | {26,25,23}, 616 | {26,25,23}, 617 | {26,25,23}, 618 | {25,23}, 619 | {25,27,23}, 620 | {27,25,23,28}, 621 | {27,25,29,23,28}, 622 | {27,25,29,23,28}, 623 | {29,25,23,28}, 624 | {29,25,23,28}, 625 | {29,25,23,28}, 626 | {29,25,23,28}, 627 | {25,29,23,28}, 628 | {25,29,23,28}, 629 | {29,23,28}, 630 | {29,23,28}, 631 | {29,23,28}, 632 | {23,28}, 633 | {23,28}, 634 | {28,30}, 635 | {30}, 636 | {30}, 637 | {30}, 638 | {30}, 639 | {30}, 640 | {30}, 641 | {30}, 642 | {30}, 643 | } 644 | 阶段_5_21速死_双持_不变 [][]int = [][]int{ 645 | {22}, 646 | {22,23}, 647 | {22,23}, 648 | {22,23}, 649 | {22,23,24}, 650 | {22,23,24}, 651 | {22,25,23,24}, 652 | {22,25,23,24}, 653 | {22,25,23,24}, 654 | {22,25,23,24}, 655 | {22,25,23,24}, 656 | {22,25,23,24}, 657 | {22,25,24,23}, 658 | {22,25,24,23}, 659 | {22,25,26,24,23}, 660 | {26,25,24,23}, 661 | {26,25,24,23}, 662 | {26,25,24,23}, 663 | {26,25,24,23}, 664 | {26,24,25,23}, 665 | {26,24,25,23}, 666 | {24,25,27,23}, 667 | {24,27,25,23}, 668 | {24,27,25,23,28}, 669 | {27,25,29,23,28}, 670 | {27,25,29,23,28}, 671 | {29,25,23,28}, 672 | {29,25,23,28}, 673 | {29,25,23,28}, 674 | {25,29,23,28}, 675 | {25,29,23,28}, 676 | {29,23,28}, 677 | {29,23,28}, 678 | {29,23,28}, 679 | {23,28}, 680 | {23,28}, 681 | {23,28}, 682 | {30}, 683 | {30}, 684 | {30}, 685 | {30}, 686 | {30}, 687 | {30}, 688 | {30}, 689 | {30}, 690 | {30}, 691 | {30}, 692 | {30}, 693 | {30}, 694 | } 695 | 阶段_5_21速死_双持_变 [][]int = [][]int{ 696 | {24}, 697 | {25,24}, 698 | {25,24}, 699 | {25,24}, 700 | {25,24}, 701 | {25,24}, 702 | {25,24}, 703 | {25,24}, 704 | {25,24}, 705 | {25,26,24}, 706 | {26,25,24}, 707 | {26,25,24}, 708 | {26,25,24}, 709 | {26,25,24}, 710 | {26,25,24}, 711 | {26,24,25}, 712 | {24,25}, 713 | {24,25,27}, 714 | {24,27,25,28}, 715 | {24,27,25,29,28}, 716 | {27,25,29,28}, 717 | {29,25,28}, 718 | {29,25,28}, 719 | {29,25,28}, 720 | {29,25,28}, 721 | {25,29,28}, 722 | {25,29,28}, 723 | {29,28}, 724 | {29,28}, 725 | {29,28}, 726 | {28}, 727 | {28}, 728 | {28,30}, 729 | {30}, 730 | {30}, 731 | {30}, 732 | {30}, 733 | {30}, 734 | {30}, 735 | {30}, 736 | {30}, 737 | {30}, 738 | } 739 | 阶段_5_2_S [][]int = [][]int{ {18,19},{18,19},{19},{19,20},{19,20,21},{19,20,21},{19,20,21},{21},{21},{21},{21} } 740 | 阶段_5_2_M [][]int = [][]int{ 741 | {21,22,23}, 742 | {22,21,23}, 743 | {22,21,23}, 744 | {22,21,23,24}, 745 | {22,21,24,23}, 746 | } 747 | 阶段_5_2_燃烧_不变 [][]int = [][]int{ 748 | {21,22,23}, 749 | {22,21,23}, 750 | {22,21,23}, 751 | {22,21,23,24}, 752 | {22,21,24,23}, 753 | {22,21,25,24,23}, 754 | {22,21,25,24,23}, 755 | {22,21,25,24,23}, 756 | {22,21,25,24,23}, 757 | {22,21,25,24,23}, 758 | {22,21,25,24,23}, 759 | {22,21,25,24,23}, 760 | {22,21,24,25,23}, 761 | {22,24,25,26,23}, 762 | {24,26,25,23}, 763 | {24,26,25,23}, 764 | {26,25,23}, 765 | {26,25,23}, 766 | {26,25,23}, 767 | {26,25,23}, 768 | {25,23}, 769 | {27,25,23}, 770 | {27,25,23,28}, 771 | {27,25,29,23,28}, 772 | {27,25,29,23,28}, 773 | {29,25,23,28}, 774 | {29,25,23,28}, 775 | {29,25,23,28}, 776 | {25,29,28,23}, 777 | {25,29,28,23}, 778 | {29,23,28}, 779 | {29,28,23}, 780 | {29,28,23}, 781 | {28,23}, 782 | {23,28}, 783 | {28,23}, 784 | {30}, 785 | {30}, 786 | {30}, 787 | {30}, 788 | {30}, 789 | {30}, 790 | {30}, 791 | {30}, 792 | {30}, 793 | {30}, 794 | {30}, 795 | } 796 | 阶段_5_2_燃烧_变 [][]int = [][]int{ 797 | {24,23}, 798 | {25,24,23}, 799 | {25,24,23}, 800 | {25,24,23}, 801 | {25,24,23}, 802 | {25,24,23}, 803 | {25,24,23}, 804 | {25,24,23}, 805 | {24,25,23}, 806 | {24,25,26,23}, 807 | {24,25,26,23}, 808 | {24,26,25,23}, 809 | {24,26,25,23}, 810 | {26,25,23}, 811 | {26,25,23}, 812 | {26,25,23}, 813 | {26,25,23}, 814 | {25,27,23}, 815 | {27,25,23}, 816 | {27,25,23,28}, 817 | {27,25,29,23,28}, 818 | {29,25,23,28}, 819 | {29,25,23,28}, 820 | {29,25,23,28}, 821 | {29,25,23,28}, 822 | {25,29,28,23}, 823 | {25,29,28,23}, 824 | {29,23,28}, 825 | {29,28,23}, 826 | {29,28,23}, 827 | {28,23}, 828 | {23,28}, 829 | {28,23,30}, 830 | {30}, 831 | {30}, 832 | {30}, 833 | {30}, 834 | {30}, 835 | {30}, 836 | {30}, 837 | {30}, 838 | {30}, 839 | } 840 | 阶段_5_2_双持_不变 [][]int = [][]int{ 841 | {21,22,23}, 842 | {22,21,23}, 843 | {22,21,23}, 844 | {22,21,23,24}, 845 | {22,21,23,24}, 846 | {22,21,25,23,24}, 847 | {22,21,25,23,24}, 848 | {22,21,25,23,24}, 849 | {22,21,25,23,24}, 850 | {22,21,25,23,24}, 851 | {22,21,25,23,24}, 852 | {22,21,25,24,23}, 853 | {22,21,25,24,23}, 854 | {22,25,26,24,23}, 855 | {26,25,24,23}, 856 | {26,25,24,23}, 857 | {26,25,24,23}, 858 | {26,25,24,23}, 859 | {26,25,24,23}, 860 | {26,24,25,23}, 861 | {24,25,23}, 862 | {24,27,25,23}, 863 | {24,27,25,23,28}, 864 | {27,25,29,23,28}, 865 | {27,25,29,23,28}, 866 | {29,25,23,28}, 867 | {29,25,23,28}, 868 | {29,25,23,28}, 869 | {25,29,23,28}, 870 | {25,29,23,28}, 871 | {29,23,28}, 872 | {29,23,28}, 873 | {29,23,28}, 874 | {23,28}, 875 | {23,28}, 876 | {23,28}, 877 | {30}, 878 | {30}, 879 | {30}, 880 | {30}, 881 | {30}, 882 | {30}, 883 | {30}, 884 | {30}, 885 | {30}, 886 | {30}, 887 | {30}, 888 | {30}, 889 | {30}, 890 | } 891 | 阶段_5_2_w_不变 [][]int = [][]int{ 892 | {22,21,25,24}, 893 | {22,21,25,24}, 894 | {22,21,25,24}, 895 | {22,21,25,24}, 896 | {22,21,25,24}, 897 | {22,21,25,24}, 898 | {22,21,25,24}, 899 | {22,21,25,24}, 900 | {22,25,26,24}, 901 | {26,25,24}, 902 | {26,25,24}, 903 | {26,25,24}, 904 | {26,25,24}, 905 | {26,25,24}, 906 | {26,24,25}, 907 | {24,25}, 908 | {24,27,25}, 909 | {24,27,25,28}, 910 | {27,25,29,28}, 911 | {27,25,29,28}, 912 | {29,25,28}, 913 | {29,25,28}, 914 | {29,25,28}, 915 | {29,25,28}, 916 | {29,25,28}, 917 | {29,25,28}, 918 | {29,28,25}, 919 | {29,28,25}, 920 | {28,25}, 921 | {28,25}, 922 | {28,25}, 923 | {23,25,30}, 924 | {30}, 925 | {30}, 926 | {30}, 927 | {30}, 928 | {30}, 929 | {30}, 930 | {30}, 931 | {30}, 932 | {30}, 933 | {30}, 934 | {30}, 935 | {30}, 936 | } 937 | 阶段_5_2_w_变 [][]int = [][]int{ 938 | {25,24}, 939 | {25,24}, 940 | {25,24}, 941 | {25,24}, 942 | {25,24}, 943 | {25,24}, 944 | {25,24}, 945 | {25,24}, 946 | {25,26,24}, 947 | {26,25,24}, 948 | {26,25,24}, 949 | {26,25,24}, 950 | {26,25,24}, 951 | {26,25,24}, 952 | {26,24,25}, 953 | {24,25}, 954 | {24,27,25}, 955 | {24,27,25,28}, 956 | {27,25,29,28}, 957 | {27,25,29,28}, 958 | {29,25,28}, 959 | {29,25,28}, 960 | {29,25,28}, 961 | {29,25,28}, 962 | {25,29,28}, 963 | {29,28}, 964 | {29,28}, 965 | {29,28}, 966 | {28}, 967 | {28}, 968 | {28}, 969 | {30}, 970 | {30}, 971 | {30}, 972 | {30}, 973 | {30}, 974 | {30}, 975 | {30}, 976 | {30}, 977 | {30}, 978 | {30}, 979 | {30}, 980 | {30}, 981 | {30}, 982 | } 983 | 阶段_5_23速死 [][]int = [][]int{ 984 | {24}, 985 | {24}, 986 | {25,24}, 987 | {25,24}, 988 | {25,24}, 989 | {25,24}, 990 | {25,24}, 991 | {25,24}, 992 | {25,24}, 993 | {24,25}, 994 | {24,25,26}, 995 | {24,26,25}, 996 | {24,26,25}, 997 | {26,25}, 998 | {26,25}, 999 | {26,25}, 1000 | {26,25}, 1001 | {25}, 1002 | {25,27}, 1003 | {27,25,28}, 1004 | {27,25,29,28}, 1005 | {27,25,29,28}, 1006 | {29,25,28}, 1007 | {29,25,28}, 1008 | {29,25,28}, 1009 | {29,25,28}, 1010 | {25,29,28}, 1011 | {25,29,28}, 1012 | {29,28}, 1013 | {29,28}, 1014 | {29,28}, 1015 | {28}, 1016 | {28}, 1017 | {28,30}, 1018 | {30}, 1019 | {30}, 1020 | {30}, 1021 | {30}, 1022 | {30}, 1023 | {30}, 1024 | {30}, 1025 | {30}, 1026 | {30}, 1027 | {30}, 1028 | } 1029 | ) 1030 | 1031 | var running bool = false 1032 | var label_str binding.String 1033 | 1034 | func main() { 1035 | a := app.New() 1036 | w := a.NewWindow("kkdyBenchmark") 1037 | 1038 | w.Resize(fyne.Size{ 1039 | Width: 250, 1040 | //Height: 100, 1041 | }) 1042 | 1043 | label_str = binding.NewString() 1044 | label_str.Set("") 1045 | 1046 | label := widget.NewLabelWithData(label_str) 1047 | 1048 | button := widget.NewButton("start", func() { 1049 | if running == false { 1050 | running = true 1051 | go sim() 1052 | } 1053 | }) 1054 | 1055 | name := widget.NewLabel("made by suulnnka") 1056 | 1057 | vbox := container.NewVBox(label,button,name) 1058 | 1059 | w.SetContent(vbox) 1060 | w.ShowAndRun() 1061 | } 1062 | 1063 | var blockNum int32 = -1 1064 | func show_process() { 1065 | atomic.AddInt32(&blockNum, 1) 1066 | coreNumber := runtime.NumCPU() 1067 | coreStr := "running on " + strconv.Itoa(coreNumber) + " core, " 1068 | label_str.Set(coreStr + strconv.Itoa(int(blockNum)) + "/2148") 1069 | } 1070 | 1071 | func sim() { 1072 | 1073 | //file, fileErr := os.Create("output.txt") 1074 | //if fileErr != nil { 1075 | // fmt.Println(fileErr) 1076 | // return 1077 | //} 1078 | //fout = file 1079 | 1080 | def = []int{0,def_g,def_g,def_g,def_g,def_g,def_g,def_s,def_g,def_g,def_g,def_s,def_d,def_g,def_t,def_g,def_s,def_g,def_g,def_s,def_g,def_s,def_s,def_t,def_s,def_w,def_s,def_g,def_d,def_l,def_t} 1081 | max_hp = []int{0,hp_g,hp_g,hp_g,hp_g,hp_g,hp_g,hp_s,hp_g,hp_g,hp_g,hp_s,hp_d,hp_g,hp_t,hp_g,hp_s,hp_g,hp_g,hp_s,hp_g,hp_s,hp_s,hp_t,hp_s,hp_w,hp_s,hp_g,hp_d,hp_l,hp_t} 1082 | 1083 | startTime := time.Now().Unix() 1084 | 1085 | if debug == false { 1086 | coreNumber := runtime.NumCPU() 1087 | print("cpu core number is",coreNumber) 1088 | process = make(chan int32 ,coreNumber) 1089 | wait = make(chan bool) 1090 | 1091 | show_process() 1092 | 1093 | for i := int32(0) ; i < times ; i ++ { 1094 | var min int32 = i * step 1095 | var max int32 = min + step - 1 1096 | var test_min int64 = int64(i) * int64(step) 1097 | var test_max int64 = int64(i) * int64(step) + int64(step) 1098 | if test_min > 2147483647 { 1099 | min = 2147483647 1100 | } 1101 | if test_max > 2147483647 { 1102 | max = 2147483647 1103 | } 1104 | process <- i 1105 | go run_range(min,max) 1106 | } 1107 | 1108 | for j := 1 ; j <= int(times) ; j ++ { 1109 | <-wait 1110 | } 1111 | 1112 | }else{ 1113 | run(44990697) // 被打死 1114 | // run(2124733276) // 吃一个暴击 1115 | 1116 | // run(1079385285) // +2 攻击 1117 | // run(1097943659) // +1 攻击 1118 | // run(1094706438) // +2% 暴率 1119 | // run(1813350023) // +2% 暴率 1120 | // run(1454282831) // +2% 暴率 1121 | // run(1748821225) // +1% 暴率 被打死 1122 | 1123 | } 1124 | 1125 | if log { 1126 | print("统计_阶段_1",统计_阶段_1) 1127 | print("统计_阶段_3",统计_阶段_3) 1128 | print("统计_死亡_13",统计_死亡_13) 1129 | print("统计_阶段_4",统计_阶段_4) 1130 | print("统计_阶段_5_1",统计_阶段_5_1) 1131 | print("统计_阶段_5_2",统计_阶段_5_2) 1132 | print("统计_阶段_5_1_分支",统计_阶段_5_1_分支) 1133 | print("统计_阶段_5_2_分支",统计_阶段_5_2_分支) 1134 | print("统计_死亡_18",统计_死亡_18) 1135 | print("统计_速死_18",统计_速死_18) 1136 | print("统计_速死_19",统计_速死_19) 1137 | print("统计_死亡_20",统计_死亡_20) 1138 | print("统计_死亡_21",统计_死亡_21) 1139 | print("统计_速死_21",统计_速死_21) 1140 | print("统计_死亡_22",统计_死亡_22) 1141 | print("统计_速死_23",统计_速死_23) 1142 | print("统计_死亡_23",统计_死亡_23) 1143 | print("统计_死亡_w",统计_死亡_w) 1144 | print("统计_阶段_w",统计_阶段_w) 1145 | print("统计_流未死",统计_流未死) 1146 | print("统计_盾未死",统计_盾未死) 1147 | print("TODO T1",TODO_T1) 1148 | print("TODO T2",TODO_T2) 1149 | print("TODO T3",TODO_T3) 1150 | print("TODO T4",TODO_T4) 1151 | print("DONE",DONE) 1152 | } 1153 | 1154 | endTime := time.Now().Unix() 1155 | print("共耗时:",endTime - startTime,"秒") 1156 | 1157 | var diff int = int(endTime - startTime) 1158 | 1159 | label_str.Set("done, " + strconv.Itoa( diff ) + " second.") 1160 | 1161 | running = false 1162 | } 1163 | 1164 | func run_range (min,max int32){ 1165 | if min == max { 1166 | <-process 1167 | wait <- true 1168 | return 1169 | } 1170 | 1171 | for t := min ; ; t ++ { 1172 | run(t) 1173 | 1174 | if t == max { 1175 | break 1176 | } 1177 | } 1178 | 1179 | if log { 1180 | //if min % 10000000 == 0 { 1181 | print("complete",min,"->",max) 1182 | //} 1183 | } 1184 | 1185 | show_process() 1186 | 1187 | <-process 1188 | wait <- true 1189 | } 1190 | func run(seed int32){ 1191 | var rand Random 1192 | rand.init(seed) 1193 | 1194 | var hp [31]int 1195 | copy(hp[:],max_hp[:]) 1196 | 1197 | // 阶段 1 1198 | // 1 - 6 狗 狗 狗 狗 狗 狗 1199 | // 三帧索敌的不影响次序 1200 | atomic.AddInt32(&统计_阶段_1, 1) 1201 | for enemy := 1 ; enemy <= 6 ; enemy ++ { 1202 | for hp[enemy] > 0 { 1203 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1204 | } 1205 | } 1206 | 1207 | // 阶段 2 1208 | // 7 - 10 双 狗 狗 狗 1209 | // 三帧索敌的不影响次序 1210 | for i := 0 ; i < len(阶段_2) ; i ++ { 1211 | for j := 0 ; j < 3 ; j ++ { 1212 | enemy := 阶段_2[i][j] 1213 | if hp[enemy] > 0 { 1214 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1215 | break 1216 | } 1217 | } 1218 | } 1219 | 1220 | // 阶段 3 1221 | // 11 - 13 双 狗 盾 1222 | // 三帧索敌的不影响次序 1223 | // 7次攻击以内打死 8狗 且 14次攻击未打死 10 狗 1224 | // 15次攻击打死 10 狗 1225 | // 15次攻击未打死 10 狗 , 不会出现 1226 | atomic.AddInt32(&统计_阶段_3, 1) 1227 | for i := 0 ; i < len(阶段_3) ; i ++ { 1228 | for j := 0 ; j < 3 ; j ++ { 1229 | enemy := 阶段_3[i][j] 1230 | if hp[enemy] > 0 { 1231 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1232 | break 1233 | } 1234 | } 1235 | } 1236 | 1237 | if hp[13] > 0 { 1238 | atomic.AddInt32(&统计_死亡_13, 1) 1239 | return 1240 | } 1241 | 1242 | // 阶段 4 1243 | // 14 - 17 投 狗 双 狗 1244 | atomic.AddInt32(&统计_阶段_4, 1) 1245 | 阶段_4_攻击次数 := 0 1246 | 1247 | for i := 0 ; i < len(阶段_4) ; i ++ { 1248 | select_enemy := -1 1249 | for j := 0 ; j < 3 ; j ++ { 1250 | enemy := 阶段_4[i][j] 1251 | if hp[enemy] > 0 { 1252 | // if enemy == 14 { 1253 | // print(enemy,i,hp[enemy],rand.seed) 1254 | // } 1255 | 阶段_4_攻击次数 = i + 1 1256 | select_enemy = enemy 1257 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1258 | break 1259 | } 1260 | } 1261 | if select_enemy == -1 && 阶段_4_攻击次数 >= 10 { 1262 | // 16及之前怪速死仅影响三帧索敌,对次序无影响 1263 | // >= 10 用于合并情况 1264 | break 1265 | } 1266 | } 1267 | 1268 | // 阶段 5 1269 | // S 18 狗 19 双 20 狗 21 双 1270 | // M 22 双 23 投 24 双 1271 | // L 25 W 26 双 27 狗 28 盾 29 流 30 投 1272 | if 阶段_4_攻击次数 < 15 { 1273 | // 如果四阶段14下及以内解决,状况1 1274 | 1275 | atomic.AddInt32(&统计_阶段_5_1, 1) 1276 | 1277 | // S 18 狗 19 双 20 狗 21 双 1278 | for i := 0 ; i < len(阶段_5_1_S) ; i ++ { 1279 | select_enemy := -1 1280 | for j := 0 ; j < 3 ; j ++ { 1281 | enemy := 阶段_5_1_S[i][j] 1282 | if hp[enemy] > 0 { 1283 | select_enemy = enemy 1284 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1285 | break 1286 | } 1287 | } 1288 | if select_enemy == -1 { 1289 | // 快速死亡判断 1290 | if i == 1 { 1291 | atomic.AddInt32(&统计_速死_18, 1) 1292 | run_dead_18(rand,hp) 1293 | return 1294 | } 1295 | if i == 5 { 1296 | // 根据三帧索敌,有一种情况有可能会出现19速死,其他两种可能性不会出现这种情况 1297 | atomic.AddInt32(&统计_速死_19, 1) 1298 | // 特殊判断三帧索敌中的一种情况 1299 | // run_dead_19(rand,hp) 1300 | atomic.AddInt32(&TODO_T3, 1) 1301 | // 其他两种情况攻击20,可不影响 1302 | hp[20] = hp[20] - rand.attack(def[20],hp[20]) 1303 | } 1304 | if i > 9 { 1305 | run_dead_21(rand,hp) 1306 | return 1307 | } 1308 | 1309 | } 1310 | } 1311 | 1312 | if hp[20] > 0 { 1313 | atomic.AddInt32(&统计_死亡_20, 1) 1314 | return 1315 | } 1316 | 1317 | run_part_5_1(rand,hp) 1318 | }else{ 1319 | // 如果四阶段17下解决,状况2 1320 | 1321 | atomic.AddInt32(&统计_阶段_5_2, 1) 1322 | 1323 | if hp[19] != max_hp[19] { 1324 | // 如果第16次攻击打死 18 狗 1325 | // 根据三帧索敌,会空闲3帧,原三帧索敌的三种情况变四种 1326 | // 只有最早寻敌的一帧可能会变晚 1327 | 1328 | // 直接跟5_1_18速死轴合并 1329 | atomic.AddInt32(&统计_速死_18, 1) 1330 | //run_dead_18(rand,hp) 1331 | atomic.AddInt32(&TODO_T3, 1) 1332 | //return 1333 | } 1334 | 1335 | for i := 0 ; i < len(阶段_5_2_S) ; i ++ { 1336 | select_enemy := -1 1337 | for j := 0 ; j < len(阶段_5_2_S[i]) ; j ++ { 1338 | enemy := 阶段_5_2_S[i][j] 1339 | if hp[enemy] > 0 { 1340 | select_enemy = enemy 1341 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1342 | break 1343 | } 1344 | } 1345 | if select_enemy == -1 { 1346 | run_dead_21(rand,hp) 1347 | return 1348 | } 1349 | } 1350 | if hp[18] > 0 { 1351 | atomic.AddInt32(&统计_死亡_18, 1) 1352 | return 1353 | } 1354 | if hp[20] > 0 { 1355 | atomic.AddInt32(&统计_死亡_20, 1) 1356 | return 1357 | } 1358 | 1359 | run_part_5_2(rand,hp) 1360 | } 1361 | } 1362 | func run_dead_18(rand Random, hp [31]int){ 1363 | // 进入条件 1364 | // 18速死 1365 | // 可能跟5-2可混轴 1366 | 1367 | if hp[19] == max_hp[19] { 1368 | // 来自5-1 1369 | hp[19] = hp[19] - rand.attack(def[19],hp[19]) 1370 | } 1371 | 1372 | for i := 0 ; i < len(阶段_5_2_S) ; i ++ { 1373 | select_enemy := -1 1374 | for j := 0 ; j < len(阶段_5_2_S[i]) ; j ++ { 1375 | enemy := 阶段_5_2_S[i][j] 1376 | if hp[enemy] > 0 { 1377 | select_enemy = enemy 1378 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1379 | break 1380 | } 1381 | } 1382 | if select_enemy == -1 { 1383 | run_dead_21(rand,hp) 1384 | return 1385 | } 1386 | } 1387 | if hp[18] > 0 { 1388 | atomic.AddInt32(&统计_死亡_18, 1) 1389 | return 1390 | } 1391 | if hp[20] > 0 { 1392 | atomic.AddInt32(&统计_死亡_20, 1) 1393 | return 1394 | } 1395 | 1396 | run_part_5_2(rand,hp) 1397 | } 1398 | func run_dead_19(rand Random, hp [31]int){ 1399 | // 进入条件 1400 | // 19速死 1401 | 1402 | // 只有三帧索敌的这一种情况 1403 | // 可能跟5-1可混轴 1404 | 1405 | atomic.AddInt32(&TODO_T3, 1) 1406 | } 1407 | func run_dead_21(rand Random, hp [31]int){ 1408 | // 进入条件 1409 | // 21速死 1410 | 1411 | if hp[20] > 0 { 1412 | atomic.AddInt32(&统计_死亡_20, 1) 1413 | return 1414 | } 1415 | 1416 | atomic.AddInt32(&统计_速死_21, 1) 1417 | 1418 | run_dead_21_w_不变(rand,hp) 1419 | run_dead_21_双持_不变(rand,hp) 1420 | run_dead_21_燃烧_不变(rand,hp) 1421 | run_dead_21_w_变(rand,hp) 1422 | run_dead_21_双持_变(rand,hp) 1423 | run_dead_21_燃烧_变(rand,hp) 1424 | } 1425 | 1426 | // 44990697 1427 | func run_dead_21_w_不变(rand Random, hp [31]int){ 1428 | for i := 0 ; i < 6 ; i ++ { 1429 | for j := 0 ; j < len(阶段_5_21速死_w_不变[i]) ; j ++ { 1430 | enemy := 阶段_5_21速死_w_不变[i][j] 1431 | if hp[enemy] > 0 { 1432 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1433 | break 1434 | } 1435 | } 1436 | } 1437 | 1438 | if hp[22] > 0 { 1439 | atomic.AddInt32(&统计_死亡_22, 1) 1440 | return 1441 | } 1442 | if hp[23] > 1000 { 1443 | atomic.AddInt32(&统计_死亡_23, 1) 1444 | return 1445 | } 1446 | 1447 | atomic.AddInt32(&统计_阶段_w, 1) 1448 | 1449 | hp[23] = hp[23] - 1000 1450 | hp[24] = hp[24] - 1000 1451 | hp[25] = hp[25] - 500 1452 | 1453 | for i := 6 ; i < len(阶段_5_21速死_w_不变) ; i ++ { 1454 | for j := 0 ; j < len(阶段_5_21速死_w_不变[i]) ; j ++ { 1455 | enemy := 阶段_5_21速死_w_不变[i][j] 1456 | if hp[enemy] > 0 { 1457 | damage := rand.attack(def[enemy],hp[enemy]) 1458 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 1459 | hp[enemy] = hp[enemy] - damage 1460 | break 1461 | } 1462 | } 1463 | } 1464 | 1465 | stat(&rand,&hp) 1466 | 1467 | for i := 24 ; i <= 30 ; i ++ { 1468 | if hp[i] > 0 { 1469 | return 1470 | } 1471 | } 1472 | 1473 | atomic.AddInt32(&DONE, 1) 1474 | print("done",runFuncName(),rand.seed) 1475 | } 1476 | 1477 | func run_part_5_1(rand Random, hp [31]int){ 1478 | atomic.AddInt32(&统计_阶段_5_1_分支, 1) 1479 | 1480 | run_part_5_1_双持_不变(rand,hp) 1481 | run_part_5_1_燃烧_不变(rand,hp) 1482 | run_part_5_1_w_不变(rand,hp) 1483 | 1484 | run_part_5_1_双持_变(rand,hp) 1485 | run_part_5_1_燃烧_变(rand,hp) 1486 | run_part_5_1_w_变(rand,hp) 1487 | } 1488 | 1489 | func run_part_5_1_双持_不变(rand Random, hp [31]int){ 1490 | // M 22 双 23 投 24 双 1491 | 1492 | for i := 0 ; i < 4 ; i ++ { 1493 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1494 | enemy := 阶段_5_1_双持_不变[i][j] 1495 | if hp[enemy] > 0 { 1496 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1497 | break 1498 | } 1499 | } 1500 | } 1501 | 1502 | hp[21] = hp[21] - 1000 1503 | hp[22] = hp[22] - 1000 1504 | hp[23] = hp[23] - 1000 1505 | hp[24] = hp[24] - 1000 1506 | 1507 | for i := 4 ; i < 5 ; i ++ { 1508 | select_enemy := -1 1509 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1510 | enemy := 阶段_5_1_双持_不变[i][j] 1511 | if hp[enemy] > 0 { 1512 | select_enemy = enemy 1513 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1514 | break 1515 | } 1516 | } 1517 | if select_enemy == -1 { 1518 | // 没有这种情况 1519 | atomic.AddInt32(&TODO_T4, 1) 1520 | } 1521 | } 1522 | 1523 | if hp[23] > 0 { 1524 | atomic.AddInt32(&统计_死亡_23, 1) 1525 | return 1526 | } 1527 | 1528 | atomic.AddInt32(&统计_阶段_w, 1) 1529 | 1530 | for i := 5 ; i < len(阶段_5_1_双持_不变) ; i ++ { 1531 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1532 | enemy := 阶段_5_1_双持_不变[i][j] 1533 | if hp[enemy] > 0 { 1534 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1535 | break 1536 | } 1537 | } 1538 | } 1539 | 1540 | stat(&rand,&hp) 1541 | 1542 | for i := 21 ; i <= 30 ; i ++ { 1543 | if hp[i] > 0 { 1544 | return 1545 | } 1546 | } 1547 | 1548 | atomic.AddInt32(&DONE, 1) 1549 | print("done",runFuncName(),rand.seed) 1550 | } 1551 | func run_part_5_1_燃烧_不变(rand Random, hp [31]int){ 1552 | // M 22 双 23 投 24 双 1553 | 1554 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[0]) ; j ++ { 1555 | enemy := 阶段_5_1_燃烧_不变[0][j] 1556 | if hp[enemy] > 0 { 1557 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1558 | break 1559 | } 1560 | } 1561 | 1562 | hp[21] = hp[21] - 1000 1563 | hp[22] = hp[22] - 1000 1564 | hp[23] = hp[23] - 1000 1565 | 1566 | for i := 1 ; i < 5 ; i ++ { 1567 | select_enemy := -1 1568 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[i]) ; j ++ { 1569 | enemy := 阶段_5_1_燃烧_不变[i][j] 1570 | if hp[enemy] > 0 { 1571 | select_enemy = enemy 1572 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1573 | break 1574 | } 1575 | } 1576 | if select_enemy == -1 { 1577 | // 没有这种情况 1578 | atomic.AddInt32(&TODO_T4, 1) 1579 | } 1580 | } 1581 | 1582 | if hp[23] > 0 { 1583 | atomic.AddInt32(&统计_死亡_23, 1) 1584 | return 1585 | } 1586 | 1587 | atomic.AddInt32(&统计_阶段_w, 1) 1588 | 1589 | for i := 5 ; i < len(阶段_5_1_燃烧_不变) ; i ++ { 1590 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[i]) ; j ++ { 1591 | enemy := 阶段_5_1_燃烧_不变[i][j] 1592 | if hp[enemy] > 0 { 1593 | damage := rand.attack(def[enemy],hp[enemy]) 1594 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 1595 | hp[enemy] = hp[enemy] - damage 1596 | break 1597 | } 1598 | } 1599 | } 1600 | 1601 | stat(&rand,&hp) 1602 | 1603 | for i := 21 ; i <= 30 ; i ++ { 1604 | if hp[i] > 0 { 1605 | return 1606 | } 1607 | } 1608 | 1609 | atomic.AddInt32(&DONE, 1) 1610 | print("done",runFuncName(),rand.seed) 1611 | } 1612 | 1613 | func run_part_5_1_w_不变(rand Random, hp [31]int){ 1614 | // M 22 双 23 投 24 双 1615 | for i := 0 ; i < len(阶段_5_1_M) ; i ++ { 1616 | for j := 0 ; j < 4 ; j ++ { 1617 | enemy := 阶段_5_1_M[i][j] 1618 | if hp[enemy] > 0 { 1619 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1620 | break 1621 | } 1622 | } 1623 | } 1624 | if hp[21] > 0 { 1625 | atomic.AddInt32(&统计_死亡_21, 1) 1626 | return 1627 | } 1628 | if hp[22] > 0 { 1629 | atomic.AddInt32(&统计_死亡_22, 1) 1630 | return 1631 | } 1632 | if hp[23] > 1000 { 1633 | atomic.AddInt32(&统计_死亡_23, 1) 1634 | return 1635 | } 1636 | 1637 | hp[23] = hp[23] - 1000 1638 | hp[24] = hp[24] - 1000 1639 | hp[25] = hp[25] - 500 1640 | 1641 | atomic.AddInt32(&统计_阶段_w, 1) 1642 | 1643 | for i := 0 ; i < len(阶段_5_1_w_不变) ; i ++ { 1644 | for j := 0 ; j < len(阶段_5_1_w_不变[i]) ; j ++ { 1645 | enemy := 阶段_5_1_w_不变[i][j] 1646 | if hp[enemy] > 0 { 1647 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1648 | break 1649 | } 1650 | } 1651 | } 1652 | 1653 | stat(&rand,&hp) 1654 | 1655 | for i := 24 ; i <= 30 ; i ++ { 1656 | if hp[i] > 0 { 1657 | return 1658 | } 1659 | } 1660 | 1661 | atomic.AddInt32(&DONE, 1) 1662 | print("done",runFuncName(),rand.seed) 1663 | } 1664 | 1665 | func run_part_5_1_双持_变(rand Random, hp [31]int){ 1666 | // 0 - 3 1667 | for i := 0 ; i <= 3 ; i ++ { 1668 | for j := 0 ; j < 3 ; j ++ { 1669 | enemy := 阶段_5_1_双持_不变[i][j] 1670 | if hp[enemy] > 0 { 1671 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1672 | break 1673 | } 1674 | } 1675 | } 1676 | 1677 | if hp[22] > 0 { 1678 | atomic.AddInt32(&统计_死亡_22, 1) 1679 | return 1680 | } 1681 | if hp[23] > 1000 { 1682 | atomic.AddInt32(&统计_死亡_23, 1) 1683 | return 1684 | } 1685 | 1686 | hp[23] = hp[23] - 1000 1687 | hp[24] = hp[24] - 1000 1688 | 1689 | atomic.AddInt32(&统计_阶段_w, 1) 1690 | 1691 | for i := 0 ; i < len(阶段_5_1_双持_变) ; i ++ { 1692 | for j := 0 ; j < len(阶段_5_1_双持_变[i]) ; j ++ { 1693 | enemy := 阶段_5_1_双持_变[i][j] 1694 | if hp[enemy] > 0 { 1695 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1696 | break 1697 | } 1698 | } 1699 | } 1700 | 1701 | stat(&rand,&hp) 1702 | 1703 | for i := 24 ; i <= 30 ; i ++ { 1704 | if hp[i] > 0 { 1705 | return 1706 | } 1707 | } 1708 | 1709 | atomic.AddInt32(&DONE, 1) 1710 | print("done",runFuncName(),rand.seed) 1711 | 1712 | } 1713 | func run_part_5_1_燃烧_变(rand Random, hp [31]int){ 1714 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1715 | if hp[22] < 1000 { 1716 | run_part_5_1_燃烧_变_22(rand,hp,2) 1717 | } 1718 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1719 | if hp[22] <= 0 { 1720 | return 1721 | } 1722 | if hp[22] < 1000 { 1723 | run_part_5_1_燃烧_变_22(rand,hp,1) 1724 | } 1725 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1726 | if hp[22] <= 0 { 1727 | return 1728 | } 1729 | if hp[22] < 1000 { 1730 | run_part_5_1_燃烧_变_22(rand,hp,0) 1731 | } 1732 | } 1733 | 1734 | func run_part_5_1_燃烧_变_22(rand Random, hp [31]int, times int){ 1735 | hp[22] = hp[22] - 1000 1736 | hp[23] = hp[23] - 1000 1737 | for i := 1 ; i <= times ; i ++ { 1738 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 1739 | } 1740 | if hp[23] > 0 { 1741 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 1742 | }else{ 1743 | hp[24] = hp[24] - rand.attack(def[24],hp[24]) 1744 | } 1745 | if hp[23] > 0{ 1746 | atomic.AddInt32(&统计_死亡_23, 1) 1747 | return 1748 | } 1749 | 1750 | atomic.AddInt32(&统计_阶段_w, 1) 1751 | 1752 | for i := 0 ; i < len(阶段_5_1_燃烧_变) ; i ++ { 1753 | for j := 0 ; j < len(阶段_5_1_燃烧_变[i]) ; j ++ { 1754 | enemy := 阶段_5_1_燃烧_变[i][j] 1755 | if hp[enemy] > 0 { 1756 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1757 | break 1758 | } 1759 | } 1760 | } 1761 | 1762 | stat(&rand,&hp) 1763 | 1764 | for i := 24 ; i <= 30 ; i ++ { 1765 | if hp[i] > 0 { 1766 | return 1767 | } 1768 | } 1769 | 1770 | atomic.AddInt32(&DONE, 1) 1771 | print("done",runFuncName(),rand.seed) 1772 | } 1773 | 1774 | func run_part_5_1_w_变(rand Random, hp [31]int){ 1775 | // M 22 双 23 投 24 双 1776 | for i := 0 ; i < len(阶段_5_1_M) ; i ++ { 1777 | for j := 0 ; j < 4 ; j ++ { 1778 | enemy := 阶段_5_1_M[i][j] 1779 | if hp[enemy] > 0 { 1780 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1781 | break 1782 | } 1783 | } 1784 | } 1785 | if hp[21] > 0 { 1786 | atomic.AddInt32(&统计_死亡_21, 1) 1787 | return 1788 | } 1789 | if hp[22] > 0 { 1790 | atomic.AddInt32(&统计_死亡_22, 1) 1791 | return 1792 | } 1793 | if hp[23] > 1000 { 1794 | atomic.AddInt32(&统计_死亡_23, 1) 1795 | return 1796 | } 1797 | 1798 | hp[23] = hp[23] - 1000 1799 | hp[24] = hp[24] - 1000 1800 | hp[25] = hp[25] - 500 1801 | 1802 | atomic.AddInt32(&统计_阶段_w, 1) 1803 | 1804 | for i := 0 ; i < len(阶段_5_1_w_变) ; i ++ { 1805 | for j := 0 ; j < len(阶段_5_1_w_变[i]) ; j ++ { 1806 | enemy := 阶段_5_1_w_变[i][j] 1807 | if hp[enemy] > 0 { 1808 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1809 | break 1810 | } 1811 | } 1812 | } 1813 | 1814 | stat(&rand,&hp) 1815 | 1816 | for i := 24 ; i <= 30 ; i ++ { 1817 | if hp[i] > 0 { 1818 | return 1819 | } 1820 | } 1821 | 1822 | atomic.AddInt32(&DONE, 1) 1823 | print("done",runFuncName(),rand.seed) 1824 | } 1825 | 1826 | func run_part_5_2(rand Random, hp [31]int){ 1827 | atomic.AddInt32(&统计_阶段_5_2_分支, 1) 1828 | run_part_5_2_双持_不变(rand,hp) 1829 | run_part_5_2_燃烧_不变(rand,hp) 1830 | run_part_5_2_w_不变(rand,hp) 1831 | 1832 | run_part_5_2_双持_变(rand,hp) 1833 | run_part_5_2_燃烧_变(rand,hp) 1834 | run_part_5_2_w_变(rand,hp) 1835 | } 1836 | 1837 | func run_part_5_2_w_不变(rand Random, hp [31]int){ 1838 | // M 22 双 23 投 24 双 1839 | for i := 0 ; i < len(阶段_5_2_M) ; i ++ { 1840 | for j := 0 ; j < len(阶段_5_2_M[i]) ; j ++ { 1841 | enemy := 阶段_5_2_M[i][j] 1842 | if hp[enemy] > 0 { 1843 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1844 | break 1845 | } 1846 | } 1847 | } 1848 | if hp[21] > 0 { 1849 | atomic.AddInt32(&统计_死亡_21, 1) 1850 | return 1851 | } 1852 | if hp[22] > 0 { 1853 | atomic.AddInt32(&统计_死亡_22, 1) 1854 | return 1855 | } 1856 | if hp[23] > 1000 { 1857 | atomic.AddInt32(&统计_死亡_23, 1) 1858 | return 1859 | } 1860 | 1861 | hp[23] = hp[23] - 1000 1862 | hp[24] = hp[24] - 1000 1863 | hp[25] = hp[25] - 500 1864 | 1865 | atomic.AddInt32(&统计_阶段_w, 1) 1866 | 1867 | for i := 0 ; i < len(阶段_5_2_w_不变) ; i ++ { 1868 | for j := 0 ; j < len(阶段_5_2_w_不变[i]) ; j ++ { 1869 | enemy := 阶段_5_2_w_不变[i][j] 1870 | if hp[enemy] > 0 { 1871 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1872 | break 1873 | } 1874 | } 1875 | } 1876 | 1877 | stat(&rand,&hp) 1878 | 1879 | for i := 24 ; i <= 30 ; i ++ { 1880 | if hp[i] > 0 { 1881 | return 1882 | } 1883 | } 1884 | 1885 | atomic.AddInt32(&DONE, 1) 1886 | print("done",runFuncName(),rand.seed) 1887 | } 1888 | 1889 | func run_part_5_2_双持_不变(rand Random, hp [31]int){ 1890 | // M 22 双 23 投 24 双 1891 | 1892 | for i := 0 ; i < 3 ; i ++ { 1893 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1894 | enemy := 阶段_5_2_双持_不变[i][j] 1895 | if hp[enemy] > 0 { 1896 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1897 | break 1898 | } 1899 | } 1900 | } 1901 | 1902 | hp[21] = hp[21] - 1000 1903 | hp[22] = hp[22] - 1000 1904 | hp[23] = hp[23] - 1000 1905 | hp[24] = hp[24] - 1000 1906 | 1907 | for i := 3 ; i < 5 ; i ++ { 1908 | select_enemy := -1 1909 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1910 | enemy := 阶段_5_2_双持_不变[i][j] 1911 | if hp[enemy] > 0 { 1912 | select_enemy = enemy 1913 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1914 | break 1915 | } 1916 | } 1917 | if select_enemy == -1 { 1918 | // 没有这种情况 1919 | atomic.AddInt32(&TODO_T4, 1) 1920 | } 1921 | } 1922 | 1923 | if hp[23] > 0 { 1924 | atomic.AddInt32(&统计_死亡_23, 1) 1925 | return 1926 | } 1927 | 1928 | atomic.AddInt32(&统计_阶段_w, 1) 1929 | 1930 | for i := 5 ; i < len(阶段_5_2_双持_不变) ; i ++ { 1931 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1932 | enemy := 阶段_5_2_双持_不变[i][j] 1933 | if hp[enemy] > 0 { 1934 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1935 | break 1936 | } 1937 | } 1938 | } 1939 | 1940 | stat(&rand,&hp) 1941 | 1942 | for i := 21 ; i <= 30 ; i ++ { 1943 | if hp[i] > 0 { 1944 | return 1945 | } 1946 | } 1947 | 1948 | atomic.AddInt32(&DONE, 1) 1949 | print("done",runFuncName(),rand.seed) 1950 | } 1951 | func run_part_5_2_燃烧_不变(rand Random, hp [31]int){ 1952 | // M 22 双 23 投 24 双 1953 | 1954 | hp[21] = hp[21] - 1000 1955 | hp[22] = hp[22] - 1000 1956 | hp[23] = hp[23] - 1000 1957 | 1958 | for i := 0 ; i < 5 ; i ++ { 1959 | select_enemy := -1 1960 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 1961 | enemy := 阶段_5_2_燃烧_不变[i][j] 1962 | if hp[enemy] > 0 { 1963 | select_enemy = enemy 1964 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1965 | break 1966 | } 1967 | } 1968 | if select_enemy == -1 { 1969 | // 没有这种情况 1970 | atomic.AddInt32(&TODO_T4, 1) 1971 | } 1972 | } 1973 | 1974 | if hp[23] > 0 { 1975 | atomic.AddInt32(&统计_死亡_23, 1) 1976 | return 1977 | } 1978 | 1979 | atomic.AddInt32(&统计_阶段_w, 1) 1980 | 1981 | for i := 5 ; i < len(阶段_5_2_燃烧_不变) ; i ++ { 1982 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 1983 | enemy := 阶段_5_2_燃烧_不变[i][j] 1984 | if hp[enemy] > 0 { 1985 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1986 | break 1987 | } 1988 | } 1989 | } 1990 | 1991 | stat(&rand,&hp) 1992 | 1993 | for i := 21 ; i <= 30 ; i ++ { 1994 | if hp[i] > 0 { 1995 | return 1996 | } 1997 | } 1998 | 1999 | atomic.AddInt32(&DONE, 1) 2000 | print("done",runFuncName(),rand.seed) 2001 | } 2002 | 2003 | func run_part_5_2_双持_变(rand Random, hp [31]int){ 2004 | // 查无此轴 2005 | return 2006 | } 2007 | func run_part_5_2_燃烧_变(rand Random, hp [31]int){ 2008 | for i := 0 ; i <= 2 ; i ++ { 2009 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 2010 | enemy := 阶段_5_2_燃烧_不变[i][j] 2011 | if hp[enemy] > 0 { 2012 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2013 | break 2014 | } 2015 | } 2016 | if hp[22] <= 0 { 2017 | return 2018 | } 2019 | if hp[22] <= 1000 { 2020 | run_part_5_2_燃烧_变_22(rand,hp,2 - i) 2021 | } 2022 | } 2023 | } 2024 | 2025 | func run_part_5_2_燃烧_变_22(rand Random, hp [31]int, times int){ 2026 | 2027 | hp[21] = hp[21] - 1000 2028 | hp[22] = hp[22] - 1000 2029 | hp[23] = hp[23] - 1000 2030 | 2031 | for i := 0 ; i < times ; i ++ { 2032 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 2033 | } 2034 | if hp[23] > 0 { 2035 | atomic.AddInt32(&统计_死亡_23, 1) 2036 | return 2037 | } 2038 | 2039 | atomic.AddInt32(&统计_阶段_w, 1) 2040 | 2041 | for i := 0 ; i < len(阶段_5_2_燃烧_变) ; i ++ { 2042 | for j := 0 ; j < len(阶段_5_2_燃烧_变[i]) ; j ++ { 2043 | enemy := 阶段_5_2_燃烧_变[i][j] 2044 | if hp[enemy] > 0 { 2045 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2046 | break 2047 | } 2048 | } 2049 | } 2050 | 2051 | stat(&rand,&hp) 2052 | 2053 | for i := 21 ; i <= 30 ; i ++ { 2054 | if hp[i] > 0 { 2055 | return 2056 | } 2057 | } 2058 | 2059 | atomic.AddInt32(&DONE, 1) 2060 | print("done",runFuncName(),rand.seed) 2061 | } 2062 | 2063 | func run_part_5_2_w_变(rand Random, hp [31]int){ 2064 | // M 22 双 23 投 24 双 2065 | for i := 0 ; i < len(阶段_5_2_M) ; i ++ { 2066 | for j := 0 ; j < len(阶段_5_2_M[i]) ; j ++ { 2067 | enemy := 阶段_5_2_M[i][j] 2068 | if hp[enemy] > 0 { 2069 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2070 | break 2071 | } 2072 | } 2073 | } 2074 | if hp[21] > 0 { 2075 | atomic.AddInt32(&统计_死亡_21, 1) 2076 | return 2077 | } 2078 | if hp[22] > 0 { 2079 | atomic.AddInt32(&统计_死亡_22, 1) 2080 | return 2081 | } 2082 | if hp[23] > 1000 { 2083 | atomic.AddInt32(&统计_死亡_23, 1) 2084 | return 2085 | } 2086 | 2087 | hp[23] = hp[23] - 1000 2088 | hp[24] = hp[24] - 1000 2089 | hp[25] = hp[25] - 500 2090 | 2091 | atomic.AddInt32(&统计_阶段_w, 1) 2092 | 2093 | for i := 0 ; i < len(阶段_5_2_w_变) ; i ++ { 2094 | for j := 0 ; j < len(阶段_5_2_w_变[i]) ; j ++ { 2095 | enemy := 阶段_5_2_w_变[i][j] 2096 | if hp[enemy] > 0 { 2097 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2098 | break 2099 | } 2100 | } 2101 | } 2102 | 2103 | stat(&rand,&hp) 2104 | 2105 | for i := 21 ; i <= 30 ; i ++ { 2106 | if hp[i] > 0 { 2107 | return 2108 | } 2109 | } 2110 | 2111 | atomic.AddInt32(&DONE, 1) 2112 | print("done",runFuncName(),rand.seed) 2113 | } 2114 | 2115 | func run_dead_21_双持_不变(rand Random, hp [31]int){ 2116 | // M 22 双 23 投 24 双 2117 | for i := 0 ; i < 4 ; i ++ { 2118 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2119 | enemy := 阶段_5_21速死_双持_不变[i][j] 2120 | if hp[enemy] > 0 { 2121 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2122 | break 2123 | } 2124 | } 2125 | } 2126 | 2127 | hp[22] = hp[22] - 1000 2128 | hp[23] = hp[23] - 1000 2129 | hp[24] = hp[24] - 1000 2130 | 2131 | for i := 4 ; i < 6 ; i ++ { 2132 | select_enemy := -1 2133 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2134 | enemy := 阶段_5_21速死_双持_不变[i][j] 2135 | if hp[enemy] > 0 { 2136 | select_enemy = enemy 2137 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2138 | break 2139 | } 2140 | } 2141 | if select_enemy == -1 { 2142 | // 没有这种情况 2143 | atomic.AddInt32(&TODO_T4, 1) 2144 | } 2145 | } 2146 | 2147 | if hp[23] > 0 { 2148 | atomic.AddInt32(&统计_死亡_23, 1) 2149 | return 2150 | } 2151 | 2152 | atomic.AddInt32(&统计_阶段_w, 1) 2153 | 2154 | for i := 6 ; i < len(阶段_5_21速死_双持_不变) ; i ++ { 2155 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2156 | enemy := 阶段_5_21速死_双持_不变[i][j] 2157 | if hp[enemy] > 0 { 2158 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2159 | break 2160 | } 2161 | } 2162 | } 2163 | 2164 | stat(&rand,&hp) 2165 | 2166 | for i := 21 ; i <= 30 ; i ++ { 2167 | if hp[i] > 0 { 2168 | return 2169 | } 2170 | } 2171 | 2172 | atomic.AddInt32(&DONE, 1) 2173 | print("done",runFuncName(),rand.seed) 2174 | } 2175 | func run_dead_21_燃烧_不变(rand Random, hp [31]int){ 2176 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2177 | 2178 | // M 22 双 23 投 24 双 2179 | 2180 | hp[22] = hp[22] - 1000 2181 | hp[23] = hp[23] - 1000 2182 | 2183 | for i := 1 ; i < 6 ; i ++ { 2184 | select_enemy := -1 2185 | for j := 0 ; j < len(阶段_5_21速死_燃烧_不变[i]) ; j ++ { 2186 | enemy := 阶段_5_21速死_燃烧_不变[i][j] 2187 | if hp[enemy] > 0 { 2188 | select_enemy = enemy 2189 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2190 | break 2191 | } 2192 | } 2193 | if select_enemy == -1 { 2194 | // 22 23 早死 2195 | run_dead_23(rand,hp) 2196 | return 2197 | } 2198 | } 2199 | 2200 | if hp[23] > 0 { 2201 | atomic.AddInt32(&统计_死亡_23, 1) 2202 | return 2203 | } 2204 | 2205 | atomic.AddInt32(&统计_阶段_w, 1) 2206 | 2207 | for i := 6 ; i < len(阶段_5_21速死_燃烧_不变) ; i ++ { 2208 | for j := 0 ; j < len(阶段_5_21速死_燃烧_不变[i]) ; j ++ { 2209 | enemy := 阶段_5_21速死_燃烧_不变[i][j] 2210 | if hp[enemy] > 0 { 2211 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2212 | break 2213 | } 2214 | } 2215 | } 2216 | 2217 | stat(&rand,&hp) 2218 | 2219 | for i := 21 ; i <= 30 ; i ++ { 2220 | if hp[i] > 0 { 2221 | return 2222 | } 2223 | } 2224 | 2225 | atomic.AddInt32(&DONE, 1) 2226 | print("done",runFuncName(),rand.seed) 2227 | } 2228 | 2229 | func run_dead_21_双持_变(rand Random, hp [31]int){ 2230 | 2231 | for i := 0 ; i < 4 ; i ++ { 2232 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2233 | enemy := 阶段_5_21速死_双持_不变[i][j] 2234 | if hp[enemy] > 0 { 2235 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2236 | break 2237 | } 2238 | } 2239 | } 2240 | 2241 | if hp[23] <= 1000 { 2242 | run_dead_21_双持_变_22(rand,hp,1) 2243 | } 2244 | 2245 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[4]) ; j ++ { 2246 | enemy := 阶段_5_21速死_双持_不变[4][j] 2247 | if hp[enemy] > 0 { 2248 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2249 | break 2250 | } 2251 | } 2252 | 2253 | if hp[23] <= 1000 { 2254 | run_dead_21_双持_变_22(rand,hp,0) 2255 | } 2256 | 2257 | } 2258 | 2259 | func run_dead_21_双持_变_22(rand Random, hp [31]int,times int){ 2260 | hp[21] = hp[21] - 1000 2261 | hp[22] = hp[22] - 1000 2262 | hp[23] = hp[23] - 1000 2263 | hp[24] = hp[24] - 1000 2264 | 2265 | atomic.AddInt32(&统计_阶段_w, 1) 2266 | 2267 | for i := 1 - times ; i < len(阶段_5_21速死_双持_变) ; i ++ { 2268 | for j := 0 ; j < len(阶段_5_21速死_双持_变[i]) ; j ++ { 2269 | enemy := 阶段_5_21速死_双持_变[i][j] 2270 | if hp[enemy] > 0 { 2271 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2272 | break 2273 | } 2274 | } 2275 | } 2276 | 2277 | stat(&rand,&hp) 2278 | 2279 | for i := 21 ; i <= 30 ; i ++ { 2280 | if hp[i] > 0 { 2281 | return 2282 | } 2283 | } 2284 | 2285 | atomic.AddInt32(&DONE, 1) 2286 | print("done",runFuncName(),rand.seed) 2287 | } 2288 | 2289 | func run_dead_21_燃烧_变(rand Random, hp [31]int){ 2290 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2291 | if hp[22] < 1000 { 2292 | run_dead_21_燃烧_变_22(rand,hp,2) 2293 | } 2294 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2295 | if hp[22] <= 0 { 2296 | return 2297 | } 2298 | if hp[22] < 1000 { 2299 | run_dead_21_燃烧_变_22(rand,hp,1) 2300 | } 2301 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2302 | if hp[22] <= 0 { 2303 | return 2304 | } 2305 | if hp[22] < 1000 { 2306 | run_dead_21_燃烧_变_22(rand,hp,0) 2307 | } 2308 | } 2309 | func run_dead_21_燃烧_变_22(rand Random, hp [31]int, times int){ 2310 | hp[21] = hp[21] - 1000 2311 | hp[22] = hp[22] - 1000 2312 | hp[23] = hp[23] - 1000 2313 | 2314 | atomic.AddInt32(&统计_阶段_w, 1) 2315 | 2316 | for i := 2 - times ; i < len(阶段_5_21速死_燃烧_变) ; i ++ { 2317 | for j := 0 ; j < len(阶段_5_21速死_燃烧_变[i]) ; j ++ { 2318 | enemy := 阶段_5_21速死_燃烧_变[i][j] 2319 | if hp[enemy] > 0 { 2320 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2321 | break 2322 | } 2323 | } 2324 | } 2325 | 2326 | stat(&rand,&hp) 2327 | 2328 | for i := 21 ; i <= 30 ; i ++ { 2329 | if hp[i] > 0 { 2330 | return 2331 | } 2332 | } 2333 | 2334 | atomic.AddInt32(&DONE, 1) 2335 | print("done",runFuncName(),rand.seed) 2336 | } 2337 | 2338 | func run_dead_21_w_变(rand Random, hp [31]int){ 2339 | for i := 0 ; i < 6 ; i ++ { 2340 | for j := 0 ; j < len(阶段_5_21速死_w_变[i]) ; j ++ { 2341 | enemy := 阶段_5_21速死_w_变[i][j] 2342 | if hp[enemy] > 0 { 2343 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2344 | break 2345 | } 2346 | } 2347 | } 2348 | 2349 | if hp[22] > 0 { 2350 | atomic.AddInt32(&统计_死亡_22, 1) 2351 | return 2352 | } 2353 | if hp[23] > 1000 { 2354 | atomic.AddInt32(&统计_死亡_23, 1) 2355 | return 2356 | } 2357 | 2358 | hp[23] = hp[23] - 1000 2359 | hp[24] = hp[24] - 1000 2360 | hp[25] = hp[25] - 500 2361 | 2362 | atomic.AddInt32(&统计_阶段_w, 1) 2363 | 2364 | for i := 6 ; i < len(阶段_5_21速死_w_变) ; i ++ { 2365 | for j := 0 ; j < len(阶段_5_21速死_w_变[i]) ; j ++ { 2366 | enemy := 阶段_5_21速死_w_变[i][j] 2367 | if hp[enemy] > 0 { 2368 | damage := rand.attack(def[enemy],hp[enemy]) 2369 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 2370 | hp[enemy] = hp[enemy] - damage 2371 | break 2372 | } 2373 | } 2374 | } 2375 | 2376 | stat(&rand,&hp) 2377 | 2378 | for i := 24 ; i <= 30 ; i ++ { 2379 | if hp[i] > 0 { 2380 | return 2381 | } 2382 | } 2383 | 2384 | atomic.AddInt32(&DONE, 1) 2385 | print("done",runFuncName(),rand.seed) 2386 | } 2387 | 2388 | func run_dead_23(rand Random, hp [31]int){ 2389 | 2390 | atomic.AddInt32(&统计_速死_23, 1) 2391 | atomic.AddInt32(&统计_阶段_w, 1) 2392 | 2393 | for i := 0 ; i < len(阶段_5_23速死) ; i ++ { 2394 | for j := 0 ; j < len(阶段_5_23速死[i]) ; j ++ { 2395 | enemy := 阶段_5_23速死[i][j] 2396 | if hp[enemy] > 0 { 2397 | damage := rand.attack(def[enemy],hp[enemy]) 2398 | hp[enemy] = hp[enemy] - damage 2399 | break 2400 | } 2401 | } 2402 | } 2403 | 2404 | stat(&rand,&hp) 2405 | 2406 | for i := 24 ; i <= 30 ; i ++ { 2407 | if hp[i] > 0 { 2408 | return 2409 | } 2410 | } 2411 | 2412 | atomic.AddInt32(&DONE, 1) 2413 | print("done",runFuncName(),rand.seed) 2414 | } 2415 | 2416 | func stat(rand *Random,hp *[31]int){ 2417 | //return 2418 | if hp[25] > 0 { 2419 | return 2420 | } 2421 | 2422 | for i := 1 ; i <= 27 ; i ++ { 2423 | if hp[i] > 0 { 2424 | return 2425 | } 2426 | } 2427 | 2428 | atomic.AddInt32(&统计_死亡_w, 1) 2429 | 2430 | if hp[29] > 0 && hp[28] <= 0 { 2431 | atomic.AddInt32(&统计_流未死, 1) 2432 | //print("流未死. seed:",rand.seed,runFuncName3(),"w hp:",hp[25],"流 hp:",hp[29],"盾 hp:",hp[28]) 2433 | } 2434 | if hp[28] > 0 && hp[29] <= 0 { 2435 | atomic.AddInt32(&统计_盾未死, 1) 2436 | //print("盾未死. seed:",rand.seed,runFuncName3(),"w hp:",hp[25],"流 hp:",hp[29],"盾 hp:",hp[28]) 2437 | } 2438 | } 2439 | 2440 | func runFuncName() string{ 2441 | pc := make([]uintptr,1) 2442 | runtime.Callers(2,pc) 2443 | f := runtime.FuncForPC(pc[0]) 2444 | return f.Name() 2445 | } 2446 | 2447 | func runFuncName3() string{ 2448 | pc := make([]uintptr,1) 2449 | runtime.Callers(3,pc) 2450 | f := runtime.FuncForPC(pc[0]) 2451 | return f.Name() 2452 | } 2453 | -------------------------------------------------------------------------------- /sim.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Diagnostics; 4 | using System.Threading.Tasks; 5 | 6 | namespace Suulnnka { 7 | 8 | class Random_count { 9 | const int MBIG = Int32.MaxValue; 10 | const int MSEED = 161803398; 11 | 12 | const int att = 446; 13 | const int att_ = 714; 14 | 15 | const int att_s = 624; 16 | const int att_s_ = 999; 17 | 18 | const double prob = 0.2; 19 | 20 | public int seed; 21 | int mp = 0; 22 | 23 | int inext, inextp; 24 | int[] SeedArray = new int[56]; 25 | 26 | public Random_count(int Seed) { 27 | this.seed = Seed; 28 | 29 | int ii; 30 | int mj, mk; 31 | 32 | // Numerical Recipes in C online @ http://www.library.cornell.edu/nr/bookcpdf/c7-1.pdf 33 | mj = MSEED - Math.Abs(Seed); 34 | SeedArray[55] = mj; 35 | mk = 1; 36 | for (int i = 1; i < 55; i++) { // [1, 55] is special (Knuth) 37 | ii = (21 * i) % 55; 38 | SeedArray[ii] = mk; 39 | mk = mj - mk; 40 | if (mk < 0) 41 | mk += MBIG; 42 | mj = SeedArray[ii]; 43 | } 44 | for (int k = 1; k < 5; k++) { 45 | for (int i = 1; i < 56; i++) { 46 | SeedArray[i] -= SeedArray[1 + (i + 30) % 55]; 47 | if (SeedArray[i] < 0) 48 | SeedArray[i] += MBIG; 49 | } 50 | } 51 | inext = 0; 52 | inextp = 31; 53 | } 54 | 55 | public Random_count(Random_count r) { 56 | seed = r.seed; 57 | mp = r.mp; 58 | inext = r.inext; 59 | inextp = r.inextp; 60 | for (int i = 0; i < SeedArray.Length; i++) { 61 | SeedArray[i] = r.SeedArray[i]; 62 | } 63 | } 64 | 65 | public double NextDouble() { 66 | int retVal; 67 | 68 | if (++inext >= 56) 69 | inext = 1; 70 | if (++inextp >= 56) 71 | inextp = 1; 72 | 73 | retVal = SeedArray[inext] - SeedArray[inextp]; 74 | 75 | if (retVal < 0) 76 | retVal += MBIG; 77 | 78 | SeedArray[inext] = retVal; 79 | 80 | return retVal * (1.0 / MBIG); 81 | } 82 | 83 | public int attack(int def, int hp) { 84 | bool is_skill = mp == 4; 85 | int d; 86 | if (is_skill) { 87 | if (NextDouble() > prob) { 88 | d = att_s - def; 89 | } else { 90 | d = att_s_ - def; 91 | } 92 | 93 | if (hp > d) { 94 | if (NextDouble() > prob) { 95 | d += att_s - def; 96 | } else { 97 | d += att_s_ - def; 98 | } 99 | } 100 | 101 | } else { 102 | if (NextDouble() > prob) { 103 | d = att - def; 104 | } else { 105 | d = att_ - def; 106 | } 107 | } 108 | 109 | mp++; 110 | if (mp > 4) { 111 | mp = 0; 112 | } 113 | return d; 114 | } 115 | 116 | } 117 | 118 | class Kkdy112 { 119 | 120 | static bool debug = false; 121 | 122 | static void Main() { 123 | 124 | var start = DateTime.Now; 125 | 126 | int l = 0; 127 | 128 | var for_times = 2150; 129 | var for_step = 1000000L; 130 | if (true) { 131 | for_times = 0; 132 | for_step = 1000L; 133 | } 134 | 135 | //* 136 | Parallel.For(0, for_times, i => { 137 | long step = for_step; 138 | long min = i * step; 139 | long max = (i + 1) * step; 140 | if (min < Int32.MinValue) 141 | min = Int32.MinValue; 142 | if (max < Int32.MinValue) 143 | max = Int32.MinValue; 144 | if (min > Int32.MaxValue) 145 | min = Int32.MaxValue; 146 | if (max > Int32.MaxValue) 147 | max = Int32.MaxValue; 148 | 149 | for (int j = (int)min; j < (int)max; j++) { 150 | run(j); 151 | } 152 | 153 | l++; 154 | print(l+"/"+ for_times); 155 | }); 156 | //*/ 157 | 158 | // run(4050455); 159 | 160 | print((DateTime.Now - start).ToString()); 161 | /* 162 | print("漏12狗 " + possible[0]); 163 | print("漏17狗 " + possible[1]); 164 | print("漏16双 " + possible[2]); 165 | print("漏18狗 " + possible[3]); 166 | print("漏19双 " + possible[4]); 167 | print("漏20狗 " + possible[5]); 168 | print("漏21双 " + possible[6]); 169 | print("漏23投 " + possible[7]); 170 | 171 | print("成功 " + possible[99]); 172 | 173 | for (int i = 8; i < 30; i++) { 174 | if (possible[i] > 0) { 175 | print(i + " " + possible[i]); 176 | } 177 | } 178 | */ 179 | if (!debug) { 180 | Console.ReadKey(); 181 | Console.ReadKey(); 182 | } 183 | } 184 | 185 | static void print(string str) { 186 | if (debug) { 187 | Trace.WriteLine(str); 188 | } else { 189 | Console.WriteLine(str); 190 | } 191 | } 192 | 193 | // static int[] possible = new int[100]; 194 | 195 | static bool run(int seed) { 196 | var r = new Random_count(seed); 197 | 198 | 199 | // 第一阶段 开局 6 狗 200 | { 201 | for (int i = 1; i <= 6; i++) { 202 | int hp = hp_g; 203 | 204 | while (hp > 0) { 205 | int d = r.attack(def_g,hp); 206 | hp = hp - d; 207 | } 208 | } 209 | } 210 | 211 | // 第二阶段 7-10 双 狗 狗 狗 212 | { 213 | int hp_7 = hp_s; 214 | for (int i = 0; i < 4; i++) { 215 | hp_7 -= r.attack(def_s,hp_7); 216 | if (hp_7 <= 0) 217 | break; 218 | } 219 | 220 | int hp_8 = hp_g; 221 | for (int i = 0; i < 4; i++) { 222 | hp_8 -= r.attack(def_g,hp_8); 223 | if (hp_8 <= 0) 224 | break; 225 | } 226 | 227 | if (hp_7 > 0) { 228 | for (int i = 0; i < 2; i++) { 229 | hp_7 -= r.attack(def_s,hp_7); 230 | if (hp_7 <= 0) 231 | break; 232 | } 233 | } 234 | 235 | int hp_9 = hp_g; 236 | for (int i = 0; i < 4; i++) { 237 | hp_9 -= r.attack(def_g,hp_9); 238 | if (hp_9 <= 0) 239 | break; 240 | } 241 | 242 | int hp_10 = hp_g; 243 | for (int i = 0; i < 4; i++) { 244 | hp_10 -= r.attack(def_g,hp_10); 245 | if (hp_10 <= 0) 246 | break; 247 | } 248 | } 249 | 250 | // 第三阶段 11 - 13 双 狗 盾 251 | { 252 | 253 | // 11 双 4 254 | // 12 狗 3 255 | // 11 双 1 256 | 257 | // 有7下分配到 11,12两怪 258 | int hp_11 = hp_s; 259 | int hp_12 = hp_g; 260 | int hp_13 = hp_d; 261 | 262 | int count_3 = 0; 263 | 264 | while(true) { 265 | hp_11 -= r.attack(def_s,hp_11); 266 | count_3++; 267 | if (hp_11 <= 0) 268 | break; 269 | } 270 | 271 | if (count_3 == 2) { 272 | hp_13 -= r.attack(def_d,hp_13); 273 | count_3++; 274 | } 275 | 276 | while (true) { 277 | hp_12 -= r.attack(def_g,hp_12); 278 | count_3++; 279 | if (hp_12 <= 0) 280 | break; 281 | } 282 | 283 | if (count_3 > 7) { 284 | //possible[0]++; 285 | return false; 286 | } 287 | 288 | // 至少能打8下,13怪必死 289 | for (int i = count_3; i < 15; i++) { 290 | hp_13 -= r.attack(def_d,hp_13); 291 | if (hp_13 <= 0) 292 | break; 293 | } 294 | } 295 | 296 | // 第四阶段 14 - 17 投 狗 双 狗 297 | int count_4 = 0; 298 | { 299 | // 14 投 5 300 | // 15 狗 4 301 | // 16 双 接上面的 8 302 | // 17 狗 到12 303 | // 16 双 到17 304 | int hp_14 = hp_t; 305 | for (int i = 0; i < 5; i++) { 306 | hp_14 -= r.attack(def_t,hp_14); 307 | count_4++; 308 | if (hp_14 <= 0) 309 | break; 310 | } 311 | 312 | int hp_15 = hp_g; 313 | for (int i = 0; i < 4; i++) { 314 | hp_15 -= r.attack(def_g,hp_15); 315 | count_4++; 316 | if (hp_15 <= 0) 317 | break; 318 | } 319 | 320 | // 与上两个怪均分8下攻击 321 | int hp_16 = hp_s; 322 | for (int i = count_4; i < 8; i++) { 323 | hp_16 -= r.attack(def_s,hp_16); 324 | count_4++; 325 | if (hp_16 <= 0) 326 | break; 327 | } 328 | 329 | // 如果上三个怪8下死了,那么就不会漏 17 狗 330 | 331 | int hp_17 = hp_g; 332 | for (int i = count_4; i < 12; i++) { 333 | hp_17 -= r.attack(def_g,hp_17); 334 | count_4++; 335 | if (hp_17 <= 0) 336 | break; 337 | } 338 | 339 | if (hp_17 > 0) { 340 | //possible[1]++; 341 | return false; 342 | } 343 | 344 | // 如果16没死,将获得17次攻击以前(含17)的全部剩余攻击 345 | if (hp_16 > 0) { 346 | for (int i = count_4; i < 17; i++) { 347 | hp_16 -= r.attack(def_s,hp_16); 348 | count_4++; 349 | if (hp_16 <= 0) 350 | break; 351 | } 352 | } 353 | if (hp_16 > 0) { 354 | //possible[2]++; 355 | return false; 356 | } 357 | 358 | } 359 | 360 | // 第五阶段 361 | // 如果四阶段17下解决,状况1,攻击次数正常 362 | // 如果四阶段16下解决,状况1,攻击次数+1 363 | // 如果四阶段15下解决,状况1,攻击次数+2 364 | // 如果四阶段14下及以内解决,状况2 365 | // 如果四阶段13下及以内解决,状况2 366 | 367 | if (count_4 >= 15) { 368 | // 状况 1 369 | // 18 狗 2 3 4 370 | // 19 双 5 5 5 371 | // 20 狗 0 0 0 372 | // 21 双 5 5 5 373 | 374 | return false; 375 | 376 | /* 377 | 378 | int count_5 = count_4 - 15; 379 | 380 | int hp_18 = hp_g; 381 | for (int i = count_5; i < 4; i++) { 382 | hp_18 -= r.attack(def_g); 383 | count_5++; 384 | if (hp_18 <= 0) 385 | break; 386 | } 387 | if (hp_18 > 0) { 388 | //possible[3]++; 389 | return false; 390 | } 391 | 392 | int hp_19 = hp_s; 393 | for (int i = count_5; i < 9; i++) { 394 | hp_19 -= r.attack(def_s); 395 | count_5++; 396 | if (hp_19 <= 0) 397 | break; 398 | } 399 | if (hp_19 > 0) { 400 | //possible[4]++; 401 | return false; 402 | } 403 | 404 | int hp_20 = hp_g; 405 | for (int i = count_5; i < 9; i++) { 406 | hp_20 -= r.attack(def_g); 407 | count_5++; 408 | if (hp_20 <= 0) 409 | break; 410 | } 411 | if (hp_20 > 0) { 412 | //possible[5]++; 413 | return false; 414 | } 415 | 416 | int hp_21 = hp_s; 417 | for (int i = count_5; i < 14; i++) { 418 | hp_21 -= r.attack(def_s); 419 | count_5++; 420 | if (hp_21 <= 0) 421 | break; 422 | } 423 | if (hp_21 > 0) { 424 | //possible[6]++; 425 | return false; 426 | } 427 | 428 | // TODO 429 | return false; 430 | 431 | */ 432 | 433 | } else { 434 | 435 | // 状况 2 436 | // 18 狗 4 437 | // 19 双 5 438 | // 20 狗 1 439 | // 21 双 3 440 | int count_5 = 0; 441 | //阶段5-1 442 | { 443 | int hp_18 = hp_g; 444 | for (int i = count_5; i < 4; i++) { 445 | hp_18 -= r.attack(def_g,hp_18); 446 | count_5++; 447 | if (hp_18 <= 0) 448 | break; 449 | } 450 | if (hp_18 > 0) { 451 | //possible[3]++; 452 | return false; 453 | } 454 | 455 | int hp_19 = hp_s; 456 | for (int i = count_5; i < 9; i++) { 457 | hp_19 -= r.attack(def_s,hp_19); 458 | count_5++; 459 | if (hp_19 <= 0) 460 | break; 461 | } 462 | if (hp_19 > 0) { 463 | //possible[4]++; 464 | return false; 465 | } 466 | 467 | if (count_5 <= 5) { 468 | // 另外一种轴 ? 469 | // TODO 470 | return false; 471 | } 472 | 473 | int hp_20 = hp_g; 474 | for (int i = count_5; i < 10; i++) { 475 | hp_20 -= r.attack(def_g,hp_20); 476 | count_5++; 477 | if (hp_20 <= 0) 478 | break; 479 | } 480 | if (hp_20 > 0) { 481 | //possible[5]++; 482 | return false; 483 | } 484 | 485 | } 486 | 487 | // 阶段5-2 488 | 489 | // 12下会乱轴 490 | 491 | // 21 打3下 492 | // 22 打3下 493 | // 23 打2下 494 | 495 | var r_pos_2 = new Random_count(r); 496 | var r_pos_3 = new Random_count(r); 497 | var r_pos_4 = new Random_count(r); 498 | 499 | 500 | part_5_2_pos_2(count_5, r_pos_2); 501 | part_5_2_pos_3(count_5, r_pos_3); 502 | part_5_2_pos_4(count_5, r_pos_4); 503 | 504 | return false; 505 | } 506 | 507 | // possible[99]++; 508 | // return false; 509 | 510 | } 511 | 512 | static bool part_5_2_pos_4(int count_5, Random_count r) { 513 | 514 | // 22 双 及 23 投 进入攻击范围时启动装置 515 | 516 | int hp_21 = hp_s; 517 | for (int i = count_5; i < 13; i++) { 518 | hp_21 -= r.attack(def_s, hp_21); 519 | count_5++; 520 | if (hp_21 <= 0) 521 | break; 522 | } 523 | 524 | if (count_5 <= 12) { 525 | // print("???????? TODO"); 526 | // 5-2-2 轴 TODO 527 | return false; 528 | } 529 | int hp_22 = hp_s; 530 | for (int i = count_5; i < 14; i++) { 531 | hp_22 -= r.attack(def_s, hp_22); 532 | count_5++; 533 | if (hp_22 <= 0) 534 | break; 535 | } 536 | 537 | hp_22 = hp_22 - 1000; 538 | 539 | if (hp_22 > 0) { 540 | for (int i = count_5; i < 16; i++) { 541 | hp_22 -= r.attack(def_s, hp_22); 542 | count_5++; 543 | if (hp_22 <= 0) 544 | break; 545 | } 546 | } 547 | 548 | if (hp_22 > 0) { 549 | return false; 550 | } 551 | 552 | int hp_23 = hp_t - 1000; 553 | for (int i = count_5; i < 17; i++) { 554 | hp_23 -= r.attack(def_t, hp_23); 555 | count_5++; 556 | if (hp_23 <= 0) 557 | break; 558 | } 559 | 560 | if (hp_23 > 0) { 561 | //possible[7]++; 562 | return false; 563 | } 564 | 565 | int hp_24 = hp_s; 566 | for (int i = count_5; i < 18; i++) { 567 | hp_24 -= r.attack(def_s, hp_24); 568 | count_5++; 569 | if (hp_24 <= 0) 570 | break; 571 | } 572 | 573 | int hp_25 = hp_w; 574 | for (int i = count_5; i < 25; i++) { 575 | hp_25 -= r.attack(def_w, hp_25); 576 | count_5++; 577 | } 578 | 579 | for (int i = count_5; i < 27; i++) { 580 | hp_24 -= r.attack(def_s, hp_24); 581 | count_5++; 582 | if (hp_24 <= 0) 583 | break; 584 | } 585 | 586 | for (int i = count_5; i < 27; i++) { 587 | hp_25 -= r.attack(def_w, hp_25); 588 | count_5++; 589 | } 590 | 591 | int count_last = 0; 592 | 593 | if (hp_24 > 0) { 594 | for (int i = count_last; i < 2; i++) { 595 | hp_24 -= r.attack(def_s, hp_24); 596 | count_last++; 597 | if (hp_24 <= 0) 598 | break; 599 | } 600 | } 601 | 602 | if (hp_24 > 0) { 603 | return false; 604 | } 605 | 606 | int hp_26 = hp_s; 607 | for (int i = count_last; i < 5; i++) { 608 | hp_26 -= r.attack(def_s, hp_26); 609 | count_last++; 610 | if (hp_26 <= 0) 611 | break; 612 | } 613 | 614 | for (int i = count_last; i < 8; i++) { 615 | hp_25 -= r.attack(def_w, hp_25); 616 | count_last++; 617 | if (hp_25 <= 0) 618 | break; 619 | } 620 | 621 | int hp_27 = hp_g; 622 | for (int i = count_last; i < 11; i++) { 623 | hp_27 -= r.attack(def_g, hp_27); 624 | count_last++; 625 | if (hp_27 <= 0) 626 | break; 627 | } 628 | 629 | if (hp_27 > 0) { 630 | //possible[8]++; 631 | return false; 632 | } 633 | 634 | for (int i = count_last; i < 11; i++) { 635 | hp_25 -= r.attack(def_w, hp_25); 636 | count_last++; 637 | if (hp_25 <= 0) 638 | break; 639 | } 640 | 641 | int hp_29 = hp_l; 642 | for (int i = count_last; i < 15; i++) { 643 | hp_29 -= r.attack(def_l, hp_29); 644 | count_last++; 645 | if (hp_29 <= 0) 646 | break; 647 | } 648 | 649 | if (hp_25 > 0) { 650 | for (int i = count_last; i < 17; i++) { 651 | hp_25 -= r.attack(def_w, hp_25); 652 | count_last++; 653 | if (hp_25 <= 0) 654 | break; 655 | } 656 | } 657 | 658 | if (hp_25 <= 0) { 659 | // print("w done. seed:" + r.seed); 660 | } 661 | 662 | if (hp_25 > 0) { 663 | return false; 664 | } 665 | 666 | for (int i = count_last; i < 20; i++) { 667 | hp_29 -= r.attack(def_l, hp_29); 668 | count_last++; 669 | if (hp_29 <= 0) 670 | break; 671 | } 672 | 673 | // print("流 hp:" + hp_29 + ", seed:" + r.seed); 674 | 675 | if (hp_29 > 0) { 676 | return false; 677 | } 678 | 679 | int hp_28 = hp_d; 680 | for (int i = count_last; i < 23; i++) { 681 | hp_28 -= r.attack(def_d, hp_28); 682 | count_last++; 683 | if (hp_28 <= 0) 684 | break; 685 | } 686 | 687 | print("盾 hp:" + hp_28 + ", seed:" + r.seed); 688 | 689 | if (hp_28 > 0) { 690 | return false; 691 | } 692 | 693 | print("all done. seed:" + r.seed); 694 | 695 | return true; 696 | } 697 | 698 | static bool part_5_2_pos_3(int count_5, Random_count r) { 699 | 700 | int hp_21 = hp_s; 701 | for (int i = count_5; i < 13; i++) { 702 | hp_21 -= r.attack(def_s, hp_21); 703 | count_5++; 704 | if (hp_21 <= 0) 705 | break; 706 | } 707 | 708 | if (count_5 <= 12) { 709 | // print("???????? TODO"); 710 | // 5-2-2 轴 TODO 711 | return false; 712 | } 713 | int hp_22 = hp_s; 714 | for (int i = count_5; i < 16; i++) { 715 | hp_22 -= r.attack(def_s, hp_22); 716 | count_5++; 717 | if (hp_22 <= 0) 718 | break; 719 | } 720 | 721 | if (hp_22 > 0) { 722 | return false; 723 | } 724 | 725 | if (hp_21 > 0) { 726 | for (int i = count_5; i < 16; i++) { 727 | hp_21 -= r.attack(def_s, hp_21); 728 | count_5++; 729 | if (hp_21 <= 0) 730 | break; 731 | } 732 | } 733 | 734 | int hp_23 = hp_t; 735 | for (int i = count_5; i < 17; i++) { 736 | hp_23 -= r.attack(def_t,hp_23); 737 | count_5++; 738 | if (hp_23 <= 0) 739 | break; 740 | } 741 | 742 | hp_23 = hp_23 - 1000; 743 | if (hp_23 > 0) { 744 | //for (int i = count_5; i < 18; i++) { 745 | hp_23 -= r.attack(def_t,hp_23); 746 | count_5++; 747 | //if (hp_23 <= 0) 748 | //break; 749 | //} 750 | } 751 | 752 | if (hp_23 > 0) { 753 | //possible[7]++; 754 | return false; 755 | } 756 | 757 | int hp_24 = hp_s - 1000; 758 | for (int i = count_5; i < 18; i++) { 759 | hp_24 -= r.attack(def_s,hp_24); 760 | count_5++; 761 | if (hp_24 <= 0) 762 | break; 763 | } 764 | 765 | int hp_25 = hp_w; 766 | for (int i = count_5; i < 27; i++) { 767 | hp_25 -= r.attack(def_w,hp_25); 768 | count_5++; 769 | } 770 | 771 | 772 | 773 | int count_last = 0; 774 | 775 | int hp_26 = hp_s; 776 | for (int i = count_last; i < 5; i++) { 777 | hp_26 -= r.attack(def_s,hp_26); 778 | count_last++; 779 | if (hp_26 <= 0) 780 | break; 781 | } 782 | 783 | for (int i = count_last; i < 5; i++) { 784 | hp_25 -= r.attack(def_w,hp_25); 785 | count_last++; 786 | if (hp_25 <= 0) 787 | break; 788 | } 789 | 790 | if (hp_24 > 0) { 791 | for (int i = count_last; i < 8; i++) { 792 | hp_24 -= r.attack(def_s,hp_24); 793 | count_last++; 794 | if (hp_24 <= 0) 795 | break; 796 | } 797 | } 798 | 799 | for (int i = count_last; i < 8; i++) { 800 | hp_25 -= r.attack(def_w,hp_25); 801 | count_last++; 802 | if (hp_25 <= 0) 803 | break; 804 | } 805 | 806 | int hp_27 = hp_g; 807 | for (int i = count_last; i < 11; i++) { 808 | hp_27 -= r.attack(def_g,hp_27); 809 | count_last++; 810 | if (hp_27 <= 0) 811 | break; 812 | } 813 | 814 | if (hp_27 > 0) { 815 | //possible[8]++; 816 | return false; 817 | } 818 | 819 | for (int i = count_last; i < 11; i++) { 820 | hp_25 -= r.attack(def_w,hp_25); 821 | count_last++; 822 | if (hp_25 <= 0) 823 | break; 824 | } 825 | 826 | int hp_29 = hp_l; 827 | for (int i = count_last; i < 15; i++) { 828 | hp_29 -= r.attack(def_l,hp_29); 829 | count_last++; 830 | if (hp_29 <= 0) 831 | break; 832 | } 833 | 834 | for (int i = count_last; i < 17; i++) { 835 | hp_25 -= r.attack(def_w,hp_25); 836 | count_last++; 837 | if (hp_25 <= 0) 838 | break; 839 | } 840 | 841 | if (hp_25 <= 0) { 842 | // print("w done. seed:" + r.seed); 843 | } 844 | 845 | if (hp_25 > 0) { 846 | return false; 847 | } 848 | 849 | for (int i = count_last; i < 20; i++) { 850 | hp_29 -= r.attack(def_l,hp_29); 851 | count_last++; 852 | if (hp_29 <= 0) 853 | break; 854 | } 855 | 856 | // print("流 hp:"+ hp_29 +", seed:" + r.seed); 857 | 858 | if (hp_29 > 0) { 859 | return false; 860 | } 861 | 862 | int hp_28 = hp_d; 863 | for (int i = count_last; i < 23; i++) { 864 | hp_28 -= r.attack(def_d,hp_28); 865 | count_last++; 866 | if (hp_28 <= 0) 867 | break; 868 | } 869 | 870 | print("盾 hp:" + hp_28 + ", seed:" + r.seed); 871 | 872 | if (hp_28 > 0) { 873 | return false; 874 | } 875 | 876 | print("all done. seed:" + r.seed); 877 | 878 | return true; 879 | } 880 | 881 | static bool part_5_2_pos_2(int count_5, Random_count r) { 882 | 883 | int hp_21 = hp_s; 884 | for (int i = count_5; i < 13; i++) { 885 | hp_21 -= r.attack(def_s,hp_21); 886 | count_5++; 887 | if (hp_21 <= 0) 888 | break; 889 | } 890 | 891 | if (hp_21 <= 0) { 892 | // TODO 又乱轴了 893 | // return false; 894 | } 895 | 896 | if (count_5 <= 12) { 897 | // print("???????? TODO"); 898 | // 5-2-2 轴 TODO 899 | return false; 900 | } 901 | int hp_22 = hp_s; 902 | for (int i = count_5; i < 16; i++) { 903 | hp_22 -= r.attack(def_s, hp_22); 904 | count_5++; 905 | if (hp_22 <= 0) 906 | break; 907 | } 908 | 909 | if (hp_22 <= 0) { 910 | // 又乱轴了!!! 911 | // TODO 912 | // return false; 913 | } 914 | 915 | int hp_23 = hp_t; 916 | for (int i = count_5; i < 16; i++) { 917 | hp_23 -= r.attack(def_t, hp_23); 918 | count_5++; 919 | if (hp_23 <= 0) 920 | break; 921 | } 922 | 923 | hp_23 = hp_23 - 1000; 924 | for (int i = count_5; i < 18; i++) { 925 | hp_23 -= r.attack(def_t, hp_23); 926 | count_5++; 927 | if (hp_23 <= 0) 928 | break; 929 | } 930 | 931 | if (hp_23 > 0) { 932 | //possible[7]++; 933 | return false; 934 | } 935 | 936 | //possible[count_5]++; 937 | 938 | int hp_24 = hp_s - 1000; 939 | for (int i = count_5; i < 18; i++) { 940 | hp_24 -= r.attack(def_s, hp_24); 941 | count_5++; 942 | if (hp_24 <= 0) 943 | break; 944 | } 945 | 946 | int hp_25 = hp_w; 947 | for (int i = count_5; i < 27; i++) { 948 | hp_25 -= r.attack(def_w, hp_25); 949 | count_5++; 950 | } 951 | 952 | 953 | // 5-3阶段 954 | // 26 双 5 955 | // 24 双 4 956 | // 27 狗 2 957 | // 29 流 4 958 | // 25 W 2 959 | // 29 流 3 960 | // 28 盾 3 961 | // 30 投 7 962 | 963 | 964 | // 流 W 965 | // 流 流 966 | // 流 流 967 | // 流 流 968 | // W W 969 | // W 流 970 | // 流 流 971 | // 流 流 972 | // 流 流 973 | // 盾 盾 974 | // 盾 盾 975 | // 盾 盾 976 | 977 | // 5-3阶段 978 | // 26 双 4 3 979 | // 25 W 1 1 980 | // 24 双 3 3 981 | // 27 狗 2 1 982 | // 25 W 1 3 983 | // 29 流 3 3 984 | // 25 W 2 1 985 | // 29 流 3 4 986 | // 28 盾 3 3 987 | 988 | var r_bak = new Random_count(r); 989 | 990 | { 991 | //* 标准轴 992 | int count_last = 0; 993 | 994 | int hp_26 = hp_s; 995 | for (int i = count_last; i < 5; i++) { 996 | hp_26 -= r.attack(def_s, hp_26); 997 | count_last++; 998 | if (hp_26 <= 0) 999 | break; 1000 | } 1001 | 1002 | for (int i = count_last; i < 5; i++) { 1003 | hp_25 -= r.attack(def_w, hp_25); 1004 | count_last++; 1005 | if (hp_25 <= 0) 1006 | break; 1007 | } 1008 | 1009 | if (hp_24 > 0) { 1010 | for (int i = count_last; i < 8; i++) { 1011 | hp_24 -= r.attack(def_s, hp_24); 1012 | count_last++; 1013 | if (hp_24 <= 0) 1014 | break; 1015 | } 1016 | } else { 1017 | hp_25 -= r.attack(def_w, hp_25); 1018 | count_last++; 1019 | } 1020 | 1021 | 1022 | int hp_27 = hp_g; 1023 | for (int i = count_last; i < 11; i++) { 1024 | hp_27 -= r.attack(def_g, hp_27); 1025 | count_last++; 1026 | if (hp_27 <= 0) 1027 | break; 1028 | } 1029 | 1030 | if (hp_27 > 0) { 1031 | //possible[8]++; 1032 | return false; 1033 | } 1034 | 1035 | for (int i = count_last; i < 11; i++) { 1036 | hp_25 -= r.attack(def_w, hp_25); 1037 | count_last++; 1038 | if (hp_25 <= 0) 1039 | break; 1040 | } 1041 | 1042 | int hp_29 = hp_l; 1043 | for (int i = count_last; i < 14; i++) { 1044 | hp_29 -= r.attack(def_l, hp_29); 1045 | count_last++; 1046 | if (hp_29 <= 0) 1047 | break; 1048 | } 1049 | 1050 | for (int i = count_last; i < 16; i++) { 1051 | hp_25 -= r.attack(def_w, hp_25); 1052 | count_last++; 1053 | if (hp_25 <= 0) 1054 | break; 1055 | } 1056 | 1057 | if (hp_25 <= 0) { 1058 | // print("w done. seed:" + r.seed); 1059 | } 1060 | 1061 | if (hp_25 > 0) { 1062 | // possible[11]++; 1063 | return false; 1064 | } 1065 | 1066 | for (int i = count_last; i < 19; i++) { 1067 | hp_29 -= r.attack(def_l, hp_29); 1068 | count_last++; 1069 | if (hp_29 <= 0) 1070 | break; 1071 | } 1072 | 1073 | // print("流hp: " + hp_29 + ", seed:"+r.seed); 1074 | if (hp_29 > 0) { 1075 | // possible[9]++; 1076 | return false; 1077 | } 1078 | 1079 | int hp_28 = hp_d; 1080 | for (int i = count_last; i < 22; i++) { 1081 | hp_28 -= r.attack(def_d, hp_28); 1082 | count_last++; 1083 | if (hp_28 <= 0) 1084 | break; 1085 | } 1086 | 1087 | print("盾hp: " + hp_28 + ", seed:" + r.seed); 1088 | 1089 | if (hp_28 > 0) { 1090 | // possible[10]++; 1091 | return false; 1092 | } 1093 | 1094 | print("all done. seed:" + r.seed); 1095 | 1096 | // return true; 1097 | 1098 | //*/ 1099 | } 1100 | 1101 | r = r_bak; 1102 | //* 1103 | { 1104 | int count_last = 0; 1105 | 1106 | int hp_26 = hp_s; 1107 | for (int i = count_last; i < 5; i++) { 1108 | hp_26 -= r.attack(def_s, hp_26); 1109 | count_last++; 1110 | if (hp_26 <= 0) 1111 | break; 1112 | } 1113 | 1114 | for (int i = count_last; i < 4; i++) { 1115 | hp_25 -= r.attack(def_w,hp_25); 1116 | count_last++; 1117 | if (hp_25 <= 0) 1118 | break; 1119 | } 1120 | 1121 | if (hp_24 > 0) { 1122 | for (int i = count_last; i < 8; i++) { 1123 | hp_24 -= r.attack(def_s, hp_24); 1124 | count_last++; 1125 | if (hp_24 <= 0) 1126 | break; 1127 | } 1128 | } else { 1129 | hp_25 -= r.attack(def_w, hp_25); 1130 | count_last++; 1131 | } 1132 | 1133 | 1134 | int hp_27 = hp_g; 1135 | for (int i = count_last; i < 11; i++) { 1136 | hp_27 -= r.attack(def_g, hp_27); 1137 | count_last++; 1138 | if (hp_27 <= 0) 1139 | break; 1140 | } 1141 | 1142 | if (hp_27 > 0) { 1143 | //possible[8]++; 1144 | return false; 1145 | } 1146 | 1147 | for (int i = count_last; i < 11; i++) { 1148 | hp_25 -= r.attack(def_w, hp_25); 1149 | count_last++; 1150 | if (hp_25 <= 0) 1151 | break; 1152 | } 1153 | 1154 | int hp_29 = hp_l; 1155 | for (int i = count_last; i < 14; i++) { 1156 | hp_29 -= r.attack(def_l, hp_29); 1157 | count_last++; 1158 | if (hp_29 <= 0) 1159 | break; 1160 | } 1161 | 1162 | for (int i = count_last; i < 15; i++) { 1163 | hp_25 -= r.attack(def_w, hp_25); 1164 | count_last++; 1165 | if (hp_25 <= 0) 1166 | break; 1167 | } 1168 | 1169 | if (hp_25 <= 0) { 1170 | // print("w done. seed:" + r.seed); 1171 | } 1172 | 1173 | if (hp_25 > 0) { 1174 | // possible[11]++; 1175 | return false; 1176 | } 1177 | 1178 | for (int i = count_last; i < 19; i++) { 1179 | hp_29 -= r.attack(def_l, hp_29); 1180 | count_last++; 1181 | if (hp_29 <= 0) 1182 | break; 1183 | } 1184 | 1185 | // print("流hp: " + hp_29 + ", seed:" + r.seed); 1186 | if (hp_29 > 0) { 1187 | // possible[9]++; 1188 | return false; 1189 | } 1190 | 1191 | int hp_28 = hp_d; 1192 | for (int i = count_last; i < 22; i++) { 1193 | hp_28 -= r.attack(def_d, hp_28); 1194 | count_last++; 1195 | if (hp_28 <= 0) 1196 | break; 1197 | } 1198 | 1199 | print("盾hp: " + hp_28 + ", seed:" + r.seed); 1200 | 1201 | if (hp_28 > 0) { 1202 | // possible[10]++; 1203 | return false; 1204 | } 1205 | 1206 | print("all done. seed:" + r.seed); 1207 | 1208 | return true; 1209 | } 1210 | //*/ 1211 | } 1212 | } 1213 | } 1214 | -------------------------------------------------------------------------------- /sim.go: -------------------------------------------------------------------------------- 1 | // GOOS=windows GOARCH=amd64 go build sim.go 2 | // GOOS=darwin GOARCH=arm64 go build sim.go 3 | 4 | package main 5 | 6 | import ( 7 | "os" 8 | "fmt" 9 | "time" 10 | "math" 11 | "runtime" 12 | "sync/atomic" 13 | ) 14 | 15 | var log bool = true 16 | var debug bool = false 17 | var times int32 = 2148 // 2148 18 | var step int32 = 1000000 // 1000000 19 | var fout *os.File 20 | 21 | type Random struct{ 22 | inext int 23 | inextp int 24 | SeedArray [56]int32 25 | seed int32 26 | 27 | mp int 28 | } 29 | func (random *Random) init( Seed int32 ){ 30 | const MBIG int32 = 2147483647; 31 | const MSEED int32 = 161803398; 32 | 33 | const Int32_min int32 = -2147483648; 34 | const Int32_max int32 = 2147483647; 35 | 36 | var mj, mk int32 37 | 38 | mj = MSEED - Seed; 39 | random.SeedArray[55] = mj; 40 | mk = 1; 41 | for i := 1; i < 55; i++ { 42 | ii := (21 * i) % 55; 43 | random.SeedArray[ii] = mk; 44 | mk = mj - mk; 45 | if (mk < 0) { mk = mk + MBIG } 46 | mj = random.SeedArray[ii]; 47 | } 48 | for k := 1; k < 5; k++ { 49 | for i := 1; i < 56; i++ { 50 | random.SeedArray[i] = random.SeedArray[i] - random.SeedArray[1 + (i + 30) % 55] 51 | if random.SeedArray[i] < 0 { random.SeedArray[i] = random.SeedArray[i] + MBIG } 52 | } 53 | } 54 | random.inext = 0 55 | random.inextp = 21 56 | random.mp = 0 57 | random.seed = Seed 58 | } 59 | func (random *Random) NextDouble() float64{ 60 | const MBIG int32 = 2147483647; 61 | 62 | random.inext = random.inext + 1 63 | random.inextp = random.inextp + 1 64 | if random.inext >= 56 { 65 | random.inext = 1 66 | } 67 | if random.inextp >= 56 { 68 | random.inextp = 1 69 | } 70 | var retVal int32 = random.SeedArray[random.inext] - random.SeedArray[random.inextp] 71 | 72 | if (retVal == MBIG) {retVal--} 73 | if (retVal < 0){ 74 | retVal = retVal + MBIG 75 | } 76 | 77 | random.SeedArray[random.inext] = retVal; 78 | 79 | return float64(retVal) * (1.0 / float64(MBIG)); 80 | } 81 | func (random *Random) attack (def int, hp int) int { 82 | const prob float64 = 0.20 83 | const kkdyAtk float64 = 446.0 84 | 85 | var normal int = int(math.Round(kkdyAtk)) 86 | var cirt int = int(math.Round(kkdyAtk * 1.6)) 87 | var skill int = int(math.Round(kkdyAtk * 1.4)) 88 | var skill_crit int = int(math.Round(kkdyAtk * 1.6 * 1.4)) 89 | 90 | damage := 0 91 | if random.mp == 4 { 92 | if random.NextDouble() > prob { 93 | damage = skill - def; 94 | } else { 95 | damage = skill_crit - def; 96 | } 97 | if hp > damage { 98 | if random.NextDouble() > prob { 99 | damage = damage + skill - def; 100 | } else { 101 | damage = damage + skill_crit - def; 102 | } 103 | } 104 | 105 | } else { 106 | if random.NextDouble() > prob { 107 | damage = normal - def; 108 | } else { 109 | damage = cirt - def; 110 | } 111 | } 112 | 113 | random.mp = random.mp + 1 114 | if random.mp > 4 { 115 | random.mp = 0; 116 | } 117 | 118 | return damage; 119 | } 120 | 121 | const ( 122 | def_g int = 0 123 | hp_g int = 1700 124 | 125 | def_s int = 100 126 | hp_s int = 2000 127 | 128 | def_t int = 85 129 | hp_t int = 2000 130 | 131 | def_d int = 250 132 | hp_d int = 2050 133 | 134 | def_l int = 50 135 | hp_l int = 5000 136 | 137 | def_w int = 100 138 | hp_w int = 10000 139 | ) 140 | var ( 141 | def []int 142 | max_hp []int 143 | 144 | process chan int32 145 | wait chan bool 146 | ) 147 | 148 | func print(args ...interface{}){ 149 | //fmt.Println(args...) 150 | if debug { 151 | fmt.Println(args...) 152 | }else{ 153 | fmt.Fprintln(fout,args...) 154 | } 155 | } 156 | 157 | // 统计 158 | var ( 159 | 统计_阶段_1 int32 = 0 160 | 统计_阶段_3 int32 = 0 161 | 统计_死亡_13 int32 = 0 162 | 统计_阶段_4 int32 = 0 163 | 统计_阶段_5_1 int32 = 0 164 | 统计_阶段_5_2 int32 = 0 165 | 统计_阶段_5_1_分支 int32 = 0 166 | 统计_阶段_5_2_分支 int32 = 0 167 | 统计_死亡_18 int32 = 0 168 | 统计_速死_18 int32 = 0 169 | 统计_速死_19 int32 = 0 170 | 统计_死亡_20 int32 = 0 171 | 统计_死亡_21 int32 = 0 172 | 统计_速死_21 int32 = 0 173 | 统计_死亡_22 int32 = 0 174 | 统计_速死_23 int32 = 0 175 | 统计_死亡_23 int32 = 0 176 | 统计_死亡_w int32 = 0 177 | 统计_阶段_w int32 = 0 178 | 179 | 统计_流未死 int32 = 0 180 | 统计_盾未死 int32 = 0 181 | 182 | TODO_T1 int32 = 0 183 | TODO_T2 int32 = 0 184 | TODO_T3 int32 = 0 185 | TODO_T4 int32 = 0 186 | 187 | DONE int32 = 0 188 | ) 189 | 190 | // timeline 191 | var ( 192 | 阶段_2 [][]int = [][]int{ 193 | {7,0,0}, 194 | {7,0,0}, 195 | {7,0,0}, 196 | {7,0,0}, 197 | {8,7,0}, 198 | {8,7,0}, 199 | {8,7,0}, 200 | {8,7,0}, 201 | {8,7,9}, 202 | {7,9,10}, 203 | {7,9,10}, 204 | {7,9,10}, 205 | {7,9,10}, 206 | {9,10,0}, 207 | {9,10,0}, 208 | {9,10,0}, 209 | } 210 | 阶段_3 [][]int = [][]int{ 211 | {11,0,0}, 212 | {11,0,0}, 213 | {11,12,0}, 214 | {11,13,12}, 215 | {11,13,12}, 216 | {11,13,12}, 217 | {13,11,12}, 218 | {11,12,0}, 219 | {12,0,0}, 220 | {12,0,0}, 221 | {12,0,0}, 222 | {12,0,0}, 223 | {12,0,0}, 224 | {12,0,0}, 225 | {12,0,0}, 226 | {12,0,0}, 227 | } 228 | 阶段_4 [][]int = [][]int{ 229 | {14,0,0}, 230 | {14,0,0}, 231 | {14,15,0}, 232 | {14,15,0}, 233 | {14,15,16}, 234 | {14,15,16}, 235 | {14,15,16}, 236 | {14,15,16}, 237 | {15,17,16}, 238 | {15,17,16}, 239 | {17,16,0}, 240 | {17,16,0}, 241 | {16,0,0}, 242 | {16,0,0}, 243 | {16,0,0}, 244 | {16,18,0}, 245 | {16,18,19}, 246 | } 247 | 阶段_5_1_S [][]int = [][]int{ 248 | {18,0,0}, 249 | {18,0,0}, 250 | {18,19,0}, 251 | {18,19,0}, 252 | {18,19,0}, 253 | {19,0,0}, // {19,20,0}, 254 | {19,20,21}, 255 | {19,20,21}, 256 | {19,20,21}, 257 | {20,21,0}, 258 | {21,0,0}, 259 | {21,0,0}, 260 | {21,0,0}, 261 | } 262 | 阶段_5_1_M [][]int = [][]int{ 263 | {22,21, 0, 0}, 264 | {22,21,23, 0}, 265 | {22,21,23, 0}, 266 | {22,21,23,24}, 267 | {22,21,23,24}, 268 | } 269 | 阶段_5_1_燃烧_不变 [][]int = [][]int{ 270 | {22,21}, 271 | {22,21,23}, 272 | {22,21,23}, 273 | {22,21,23,24}, 274 | {22,21,24,23}, 275 | {22,25,21,24,23}, 276 | {22,25,21,24,23}, 277 | {22,25,21,24,23}, 278 | {22,25,21,24,23}, 279 | {22,21,25,24,23}, 280 | {22,21,25,24,23}, 281 | {21,22,25,24,23}, 282 | {22,21,24,25,23}, 283 | {22,24,25,26,23}, 284 | {24,26,25,23}, 285 | {24,26,25,23}, 286 | {26,25,23}, 287 | {26,25,23}, 288 | {26,25,23}, 289 | {26,25,23}, 290 | {25,23}, 291 | {25,27,23}, 292 | {27,25,23,28}, 293 | {27,25,29,23,28}, 294 | {27,25,29,23,28}, 295 | {29,25,23,28}, 296 | {29,25,23,28}, 297 | {29,25,23,28}, 298 | {29,25,23,28}, 299 | {25,29,23,28}, 300 | {25,29,23,28}, 301 | {29,23,28}, 302 | {29,23,28}, 303 | {29,23,28}, 304 | {23,28}, 305 | {23,28}, 306 | {28,30}, 307 | {30}, 308 | {30}, 309 | {30}, 310 | {30}, 311 | {30}, 312 | {30}, 313 | {30}, 314 | {30}, 315 | {30}, 316 | {30}, 317 | {30}, 318 | {30}, 319 | {30}, 320 | {30}, 321 | } 322 | 阶段_5_1_燃烧_变 [][]int = [][]int{ 323 | {24,23}, 324 | {25,24,23}, 325 | {25,24,23}, 326 | {25,24,23}, 327 | {25,24,23}, 328 | {25,24,23}, 329 | {25,24,23}, 330 | {24,25,23}, 331 | {24,25,23}, 332 | {24,25,26,23}, 333 | {24,26,25,23}, 334 | {24,26,25,23}, 335 | {26,25,23}, 336 | {26,25,23}, 337 | {26,25,23}, 338 | {26,25,23}, 339 | {25,27,23}, 340 | {27,25,23}, 341 | {27,25,23,28}, 342 | {27,25,29,23,28}, 343 | {27,25,29,23,28}, 344 | {29,25,23,28}, 345 | {29,25,23,28}, 346 | {29,25,23,28}, 347 | {25,29,28,23}, 348 | {25,29,28,23}, 349 | {29,28,23}, 350 | {29,28,23}, 351 | {29,28,23}, 352 | {28,23}, 353 | {28,23}, 354 | {28,23}, 355 | {23,30}, 356 | {30}, 357 | {30}, 358 | {30}, 359 | {30}, 360 | {30}, 361 | {30}, 362 | {30}, 363 | {30}, 364 | {30}, 365 | {30}, 366 | } 367 | 阶段_5_1_双持_不变 [][]int = [][]int{ 368 | {22,21}, 369 | {22,21,23}, 370 | {22,21,23}, 371 | {22,21,23}, 372 | {22,21,23,24}, 373 | {22,21,25,23,24}, 374 | {22,21,25,23,24}, 375 | {22,21,25,23,24}, 376 | {22,21,25,23,24}, 377 | {22,21,25,23,24}, 378 | {22,21,25,23,24}, 379 | {21,22,25,23,24}, 380 | {22,21,25,24,23}, 381 | {22,25,26,24,23}, 382 | {26,25,24,23}, 383 | {26,25,24,23}, 384 | {26,25,24,23}, 385 | {26,25,24,23}, 386 | {26,25,24,23}, 387 | {26,24,25,23}, 388 | {24,25,23}, 389 | {24,25,27,23}, 390 | {24,27,25,23,28}, 391 | {24,27,25,29,23,28}, 392 | {27,25,29,23,28}, 393 | {29,25,23,28}, 394 | {29,25,23,28}, 395 | {29,25,23,28}, 396 | {29,25,23,28}, 397 | {25,29,23,28}, 398 | {25,29,23,28}, 399 | {29,23,28}, 400 | {29,23,28}, 401 | {29,23,28}, 402 | {23,28}, 403 | {23,28}, 404 | {28,30}, 405 | {30}, 406 | {30}, 407 | {30}, 408 | {30}, 409 | {30}, 410 | {30}, 411 | {30}, 412 | {30}, 413 | {30}, 414 | {30}, 415 | } 416 | 阶段_5_1_双持_变 [][]int = [][]int{ 417 | {24}, 418 | {25,24}, 419 | {25,24}, 420 | {25,24}, 421 | {25,24}, 422 | {25,24}, 423 | {25,24}, 424 | {25,24}, 425 | {25,24}, 426 | {25,26,24}, 427 | {26,25,24}, 428 | {26,25,24}, 429 | {26,25,24}, 430 | {26,25,24}, 431 | {26,24,25}, 432 | {26,24,25}, 433 | {24,25,27}, 434 | {24,27,25}, 435 | {24,27,25,28}, 436 | {27,25,29,28}, 437 | {27,25,29,28}, 438 | {29,25,28}, 439 | {29,25,28}, 440 | {29,25,28}, 441 | {25,29,28}, 442 | {25,29,28}, 443 | {29,28}, 444 | {29,28}, 445 | {29,28}, 446 | {28}, 447 | {28}, 448 | {28}, 449 | {30}, 450 | {30}, 451 | {30}, 452 | {30}, 453 | {30}, 454 | {30}, 455 | {30}, 456 | {30}, 457 | {30}, 458 | {30}, 459 | } 460 | 阶段_5_1_w_不变 [][]int = [][]int{ 461 | {22,21,25,24,23}, 462 | {22,21,25,24,23}, 463 | {22,21,25,24,23}, 464 | {22,21,25,24,23}, 465 | {22,21,25,24,23}, 466 | {22,21,25,24,23}, 467 | {22,21,25,24,23}, 468 | {22,21,25,24,23}, 469 | {22,25,26,24,23}, 470 | {26,25,24,23}, 471 | {26,25,24,23}, 472 | {26,25,24,23}, 473 | {26,25,24,23}, 474 | {26,25,24,23}, 475 | {26,24,25,23}, 476 | {24,25,23}, 477 | {24,25,27,23}, 478 | {24,27,25,23,28}, 479 | {24,27,25,29,23,28}, 480 | {27,25,29,23,28}, 481 | {29,25,23,28}, 482 | {29,25,23,28}, 483 | {29,25,23,28}, 484 | {29,25,23,28}, 485 | {29,25,28,23}, 486 | {29,25,28,23}, 487 | {29,25,23,28}, 488 | {29,28,25,23}, 489 | {29,28,23,25}, 490 | {28,23,25}, 491 | {23,28,25}, 492 | {28,25,23,30}, 493 | {23,25,30}, 494 | {30}, 495 | {30}, 496 | {30}, 497 | {30}, 498 | {30}, 499 | {30}, 500 | {30}, 501 | {30}, 502 | {30}, 503 | {30}, 504 | } 505 | 阶段_5_1_w_变 [][]int = [][]int{ 506 | {25,24,23}, 507 | {25,24,23}, 508 | {25,24,23}, 509 | {25,24,23}, 510 | {25,24,23}, 511 | {25,24,23}, 512 | {25,24,23}, 513 | {25,24,23}, 514 | {25,26,24,23}, 515 | {26,25,24,23}, 516 | {26,25,24,23}, 517 | {26,25,24,23}, 518 | {26,25,24,23}, 519 | {26,25,24,23}, 520 | {26,24,25,23}, 521 | {24,25,23}, 522 | {24,25,27,23}, 523 | {24,27,25,23,28}, 524 | {24,27,25,29,23,28}, 525 | {27,25,29,23,28}, 526 | {29,25,23,28}, 527 | {29,25,23,28}, 528 | {29,25,23,28}, 529 | {29,25,23,28}, 530 | {25,29,28,23}, 531 | {25,29,28,23}, 532 | {29,28}, 533 | {29,28}, 534 | {29,28}, 535 | {28}, 536 | {28}, 537 | {28,30}, 538 | {30}, 539 | {30}, 540 | {30}, 541 | {30}, 542 | {30}, 543 | {30}, 544 | {30}, 545 | {30}, 546 | {30}, 547 | } 548 | 阶段_5_21速死_w_不变 [][]int = [][]int{{22},{22,23},{22,23},{22,23},{22,23,24},{22,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,26,24,23},{22,25,26,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,24,25,23},{26,24,25,23},{24,25,27,23},{24,27,25,23},{24,27,25,23,28},{27,25,29,23,28},{27,25,29,23,28},{29,25,23,28},{29,25,23,28},{29,25,23,28},{29,25,28,23},{29,25,28,23},{29,25,28,23},{29,28,25,23},{29,28,23,25},{28,23,25},{28,23,25},{28,25,23,30},{23,25,30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30}} 549 | 阶段_5_21速死_w_变 [][]int = [][]int{{22},{22,23},{22,23},{22,23},{22,23,24},{22,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,24,23},{22,25,26,24,23},{22,25,26,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,25,24,23},{26,24,25,23},{26,24,25,23},{24,25,27,23},{24,27,25,23},{24,27,25,23,28},{27,25,29,23,28},{27,25,29,23,28},{29,25,23,28},{29,25,23,28},{29,25,23,28},{25,29,28},{25,29,28},{29,28},{29,28},{29,28},{28},{28},{28,30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30},{30}} 550 | 阶段_5_21速死_燃烧_不变 [][]int = [][]int{ 551 | {22}, 552 | {22,23}, 553 | {22,23}, 554 | {22,23}, 555 | {22,23,24}, 556 | {22,24,23}, 557 | {22,25,24,23}, 558 | {22,25,24,23}, 559 | {22,25,24,23}, 560 | {22,25,24,23}, 561 | {22,25,24,23}, 562 | {22,25,24,23}, 563 | {22,24,25,23}, 564 | {22,24,25,26,23}, 565 | {22,24,25,26,23}, 566 | {24,26,25,23}, 567 | {24,26,25,23}, 568 | {26,25,23}, 569 | {26,25,23}, 570 | {26,25,23}, 571 | {26,25,23}, 572 | {25,27,23}, 573 | {27,25,23}, 574 | {27,25,23,28}, 575 | {27,25,29,23,28}, 576 | {27,25,29,23,28}, 577 | {29,25,23,28}, 578 | {29,25,23,28}, 579 | {29,25,23,28}, 580 | {25,29,23,28}, 581 | {25,29,23,28}, 582 | {29,28,23}, 583 | {29,23,28}, 584 | {29,23,28}, 585 | {23,28}, 586 | {23,28}, 587 | {23,28}, 588 | {30}, 589 | {30}, 590 | {30}, 591 | {30}, 592 | {30}, 593 | {30}, 594 | {30}, 595 | {30}, 596 | {30}, 597 | {30}, 598 | {30}, 599 | } 600 | 阶段_5_21速死_燃烧_变 [][]int = [][]int{ 601 | {23}, 602 | {23}, 603 | {23}, 604 | {24,23}, 605 | {25,24,23}, 606 | {25,24,23}, 607 | {25,24,23}, 608 | {25,24,23}, 609 | {25,24,23}, 610 | {25,24,23}, 611 | {25,24,23}, 612 | {24,25,23}, 613 | {24,25,26,23}, 614 | {24,26,25,23}, 615 | {24,26,25,23}, 616 | {24,26,25,23}, 617 | {26,25,23}, 618 | {26,25,23}, 619 | {26,25,23}, 620 | {25,23}, 621 | {25,27,23}, 622 | {27,25,23,28}, 623 | {27,25,29,23,28}, 624 | {27,25,29,23,28}, 625 | {29,25,23,28}, 626 | {29,25,23,28}, 627 | {29,25,23,28}, 628 | {29,25,23,28}, 629 | {25,29,23,28}, 630 | {25,29,23,28}, 631 | {29,23,28}, 632 | {29,23,28}, 633 | {29,23,28}, 634 | {23,28}, 635 | {23,28}, 636 | {28,30}, 637 | {30}, 638 | {30}, 639 | {30}, 640 | {30}, 641 | {30}, 642 | {30}, 643 | {30}, 644 | {30}, 645 | } 646 | 阶段_5_21速死_双持_不变 [][]int = [][]int{ 647 | {22}, 648 | {22,23}, 649 | {22,23}, 650 | {22,23}, 651 | {22,23,24}, 652 | {22,23,24}, 653 | {22,25,23,24}, 654 | {22,25,23,24}, 655 | {22,25,23,24}, 656 | {22,25,23,24}, 657 | {22,25,23,24}, 658 | {22,25,23,24}, 659 | {22,25,24,23}, 660 | {22,25,24,23}, 661 | {22,25,26,24,23}, 662 | {26,25,24,23}, 663 | {26,25,24,23}, 664 | {26,25,24,23}, 665 | {26,25,24,23}, 666 | {26,24,25,23}, 667 | {26,24,25,23}, 668 | {24,25,27,23}, 669 | {24,27,25,23}, 670 | {24,27,25,23,28}, 671 | {27,25,29,23,28}, 672 | {27,25,29,23,28}, 673 | {29,25,23,28}, 674 | {29,25,23,28}, 675 | {29,25,23,28}, 676 | {25,29,23,28}, 677 | {25,29,23,28}, 678 | {29,23,28}, 679 | {29,23,28}, 680 | {29,23,28}, 681 | {23,28}, 682 | {23,28}, 683 | {23,28}, 684 | {30}, 685 | {30}, 686 | {30}, 687 | {30}, 688 | {30}, 689 | {30}, 690 | {30}, 691 | {30}, 692 | {30}, 693 | {30}, 694 | {30}, 695 | {30}, 696 | } 697 | 阶段_5_21速死_双持_变 [][]int = [][]int{ 698 | {24}, 699 | {25,24}, 700 | {25,24}, 701 | {25,24}, 702 | {25,24}, 703 | {25,24}, 704 | {25,24}, 705 | {25,24}, 706 | {25,24}, 707 | {25,26,24}, 708 | {26,25,24}, 709 | {26,25,24}, 710 | {26,25,24}, 711 | {26,25,24}, 712 | {26,25,24}, 713 | {26,24,25}, 714 | {24,25}, 715 | {24,25,27}, 716 | {24,27,25,28}, 717 | {24,27,25,29,28}, 718 | {27,25,29,28}, 719 | {29,25,28}, 720 | {29,25,28}, 721 | {29,25,28}, 722 | {29,25,28}, 723 | {25,29,28}, 724 | {25,29,28}, 725 | {29,28}, 726 | {29,28}, 727 | {29,28}, 728 | {28}, 729 | {28}, 730 | {28,30}, 731 | {30}, 732 | {30}, 733 | {30}, 734 | {30}, 735 | {30}, 736 | {30}, 737 | {30}, 738 | {30}, 739 | {30}, 740 | } 741 | 阶段_5_2_S [][]int = [][]int{ {18,19},{18,19},{19},{19,20},{19,20,21},{19,20,21},{19,20,21},{21},{21},{21},{21} } 742 | 阶段_5_2_M [][]int = [][]int{ 743 | {21,22,23}, 744 | {22,21,23}, 745 | {22,21,23}, 746 | {22,21,23,24}, 747 | {22,21,24,23}, 748 | } 749 | 阶段_5_2_燃烧_不变 [][]int = [][]int{ 750 | {21,22,23}, 751 | {22,21,23}, 752 | {22,21,23}, 753 | {22,21,23,24}, 754 | {22,21,24,23}, 755 | {22,21,25,24,23}, 756 | {22,21,25,24,23}, 757 | {22,21,25,24,23}, 758 | {22,21,25,24,23}, 759 | {22,21,25,24,23}, 760 | {22,21,25,24,23}, 761 | {22,21,25,24,23}, 762 | {22,21,24,25,23}, 763 | {22,24,25,26,23}, 764 | {24,26,25,23}, 765 | {24,26,25,23}, 766 | {26,25,23}, 767 | {26,25,23}, 768 | {26,25,23}, 769 | {26,25,23}, 770 | {25,23}, 771 | {27,25,23}, 772 | {27,25,23,28}, 773 | {27,25,29,23,28}, 774 | {27,25,29,23,28}, 775 | {29,25,23,28}, 776 | {29,25,23,28}, 777 | {29,25,23,28}, 778 | {25,29,28,23}, 779 | {25,29,28,23}, 780 | {29,23,28}, 781 | {29,28,23}, 782 | {29,28,23}, 783 | {28,23}, 784 | {23,28}, 785 | {28,23}, 786 | {30}, 787 | {30}, 788 | {30}, 789 | {30}, 790 | {30}, 791 | {30}, 792 | {30}, 793 | {30}, 794 | {30}, 795 | {30}, 796 | {30}, 797 | } 798 | 阶段_5_2_燃烧_变 [][]int = [][]int{ 799 | {24,23}, 800 | {25,24,23}, 801 | {25,24,23}, 802 | {25,24,23}, 803 | {25,24,23}, 804 | {25,24,23}, 805 | {25,24,23}, 806 | {25,24,23}, 807 | {24,25,23}, 808 | {24,25,26,23}, 809 | {24,25,26,23}, 810 | {24,26,25,23}, 811 | {24,26,25,23}, 812 | {26,25,23}, 813 | {26,25,23}, 814 | {26,25,23}, 815 | {26,25,23}, 816 | {25,27,23}, 817 | {27,25,23}, 818 | {27,25,23,28}, 819 | {27,25,29,23,28}, 820 | {29,25,23,28}, 821 | {29,25,23,28}, 822 | {29,25,23,28}, 823 | {29,25,23,28}, 824 | {25,29,28,23}, 825 | {25,29,28,23}, 826 | {29,23,28}, 827 | {29,28,23}, 828 | {29,28,23}, 829 | {28,23}, 830 | {23,28}, 831 | {28,23,30}, 832 | {30}, 833 | {30}, 834 | {30}, 835 | {30}, 836 | {30}, 837 | {30}, 838 | {30}, 839 | {30}, 840 | {30}, 841 | } 842 | 阶段_5_2_双持_不变 [][]int = [][]int{ 843 | {21,22,23}, 844 | {22,21,23}, 845 | {22,21,23}, 846 | {22,21,23,24}, 847 | {22,21,23,24}, 848 | {22,21,25,23,24}, 849 | {22,21,25,23,24}, 850 | {22,21,25,23,24}, 851 | {22,21,25,23,24}, 852 | {22,21,25,23,24}, 853 | {22,21,25,23,24}, 854 | {22,21,25,24,23}, 855 | {22,21,25,24,23}, 856 | {22,25,26,24,23}, 857 | {26,25,24,23}, 858 | {26,25,24,23}, 859 | {26,25,24,23}, 860 | {26,25,24,23}, 861 | {26,25,24,23}, 862 | {26,24,25,23}, 863 | {24,25,23}, 864 | {24,27,25,23}, 865 | {24,27,25,23,28}, 866 | {27,25,29,23,28}, 867 | {27,25,29,23,28}, 868 | {29,25,23,28}, 869 | {29,25,23,28}, 870 | {29,25,23,28}, 871 | {25,29,23,28}, 872 | {25,29,23,28}, 873 | {29,23,28}, 874 | {29,23,28}, 875 | {29,23,28}, 876 | {23,28}, 877 | {23,28}, 878 | {23,28}, 879 | {30}, 880 | {30}, 881 | {30}, 882 | {30}, 883 | {30}, 884 | {30}, 885 | {30}, 886 | {30}, 887 | {30}, 888 | {30}, 889 | {30}, 890 | {30}, 891 | {30}, 892 | } 893 | 阶段_5_2_w_不变 [][]int = [][]int{ 894 | {22,21,25,24}, 895 | {22,21,25,24}, 896 | {22,21,25,24}, 897 | {22,21,25,24}, 898 | {22,21,25,24}, 899 | {22,21,25,24}, 900 | {22,21,25,24}, 901 | {22,21,25,24}, 902 | {22,25,26,24}, 903 | {26,25,24}, 904 | {26,25,24}, 905 | {26,25,24}, 906 | {26,25,24}, 907 | {26,25,24}, 908 | {26,24,25}, 909 | {24,25}, 910 | {24,27,25}, 911 | {24,27,25,28}, 912 | {27,25,29,28}, 913 | {27,25,29,28}, 914 | {29,25,28}, 915 | {29,25,28}, 916 | {29,25,28}, 917 | {29,25,28}, 918 | {29,25,28}, 919 | {29,25,28}, 920 | {29,28,25}, 921 | {29,28,25}, 922 | {28,25}, 923 | {28,25}, 924 | {28,25}, 925 | {23,25,30}, 926 | {30}, 927 | {30}, 928 | {30}, 929 | {30}, 930 | {30}, 931 | {30}, 932 | {30}, 933 | {30}, 934 | {30}, 935 | {30}, 936 | {30}, 937 | {30}, 938 | } 939 | 阶段_5_2_w_变 [][]int = [][]int{ 940 | {25,24}, 941 | {25,24}, 942 | {25,24}, 943 | {25,24}, 944 | {25,24}, 945 | {25,24}, 946 | {25,24}, 947 | {25,24}, 948 | {25,26,24}, 949 | {26,25,24}, 950 | {26,25,24}, 951 | {26,25,24}, 952 | {26,25,24}, 953 | {26,25,24}, 954 | {26,24,25}, 955 | {24,25}, 956 | {24,27,25}, 957 | {24,27,25,28}, 958 | {27,25,29,28}, 959 | {27,25,29,28}, 960 | {29,25,28}, 961 | {29,25,28}, 962 | {29,25,28}, 963 | {29,25,28}, 964 | {25,29,28}, 965 | {29,28}, 966 | {29,28}, 967 | {29,28}, 968 | {28}, 969 | {28}, 970 | {28}, 971 | {30}, 972 | {30}, 973 | {30}, 974 | {30}, 975 | {30}, 976 | {30}, 977 | {30}, 978 | {30}, 979 | {30}, 980 | {30}, 981 | {30}, 982 | {30}, 983 | {30}, 984 | } 985 | 阶段_5_23速死 [][]int = [][]int{ 986 | {24}, 987 | {24}, 988 | {25,24}, 989 | {25,24}, 990 | {25,24}, 991 | {25,24}, 992 | {25,24}, 993 | {25,24}, 994 | {25,24}, 995 | {24,25}, 996 | {24,25,26}, 997 | {24,26,25}, 998 | {24,26,25}, 999 | {26,25}, 1000 | {26,25}, 1001 | {26,25}, 1002 | {26,25}, 1003 | {25}, 1004 | {25,27}, 1005 | {27,25,28}, 1006 | {27,25,29,28}, 1007 | {27,25,29,28}, 1008 | {29,25,28}, 1009 | {29,25,28}, 1010 | {29,25,28}, 1011 | {29,25,28}, 1012 | {25,29,28}, 1013 | {25,29,28}, 1014 | {29,28}, 1015 | {29,28}, 1016 | {29,28}, 1017 | {28}, 1018 | {28}, 1019 | {28,30}, 1020 | {30}, 1021 | {30}, 1022 | {30}, 1023 | {30}, 1024 | {30}, 1025 | {30}, 1026 | {30}, 1027 | {30}, 1028 | {30}, 1029 | {30}, 1030 | } 1031 | ) 1032 | 1033 | func main(){ 1034 | sim() 1035 | } 1036 | 1037 | func sim() { 1038 | 1039 | file, fileErr := os.Create("output.txt") 1040 | if fileErr != nil { 1041 | fmt.Println(fileErr) 1042 | return 1043 | } 1044 | fout = file 1045 | 1046 | def = []int{0,def_g,def_g,def_g,def_g,def_g,def_g,def_s,def_g,def_g,def_g,def_s,def_d,def_g,def_t,def_g,def_s,def_g,def_g,def_s,def_g,def_s,def_s,def_t,def_s,def_w,def_s,def_g,def_d,def_l,def_t} 1047 | max_hp = []int{0,hp_g,hp_g,hp_g,hp_g,hp_g,hp_g,hp_s,hp_g,hp_g,hp_g,hp_s,hp_d,hp_g,hp_t,hp_g,hp_s,hp_g,hp_g,hp_s,hp_g,hp_s,hp_s,hp_t,hp_s,hp_w,hp_s,hp_g,hp_d,hp_l,hp_t} 1048 | 1049 | startTime := time.Now().Unix() 1050 | 1051 | if debug == false { 1052 | coreNumber := runtime.NumCPU() 1053 | print("cpu core number is",coreNumber) 1054 | process = make(chan int32 ,coreNumber) 1055 | wait = make(chan bool) 1056 | 1057 | for i := int32(0) ; i < times ; i ++ { 1058 | var min int32 = i * step 1059 | var max int32 = min + step - 1 1060 | var test_min int64 = int64(i) * int64(step) 1061 | var test_max int64 = int64(i) * int64(step) + int64(step) 1062 | if test_min > 2147483647 { 1063 | min = 2147483647 1064 | } 1065 | if test_max > 2147483647 { 1066 | max = 2147483647 1067 | } 1068 | process <- i 1069 | go run_range(min,max) 1070 | } 1071 | 1072 | for j := 0 ; j < int(times) ; j ++ { 1073 | <-wait 1074 | } 1075 | 1076 | }else{ 1077 | // run(44990697) // 被打死 1078 | run(2124733276) // 吃一个暴击 1079 | 1080 | // run(1079385285) // +2 攻击 1081 | // run(1097943659) // +1 攻击 1082 | // run(1094706438) // +2% 暴率 1083 | // run(1813350023) // +2% 暴率 1084 | // run(1454282831) // +2% 暴率 1085 | // run(1748821225) // +1% 暴率 被打死 1086 | 1087 | } 1088 | 1089 | if log { 1090 | print("统计_阶段_1",统计_阶段_1) 1091 | print("统计_阶段_3",统计_阶段_3) 1092 | print("统计_死亡_13",统计_死亡_13) 1093 | print("统计_阶段_4",统计_阶段_4) 1094 | print("统计_阶段_5_1",统计_阶段_5_1) 1095 | print("统计_阶段_5_2",统计_阶段_5_2) 1096 | print("统计_阶段_5_1_分支",统计_阶段_5_1_分支) 1097 | print("统计_阶段_5_2_分支",统计_阶段_5_2_分支) 1098 | print("统计_死亡_18",统计_死亡_18) 1099 | print("统计_速死_18",统计_速死_18) 1100 | print("统计_速死_19",统计_速死_19) 1101 | print("统计_死亡_20",统计_死亡_20) 1102 | print("统计_死亡_21",统计_死亡_21) 1103 | print("统计_速死_21",统计_速死_21) 1104 | print("统计_死亡_22",统计_死亡_22) 1105 | print("统计_速死_23",统计_速死_23) 1106 | print("统计_死亡_23",统计_死亡_23) 1107 | print("统计_死亡_w",统计_死亡_w) 1108 | print("统计_阶段_w",统计_阶段_w) 1109 | print("统计_流未死",统计_流未死) 1110 | print("统计_盾未死",统计_盾未死) 1111 | print("TODO T1",TODO_T1) 1112 | print("TODO T2",TODO_T2) 1113 | print("TODO T3",TODO_T3) 1114 | print("TODO T4",TODO_T4) 1115 | print("DONE",DONE) 1116 | 1117 | endTime := time.Now().Unix() 1118 | 1119 | print("共耗时:",endTime - startTime,"秒") 1120 | } 1121 | 1122 | } 1123 | 1124 | func run_range (min,max int32){ 1125 | if min == max { 1126 | <-process 1127 | wait <- true 1128 | return 1129 | } 1130 | 1131 | for t := min ; ; t ++ { 1132 | run(t) 1133 | 1134 | if t == max { 1135 | break 1136 | } 1137 | } 1138 | 1139 | if log { 1140 | //if min % 10000000 == 0 { 1141 | print("complete",min,"->",max) 1142 | //} 1143 | } 1144 | 1145 | <-process 1146 | wait <- true 1147 | } 1148 | func run(seed int32){ 1149 | var rand Random 1150 | rand.init(seed) 1151 | 1152 | var hp [31]int 1153 | copy(hp[:],max_hp[:]) 1154 | 1155 | // 阶段 1 1156 | // 1 - 6 狗 狗 狗 狗 狗 狗 1157 | // 三帧索敌的不影响次序 1158 | atomic.AddInt32(&统计_阶段_1, 1) 1159 | for enemy := 1 ; enemy <= 6 ; enemy ++ { 1160 | for hp[enemy] > 0 { 1161 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1162 | } 1163 | } 1164 | 1165 | // 阶段 2 1166 | // 7 - 10 双 狗 狗 狗 1167 | // 三帧索敌的不影响次序 1168 | for i := 0 ; i < len(阶段_2) ; i ++ { 1169 | for j := 0 ; j < 3 ; j ++ { 1170 | enemy := 阶段_2[i][j] 1171 | if hp[enemy] > 0 { 1172 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1173 | break 1174 | } 1175 | } 1176 | } 1177 | 1178 | // 阶段 3 1179 | // 11 - 13 双 狗 盾 1180 | // 三帧索敌的不影响次序 1181 | // 7次攻击以内打死 8狗 且 14次攻击未打死 10 狗 1182 | // 15次攻击打死 10 狗 1183 | // 15次攻击未打死 10 狗 , 不会出现 1184 | atomic.AddInt32(&统计_阶段_3, 1) 1185 | for i := 0 ; i < len(阶段_3) ; i ++ { 1186 | for j := 0 ; j < 3 ; j ++ { 1187 | enemy := 阶段_3[i][j] 1188 | if hp[enemy] > 0 { 1189 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1190 | break 1191 | } 1192 | } 1193 | } 1194 | 1195 | if hp[13] > 0 { 1196 | atomic.AddInt32(&统计_死亡_13, 1) 1197 | return 1198 | } 1199 | 1200 | // 阶段 4 1201 | // 14 - 17 投 狗 双 狗 1202 | atomic.AddInt32(&统计_阶段_4, 1) 1203 | 阶段_4_攻击次数 := 0 1204 | 1205 | for i := 0 ; i < len(阶段_4) ; i ++ { 1206 | select_enemy := -1 1207 | for j := 0 ; j < 3 ; j ++ { 1208 | enemy := 阶段_4[i][j] 1209 | if hp[enemy] > 0 { 1210 | // if enemy == 14 { 1211 | // print(enemy,i,hp[enemy],rand.seed) 1212 | // } 1213 | 阶段_4_攻击次数 = i + 1 1214 | select_enemy = enemy 1215 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1216 | break 1217 | } 1218 | } 1219 | if select_enemy == -1 && 阶段_4_攻击次数 >= 10 { 1220 | // 16及之前怪速死仅影响三帧索敌,对次序无影响 1221 | // >= 10 用于合并情况 1222 | break 1223 | } 1224 | } 1225 | 1226 | // 阶段 5 1227 | // S 18 狗 19 双 20 狗 21 双 1228 | // M 22 双 23 投 24 双 1229 | // L 25 W 26 双 27 狗 28 盾 29 流 30 投 1230 | if 阶段_4_攻击次数 < 15 { 1231 | // 如果四阶段14下及以内解决,状况1 1232 | 1233 | atomic.AddInt32(&统计_阶段_5_1, 1) 1234 | 1235 | // S 18 狗 19 双 20 狗 21 双 1236 | for i := 0 ; i < len(阶段_5_1_S) ; i ++ { 1237 | select_enemy := -1 1238 | for j := 0 ; j < 3 ; j ++ { 1239 | enemy := 阶段_5_1_S[i][j] 1240 | if hp[enemy] > 0 { 1241 | select_enemy = enemy 1242 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1243 | break 1244 | } 1245 | } 1246 | if select_enemy == -1 { 1247 | // 快速死亡判断 1248 | if i == 1 { 1249 | atomic.AddInt32(&统计_速死_18, 1) 1250 | run_dead_18(rand,hp) 1251 | return 1252 | } 1253 | if i == 5 { 1254 | // 根据三帧索敌,有一种情况有可能会出现19速死,其他两种可能性不会出现这种情况 1255 | atomic.AddInt32(&统计_速死_19, 1) 1256 | // 特殊判断三帧索敌中的一种情况 1257 | // run_dead_19(rand,hp) 1258 | atomic.AddInt32(&TODO_T3, 1) 1259 | // 其他两种情况攻击20,可不影响 1260 | hp[20] = hp[20] - rand.attack(def[20],hp[20]) 1261 | } 1262 | if i > 9 { 1263 | run_dead_21(rand,hp) 1264 | return 1265 | } 1266 | 1267 | } 1268 | } 1269 | 1270 | if hp[20] > 0 { 1271 | atomic.AddInt32(&统计_死亡_20, 1) 1272 | return 1273 | } 1274 | 1275 | run_part_5_1(rand,hp) 1276 | }else{ 1277 | // 如果四阶段17下解决,状况2 1278 | 1279 | atomic.AddInt32(&统计_阶段_5_2, 1) 1280 | 1281 | if hp[19] != max_hp[19] { 1282 | // 如果第16次攻击打死 18 狗 1283 | // 根据三帧索敌,会空闲3帧,原三帧索敌的三种情况变四种 1284 | // 只有最早寻敌的一帧可能会变晚 1285 | 1286 | // 直接跟5_1_18速死轴合并 1287 | atomic.AddInt32(&统计_速死_18, 1) 1288 | //run_dead_18(rand,hp) 1289 | atomic.AddInt32(&TODO_T3, 1) 1290 | //return 1291 | } 1292 | 1293 | for i := 0 ; i < len(阶段_5_2_S) ; i ++ { 1294 | select_enemy := -1 1295 | for j := 0 ; j < len(阶段_5_2_S[i]) ; j ++ { 1296 | enemy := 阶段_5_2_S[i][j] 1297 | if hp[enemy] > 0 { 1298 | select_enemy = enemy 1299 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1300 | break 1301 | } 1302 | } 1303 | if select_enemy == -1 { 1304 | run_dead_21(rand,hp) 1305 | return 1306 | } 1307 | } 1308 | if hp[18] > 0 { 1309 | atomic.AddInt32(&统计_死亡_18, 1) 1310 | return 1311 | } 1312 | if hp[20] > 0 { 1313 | atomic.AddInt32(&统计_死亡_20, 1) 1314 | return 1315 | } 1316 | 1317 | run_part_5_2(rand,hp) 1318 | } 1319 | } 1320 | func run_dead_18(rand Random, hp [31]int){ 1321 | // 进入条件 1322 | // 18速死 1323 | // 可能跟5-2可混轴 1324 | 1325 | if hp[19] == max_hp[19] { 1326 | // 来自5-1 1327 | hp[19] = hp[19] - rand.attack(def[19],hp[19]) 1328 | } 1329 | 1330 | for i := 0 ; i < len(阶段_5_2_S) ; i ++ { 1331 | select_enemy := -1 1332 | for j := 0 ; j < len(阶段_5_2_S[i]) ; j ++ { 1333 | enemy := 阶段_5_2_S[i][j] 1334 | if hp[enemy] > 0 { 1335 | select_enemy = enemy 1336 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1337 | break 1338 | } 1339 | } 1340 | if select_enemy == -1 { 1341 | run_dead_21(rand,hp) 1342 | return 1343 | } 1344 | } 1345 | if hp[18] > 0 { 1346 | atomic.AddInt32(&统计_死亡_18, 1) 1347 | return 1348 | } 1349 | if hp[20] > 0 { 1350 | atomic.AddInt32(&统计_死亡_20, 1) 1351 | return 1352 | } 1353 | 1354 | run_part_5_2(rand,hp) 1355 | } 1356 | func run_dead_19(rand Random, hp [31]int){ 1357 | // 进入条件 1358 | // 19速死 1359 | 1360 | // 只有三帧索敌的这一种情况 1361 | // 可能跟5-1可混轴 1362 | 1363 | atomic.AddInt32(&TODO_T3, 1) 1364 | } 1365 | func run_dead_21(rand Random, hp [31]int){ 1366 | // 进入条件 1367 | // 21速死 1368 | 1369 | if hp[20] > 0 { 1370 | atomic.AddInt32(&统计_死亡_20, 1) 1371 | return 1372 | } 1373 | 1374 | atomic.AddInt32(&统计_速死_21, 1) 1375 | 1376 | run_dead_21_w_不变(rand,hp) 1377 | run_dead_21_双持_不变(rand,hp) 1378 | run_dead_21_燃烧_不变(rand,hp) 1379 | run_dead_21_w_变(rand,hp) 1380 | run_dead_21_双持_变(rand,hp) 1381 | run_dead_21_燃烧_变(rand,hp) 1382 | } 1383 | 1384 | // 44990697 1385 | func run_dead_21_w_不变(rand Random, hp [31]int){ 1386 | for i := 0 ; i < 6 ; i ++ { 1387 | for j := 0 ; j < len(阶段_5_21速死_w_不变[i]) ; j ++ { 1388 | enemy := 阶段_5_21速死_w_不变[i][j] 1389 | if hp[enemy] > 0 { 1390 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1391 | break 1392 | } 1393 | } 1394 | } 1395 | 1396 | if hp[22] > 0 { 1397 | atomic.AddInt32(&统计_死亡_22, 1) 1398 | return 1399 | } 1400 | if hp[23] > 1000 { 1401 | atomic.AddInt32(&统计_死亡_23, 1) 1402 | return 1403 | } 1404 | 1405 | atomic.AddInt32(&统计_阶段_w, 1) 1406 | 1407 | hp[23] = hp[23] - 1000 1408 | hp[24] = hp[24] - 1000 1409 | hp[25] = hp[25] - 500 1410 | 1411 | for i := 6 ; i < len(阶段_5_21速死_w_不变) ; i ++ { 1412 | for j := 0 ; j < len(阶段_5_21速死_w_不变[i]) ; j ++ { 1413 | enemy := 阶段_5_21速死_w_不变[i][j] 1414 | if hp[enemy] > 0 { 1415 | damage := rand.attack(def[enemy],hp[enemy]) 1416 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 1417 | hp[enemy] = hp[enemy] - damage 1418 | break 1419 | } 1420 | } 1421 | } 1422 | 1423 | stat(&rand,&hp) 1424 | 1425 | for i := 24 ; i <= 30 ; i ++ { 1426 | if hp[i] > 0 { 1427 | return 1428 | } 1429 | } 1430 | 1431 | atomic.AddInt32(&DONE, 1) 1432 | print("done",runFuncName(),rand.seed) 1433 | } 1434 | 1435 | func run_part_5_1(rand Random, hp [31]int){ 1436 | atomic.AddInt32(&统计_阶段_5_1_分支, 1) 1437 | 1438 | run_part_5_1_双持_不变(rand,hp) 1439 | run_part_5_1_燃烧_不变(rand,hp) 1440 | run_part_5_1_w_不变(rand,hp) 1441 | 1442 | run_part_5_1_双持_变(rand,hp) 1443 | run_part_5_1_燃烧_变(rand,hp) 1444 | run_part_5_1_w_变(rand,hp) 1445 | } 1446 | 1447 | func run_part_5_1_双持_不变(rand Random, hp [31]int){ 1448 | // M 22 双 23 投 24 双 1449 | 1450 | for i := 0 ; i < 4 ; i ++ { 1451 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1452 | enemy := 阶段_5_1_双持_不变[i][j] 1453 | if hp[enemy] > 0 { 1454 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1455 | break 1456 | } 1457 | } 1458 | } 1459 | 1460 | hp[21] = hp[21] - 1000 1461 | hp[22] = hp[22] - 1000 1462 | hp[23] = hp[23] - 1000 1463 | hp[24] = hp[24] - 1000 1464 | 1465 | for i := 4 ; i < 5 ; i ++ { 1466 | select_enemy := -1 1467 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1468 | enemy := 阶段_5_1_双持_不变[i][j] 1469 | if hp[enemy] > 0 { 1470 | select_enemy = enemy 1471 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1472 | break 1473 | } 1474 | } 1475 | if select_enemy == -1 { 1476 | // 没有这种情况 1477 | atomic.AddInt32(&TODO_T4, 1) 1478 | } 1479 | } 1480 | 1481 | if hp[23] > 0 { 1482 | atomic.AddInt32(&统计_死亡_23, 1) 1483 | return 1484 | } 1485 | 1486 | atomic.AddInt32(&统计_阶段_w, 1) 1487 | 1488 | for i := 5 ; i < len(阶段_5_1_双持_不变) ; i ++ { 1489 | for j := 0 ; j < len(阶段_5_1_双持_不变[i]) ; j ++ { 1490 | enemy := 阶段_5_1_双持_不变[i][j] 1491 | if hp[enemy] > 0 { 1492 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1493 | break 1494 | } 1495 | } 1496 | } 1497 | 1498 | stat(&rand,&hp) 1499 | 1500 | for i := 21 ; i <= 30 ; i ++ { 1501 | if hp[i] > 0 { 1502 | return 1503 | } 1504 | } 1505 | 1506 | atomic.AddInt32(&DONE, 1) 1507 | print("done",runFuncName(),rand.seed) 1508 | } 1509 | func run_part_5_1_燃烧_不变(rand Random, hp [31]int){ 1510 | // M 22 双 23 投 24 双 1511 | 1512 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[0]) ; j ++ { 1513 | enemy := 阶段_5_1_燃烧_不变[0][j] 1514 | if hp[enemy] > 0 { 1515 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1516 | break 1517 | } 1518 | } 1519 | 1520 | hp[21] = hp[21] - 1000 1521 | hp[22] = hp[22] - 1000 1522 | hp[23] = hp[23] - 1000 1523 | 1524 | for i := 1 ; i < 5 ; i ++ { 1525 | select_enemy := -1 1526 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[i]) ; j ++ { 1527 | enemy := 阶段_5_1_燃烧_不变[i][j] 1528 | if hp[enemy] > 0 { 1529 | select_enemy = enemy 1530 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1531 | break 1532 | } 1533 | } 1534 | if select_enemy == -1 { 1535 | // 没有这种情况 1536 | atomic.AddInt32(&TODO_T4, 1) 1537 | } 1538 | } 1539 | 1540 | if hp[23] > 0 { 1541 | atomic.AddInt32(&统计_死亡_23, 1) 1542 | return 1543 | } 1544 | 1545 | atomic.AddInt32(&统计_阶段_w, 1) 1546 | 1547 | for i := 5 ; i < len(阶段_5_1_燃烧_不变) ; i ++ { 1548 | for j := 0 ; j < len(阶段_5_1_燃烧_不变[i]) ; j ++ { 1549 | if i == 32 { 1550 | // 只吃一个暴击的情况 1551 | // rand.NextDouble() 1552 | } 1553 | enemy := 阶段_5_1_燃烧_不变[i][j] 1554 | if hp[enemy] > 0 { 1555 | damage := rand.attack(def[enemy],hp[enemy]) 1556 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 1557 | hp[enemy] = hp[enemy] - damage 1558 | break 1559 | } 1560 | } 1561 | } 1562 | 1563 | stat(&rand,&hp) 1564 | 1565 | for i := 21 ; i <= 30 ; i ++ { 1566 | if hp[i] > 0 { 1567 | return 1568 | } 1569 | } 1570 | 1571 | atomic.AddInt32(&DONE, 1) 1572 | print("done",runFuncName(),rand.seed) 1573 | } 1574 | 1575 | func run_part_5_1_w_不变(rand Random, hp [31]int){ 1576 | // M 22 双 23 投 24 双 1577 | for i := 0 ; i < len(阶段_5_1_M) ; i ++ { 1578 | for j := 0 ; j < 4 ; j ++ { 1579 | enemy := 阶段_5_1_M[i][j] 1580 | if hp[enemy] > 0 { 1581 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1582 | break 1583 | } 1584 | } 1585 | } 1586 | if hp[21] > 0 { 1587 | atomic.AddInt32(&统计_死亡_21, 1) 1588 | return 1589 | } 1590 | if hp[22] > 0 { 1591 | atomic.AddInt32(&统计_死亡_22, 1) 1592 | return 1593 | } 1594 | if hp[23] > 1000 { 1595 | atomic.AddInt32(&统计_死亡_23, 1) 1596 | return 1597 | } 1598 | 1599 | hp[23] = hp[23] - 1000 1600 | hp[24] = hp[24] - 1000 1601 | hp[25] = hp[25] - 500 1602 | 1603 | atomic.AddInt32(&统计_阶段_w, 1) 1604 | 1605 | for i := 0 ; i < len(阶段_5_1_w_不变) ; i ++ { 1606 | for j := 0 ; j < len(阶段_5_1_w_不变[i]) ; j ++ { 1607 | enemy := 阶段_5_1_w_不变[i][j] 1608 | if hp[enemy] > 0 { 1609 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1610 | break 1611 | } 1612 | } 1613 | } 1614 | 1615 | stat(&rand,&hp) 1616 | 1617 | for i := 24 ; i <= 30 ; i ++ { 1618 | if hp[i] > 0 { 1619 | return 1620 | } 1621 | } 1622 | 1623 | atomic.AddInt32(&DONE, 1) 1624 | print("done",runFuncName(),rand.seed) 1625 | } 1626 | 1627 | func run_part_5_1_双持_变(rand Random, hp [31]int){ 1628 | // 0 - 3 1629 | for i := 0 ; i <= 3 ; i ++ { 1630 | for j := 0 ; j < 3 ; j ++ { 1631 | enemy := 阶段_5_1_双持_不变[i][j] 1632 | if hp[enemy] > 0 { 1633 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1634 | break 1635 | } 1636 | } 1637 | } 1638 | 1639 | if hp[22] > 0 { 1640 | atomic.AddInt32(&统计_死亡_22, 1) 1641 | return 1642 | } 1643 | if hp[23] > 1000 { 1644 | atomic.AddInt32(&统计_死亡_23, 1) 1645 | return 1646 | } 1647 | 1648 | hp[23] = hp[23] - 1000 1649 | hp[24] = hp[24] - 1000 1650 | 1651 | atomic.AddInt32(&统计_阶段_w, 1) 1652 | 1653 | for i := 0 ; i < len(阶段_5_1_双持_变) ; i ++ { 1654 | for j := 0 ; j < len(阶段_5_1_双持_变[i]) ; j ++ { 1655 | enemy := 阶段_5_1_双持_变[i][j] 1656 | if hp[enemy] > 0 { 1657 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1658 | break 1659 | } 1660 | } 1661 | } 1662 | 1663 | stat(&rand,&hp) 1664 | 1665 | for i := 24 ; i <= 30 ; i ++ { 1666 | if hp[i] > 0 { 1667 | return 1668 | } 1669 | } 1670 | 1671 | atomic.AddInt32(&DONE, 1) 1672 | print("done",runFuncName(),rand.seed) 1673 | 1674 | } 1675 | func run_part_5_1_燃烧_变(rand Random, hp [31]int){ 1676 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1677 | if hp[22] < 1000 { 1678 | run_part_5_1_燃烧_变_22(rand,hp,2) 1679 | } 1680 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1681 | if hp[22] <= 0 { 1682 | return 1683 | } 1684 | if hp[22] < 1000 { 1685 | run_part_5_1_燃烧_变_22(rand,hp,1) 1686 | } 1687 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 1688 | if hp[22] <= 0 { 1689 | return 1690 | } 1691 | if hp[22] < 1000 { 1692 | run_part_5_1_燃烧_变_22(rand,hp,0) 1693 | } 1694 | } 1695 | 1696 | func run_part_5_1_燃烧_变_22(rand Random, hp [31]int, times int){ 1697 | hp[22] = hp[22] - 1000 1698 | hp[23] = hp[23] - 1000 1699 | for i := 1 ; i <= times ; i ++ { 1700 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 1701 | } 1702 | if hp[23] > 0 { 1703 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 1704 | }else{ 1705 | hp[24] = hp[24] - rand.attack(def[24],hp[24]) 1706 | } 1707 | if hp[23] > 0{ 1708 | atomic.AddInt32(&统计_死亡_23, 1) 1709 | return 1710 | } 1711 | 1712 | atomic.AddInt32(&统计_阶段_w, 1) 1713 | 1714 | for i := 0 ; i < len(阶段_5_1_燃烧_变) ; i ++ { 1715 | for j := 0 ; j < len(阶段_5_1_燃烧_变[i]) ; j ++ { 1716 | enemy := 阶段_5_1_燃烧_变[i][j] 1717 | if hp[enemy] > 0 { 1718 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1719 | break 1720 | } 1721 | } 1722 | } 1723 | 1724 | stat(&rand,&hp) 1725 | 1726 | for i := 24 ; i <= 30 ; i ++ { 1727 | if hp[i] > 0 { 1728 | return 1729 | } 1730 | } 1731 | 1732 | atomic.AddInt32(&DONE, 1) 1733 | print("done",runFuncName(),rand.seed) 1734 | } 1735 | 1736 | func run_part_5_1_w_变(rand Random, hp [31]int){ 1737 | // M 22 双 23 投 24 双 1738 | for i := 0 ; i < len(阶段_5_1_M) ; i ++ { 1739 | for j := 0 ; j < 4 ; j ++ { 1740 | enemy := 阶段_5_1_M[i][j] 1741 | if hp[enemy] > 0 { 1742 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1743 | break 1744 | } 1745 | } 1746 | } 1747 | if hp[21] > 0 { 1748 | atomic.AddInt32(&统计_死亡_21, 1) 1749 | return 1750 | } 1751 | if hp[22] > 0 { 1752 | atomic.AddInt32(&统计_死亡_22, 1) 1753 | return 1754 | } 1755 | if hp[23] > 1000 { 1756 | atomic.AddInt32(&统计_死亡_23, 1) 1757 | return 1758 | } 1759 | 1760 | hp[23] = hp[23] - 1000 1761 | hp[24] = hp[24] - 1000 1762 | hp[25] = hp[25] - 500 1763 | 1764 | atomic.AddInt32(&统计_阶段_w, 1) 1765 | 1766 | for i := 0 ; i < len(阶段_5_1_w_变) ; i ++ { 1767 | for j := 0 ; j < len(阶段_5_1_w_变[i]) ; j ++ { 1768 | enemy := 阶段_5_1_w_变[i][j] 1769 | if hp[enemy] > 0 { 1770 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1771 | break 1772 | } 1773 | } 1774 | } 1775 | 1776 | stat(&rand,&hp) 1777 | 1778 | for i := 24 ; i <= 30 ; i ++ { 1779 | if hp[i] > 0 { 1780 | return 1781 | } 1782 | } 1783 | 1784 | atomic.AddInt32(&DONE, 1) 1785 | print("done",runFuncName(),rand.seed) 1786 | } 1787 | 1788 | func run_part_5_2(rand Random, hp [31]int){ 1789 | atomic.AddInt32(&统计_阶段_5_2_分支, 1) 1790 | run_part_5_2_双持_不变(rand,hp) 1791 | run_part_5_2_燃烧_不变(rand,hp) 1792 | run_part_5_2_w_不变(rand,hp) 1793 | 1794 | run_part_5_2_双持_变(rand,hp) 1795 | run_part_5_2_燃烧_变(rand,hp) 1796 | run_part_5_2_w_变(rand,hp) 1797 | } 1798 | 1799 | func run_part_5_2_w_不变(rand Random, hp [31]int){ 1800 | // M 22 双 23 投 24 双 1801 | for i := 0 ; i < len(阶段_5_2_M) ; i ++ { 1802 | for j := 0 ; j < len(阶段_5_2_M[i]) ; j ++ { 1803 | enemy := 阶段_5_2_M[i][j] 1804 | if hp[enemy] > 0 { 1805 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1806 | break 1807 | } 1808 | } 1809 | } 1810 | if hp[21] > 0 { 1811 | atomic.AddInt32(&统计_死亡_21, 1) 1812 | return 1813 | } 1814 | if hp[22] > 0 { 1815 | atomic.AddInt32(&统计_死亡_22, 1) 1816 | return 1817 | } 1818 | if hp[23] > 1000 { 1819 | atomic.AddInt32(&统计_死亡_23, 1) 1820 | return 1821 | } 1822 | 1823 | hp[23] = hp[23] - 1000 1824 | hp[24] = hp[24] - 1000 1825 | hp[25] = hp[25] - 500 1826 | 1827 | atomic.AddInt32(&统计_阶段_w, 1) 1828 | 1829 | for i := 0 ; i < len(阶段_5_2_w_不变) ; i ++ { 1830 | for j := 0 ; j < len(阶段_5_2_w_不变[i]) ; j ++ { 1831 | enemy := 阶段_5_2_w_不变[i][j] 1832 | if hp[enemy] > 0 { 1833 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1834 | break 1835 | } 1836 | } 1837 | } 1838 | 1839 | stat(&rand,&hp) 1840 | 1841 | for i := 24 ; i <= 30 ; i ++ { 1842 | if hp[i] > 0 { 1843 | return 1844 | } 1845 | } 1846 | 1847 | atomic.AddInt32(&DONE, 1) 1848 | print("done",runFuncName(),rand.seed) 1849 | } 1850 | 1851 | func run_part_5_2_双持_不变(rand Random, hp [31]int){ 1852 | // M 22 双 23 投 24 双 1853 | 1854 | for i := 0 ; i < 3 ; i ++ { 1855 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1856 | enemy := 阶段_5_2_双持_不变[i][j] 1857 | if hp[enemy] > 0 { 1858 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1859 | break 1860 | } 1861 | } 1862 | } 1863 | 1864 | hp[21] = hp[21] - 1000 1865 | hp[22] = hp[22] - 1000 1866 | hp[23] = hp[23] - 1000 1867 | hp[24] = hp[24] - 1000 1868 | 1869 | for i := 3 ; i < 5 ; i ++ { 1870 | select_enemy := -1 1871 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1872 | enemy := 阶段_5_2_双持_不变[i][j] 1873 | if hp[enemy] > 0 { 1874 | select_enemy = enemy 1875 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1876 | break 1877 | } 1878 | } 1879 | if select_enemy == -1 { 1880 | // 没有这种情况 1881 | atomic.AddInt32(&TODO_T4, 1) 1882 | } 1883 | } 1884 | 1885 | if hp[23] > 0 { 1886 | atomic.AddInt32(&统计_死亡_23, 1) 1887 | return 1888 | } 1889 | 1890 | atomic.AddInt32(&统计_阶段_w, 1) 1891 | 1892 | for i := 5 ; i < len(阶段_5_2_双持_不变) ; i ++ { 1893 | for j := 0 ; j < len(阶段_5_2_双持_不变[i]) ; j ++ { 1894 | enemy := 阶段_5_2_双持_不变[i][j] 1895 | if hp[enemy] > 0 { 1896 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1897 | break 1898 | } 1899 | } 1900 | } 1901 | 1902 | stat(&rand,&hp) 1903 | 1904 | for i := 21 ; i <= 30 ; i ++ { 1905 | if hp[i] > 0 { 1906 | return 1907 | } 1908 | } 1909 | 1910 | atomic.AddInt32(&DONE, 1) 1911 | print("done",runFuncName(),rand.seed) 1912 | } 1913 | func run_part_5_2_燃烧_不变(rand Random, hp [31]int){ 1914 | // M 22 双 23 投 24 双 1915 | 1916 | hp[21] = hp[21] - 1000 1917 | hp[22] = hp[22] - 1000 1918 | hp[23] = hp[23] - 1000 1919 | 1920 | for i := 0 ; i < 5 ; i ++ { 1921 | select_enemy := -1 1922 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 1923 | enemy := 阶段_5_2_燃烧_不变[i][j] 1924 | if hp[enemy] > 0 { 1925 | select_enemy = enemy 1926 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1927 | break 1928 | } 1929 | } 1930 | if select_enemy == -1 { 1931 | // 没有这种情况 1932 | atomic.AddInt32(&TODO_T4, 1) 1933 | } 1934 | } 1935 | 1936 | if hp[23] > 0 { 1937 | atomic.AddInt32(&统计_死亡_23, 1) 1938 | return 1939 | } 1940 | 1941 | atomic.AddInt32(&统计_阶段_w, 1) 1942 | 1943 | for i := 5 ; i < len(阶段_5_2_燃烧_不变) ; i ++ { 1944 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 1945 | enemy := 阶段_5_2_燃烧_不变[i][j] 1946 | if hp[enemy] > 0 { 1947 | damage := rand.attack(def[enemy],hp[enemy]) 1948 | //print(enemy,damage,hp[enemy],hp[enemy]-damage) 1949 | hp[enemy] = hp[enemy] - damage 1950 | break 1951 | } 1952 | } 1953 | } 1954 | 1955 | stat(&rand,&hp) 1956 | 1957 | for i := 21 ; i <= 30 ; i ++ { 1958 | if hp[i] > 0 { 1959 | return 1960 | } 1961 | } 1962 | 1963 | atomic.AddInt32(&DONE, 1) 1964 | print("done",runFuncName(),rand.seed) 1965 | } 1966 | 1967 | func run_part_5_2_双持_变(rand Random, hp [31]int){ 1968 | // 查无此轴 1969 | return 1970 | } 1971 | func run_part_5_2_燃烧_变(rand Random, hp [31]int){ 1972 | for i := 0 ; i <= 2 ; i ++ { 1973 | for j := 0 ; j < len(阶段_5_2_燃烧_不变[i]) ; j ++ { 1974 | enemy := 阶段_5_2_燃烧_不变[i][j] 1975 | if hp[enemy] > 0 { 1976 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 1977 | break 1978 | } 1979 | } 1980 | if hp[22] <= 0 { 1981 | return 1982 | } 1983 | if hp[22] <= 1000 { 1984 | run_part_5_2_燃烧_变_22(rand,hp,2 - i) 1985 | } 1986 | } 1987 | } 1988 | 1989 | func run_part_5_2_燃烧_变_22(rand Random, hp [31]int, times int){ 1990 | 1991 | hp[21] = hp[21] - 1000 1992 | hp[22] = hp[22] - 1000 1993 | hp[23] = hp[23] - 1000 1994 | 1995 | for i := 0 ; i < times ; i ++ { 1996 | hp[23] = hp[23] - rand.attack(def[23],hp[23]) 1997 | } 1998 | if hp[23] > 0 { 1999 | atomic.AddInt32(&统计_死亡_23, 1) 2000 | return 2001 | } 2002 | 2003 | atomic.AddInt32(&统计_阶段_w, 1) 2004 | 2005 | for i := 0 ; i < len(阶段_5_2_燃烧_变) ; i ++ { 2006 | for j := 0 ; j < len(阶段_5_2_燃烧_变[i]) ; j ++ { 2007 | enemy := 阶段_5_2_燃烧_变[i][j] 2008 | if hp[enemy] > 0 { 2009 | damage := rand.attack(def[enemy],hp[enemy]) 2010 | //print(enemy,damage,hp[enemy],hp[enemy]-damage) 2011 | hp[enemy] = hp[enemy] - damage 2012 | break 2013 | } 2014 | } 2015 | } 2016 | 2017 | stat(&rand,&hp) 2018 | 2019 | for i := 21 ; i <= 30 ; i ++ { 2020 | if hp[i] > 0 { 2021 | return 2022 | } 2023 | } 2024 | 2025 | atomic.AddInt32(&DONE, 1) 2026 | print("done",runFuncName(),rand.seed) 2027 | } 2028 | 2029 | func run_part_5_2_w_变(rand Random, hp [31]int){ 2030 | // M 22 双 23 投 24 双 2031 | for i := 0 ; i < len(阶段_5_2_M) ; i ++ { 2032 | for j := 0 ; j < len(阶段_5_2_M[i]) ; j ++ { 2033 | enemy := 阶段_5_2_M[i][j] 2034 | if hp[enemy] > 0 { 2035 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2036 | break 2037 | } 2038 | } 2039 | } 2040 | if hp[21] > 0 { 2041 | atomic.AddInt32(&统计_死亡_21, 1) 2042 | return 2043 | } 2044 | if hp[22] > 0 { 2045 | atomic.AddInt32(&统计_死亡_22, 1) 2046 | return 2047 | } 2048 | if hp[23] > 1000 { 2049 | atomic.AddInt32(&统计_死亡_23, 1) 2050 | return 2051 | } 2052 | 2053 | hp[23] = hp[23] - 1000 2054 | hp[24] = hp[24] - 1000 2055 | hp[25] = hp[25] - 500 2056 | 2057 | atomic.AddInt32(&统计_阶段_w, 1) 2058 | 2059 | for i := 0 ; i < len(阶段_5_2_w_变) ; i ++ { 2060 | for j := 0 ; j < len(阶段_5_2_w_变[i]) ; j ++ { 2061 | enemy := 阶段_5_2_w_变[i][j] 2062 | if hp[enemy] > 0 { 2063 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2064 | break 2065 | } 2066 | } 2067 | } 2068 | 2069 | stat(&rand,&hp) 2070 | 2071 | for i := 21 ; i <= 30 ; i ++ { 2072 | if hp[i] > 0 { 2073 | return 2074 | } 2075 | } 2076 | 2077 | atomic.AddInt32(&DONE, 1) 2078 | print("done",runFuncName(),rand.seed) 2079 | } 2080 | 2081 | func run_dead_21_双持_不变(rand Random, hp [31]int){ 2082 | // M 22 双 23 投 24 双 2083 | for i := 0 ; i < 4 ; i ++ { 2084 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2085 | enemy := 阶段_5_21速死_双持_不变[i][j] 2086 | if hp[enemy] > 0 { 2087 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2088 | break 2089 | } 2090 | } 2091 | } 2092 | 2093 | hp[22] = hp[22] - 1000 2094 | hp[23] = hp[23] - 1000 2095 | hp[24] = hp[24] - 1000 2096 | 2097 | for i := 4 ; i < 6 ; i ++ { 2098 | select_enemy := -1 2099 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2100 | enemy := 阶段_5_21速死_双持_不变[i][j] 2101 | if hp[enemy] > 0 { 2102 | select_enemy = enemy 2103 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2104 | break 2105 | } 2106 | } 2107 | if select_enemy == -1 { 2108 | // 没有这种情况 2109 | atomic.AddInt32(&TODO_T4, 1) 2110 | } 2111 | } 2112 | 2113 | if hp[23] > 0 { 2114 | atomic.AddInt32(&统计_死亡_23, 1) 2115 | return 2116 | } 2117 | 2118 | atomic.AddInt32(&统计_阶段_w, 1) 2119 | 2120 | for i := 6 ; i < len(阶段_5_21速死_双持_不变) ; i ++ { 2121 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2122 | enemy := 阶段_5_21速死_双持_不变[i][j] 2123 | if hp[enemy] > 0 { 2124 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2125 | break 2126 | } 2127 | } 2128 | } 2129 | 2130 | stat(&rand,&hp) 2131 | 2132 | for i := 21 ; i <= 30 ; i ++ { 2133 | if hp[i] > 0 { 2134 | return 2135 | } 2136 | } 2137 | 2138 | atomic.AddInt32(&DONE, 1) 2139 | print("done",runFuncName(),rand.seed) 2140 | } 2141 | func run_dead_21_燃烧_不变(rand Random, hp [31]int){ 2142 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2143 | 2144 | // M 22 双 23 投 24 双 2145 | 2146 | hp[22] = hp[22] - 1000 2147 | hp[23] = hp[23] - 1000 2148 | 2149 | for i := 1 ; i < 6 ; i ++ { 2150 | select_enemy := -1 2151 | for j := 0 ; j < len(阶段_5_21速死_燃烧_不变[i]) ; j ++ { 2152 | enemy := 阶段_5_21速死_燃烧_不变[i][j] 2153 | if hp[enemy] > 0 { 2154 | select_enemy = enemy 2155 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2156 | break 2157 | } 2158 | } 2159 | if select_enemy == -1 { 2160 | // 22 23 早死 2161 | run_dead_23(rand,hp) 2162 | return 2163 | } 2164 | } 2165 | 2166 | if hp[23] > 0 { 2167 | atomic.AddInt32(&统计_死亡_23, 1) 2168 | return 2169 | } 2170 | 2171 | atomic.AddInt32(&统计_阶段_w, 1) 2172 | 2173 | for i := 6 ; i < len(阶段_5_21速死_燃烧_不变) ; i ++ { 2174 | for j := 0 ; j < len(阶段_5_21速死_燃烧_不变[i]) ; j ++ { 2175 | enemy := 阶段_5_21速死_燃烧_不变[i][j] 2176 | if hp[enemy] > 0 { 2177 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2178 | break 2179 | } 2180 | } 2181 | } 2182 | 2183 | stat(&rand,&hp) 2184 | 2185 | for i := 21 ; i <= 30 ; i ++ { 2186 | if hp[i] > 0 { 2187 | return 2188 | } 2189 | } 2190 | 2191 | atomic.AddInt32(&DONE, 1) 2192 | print("done",runFuncName(),rand.seed) 2193 | } 2194 | 2195 | func run_dead_21_双持_变(rand Random, hp [31]int){ 2196 | 2197 | for i := 0 ; i < 4 ; i ++ { 2198 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[i]) ; j ++ { 2199 | enemy := 阶段_5_21速死_双持_不变[i][j] 2200 | if hp[enemy] > 0 { 2201 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2202 | break 2203 | } 2204 | } 2205 | } 2206 | 2207 | if hp[23] <= 1000 { 2208 | run_dead_21_双持_变_22(rand,hp,1) 2209 | } 2210 | 2211 | for j := 0 ; j < len(阶段_5_21速死_双持_不变[4]) ; j ++ { 2212 | enemy := 阶段_5_21速死_双持_不变[4][j] 2213 | if hp[enemy] > 0 { 2214 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2215 | break 2216 | } 2217 | } 2218 | 2219 | if hp[23] <= 1000 { 2220 | run_dead_21_双持_变_22(rand,hp,0) 2221 | } 2222 | 2223 | } 2224 | 2225 | func run_dead_21_双持_变_22(rand Random, hp [31]int,times int){ 2226 | hp[21] = hp[21] - 1000 2227 | hp[22] = hp[22] - 1000 2228 | hp[23] = hp[23] - 1000 2229 | hp[24] = hp[24] - 1000 2230 | 2231 | atomic.AddInt32(&统计_阶段_w, 1) 2232 | 2233 | for i := 1 - times ; i < len(阶段_5_21速死_双持_变) ; i ++ { 2234 | for j := 0 ; j < len(阶段_5_21速死_双持_变[i]) ; j ++ { 2235 | enemy := 阶段_5_21速死_双持_变[i][j] 2236 | if hp[enemy] > 0 { 2237 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2238 | break 2239 | } 2240 | } 2241 | } 2242 | 2243 | stat(&rand,&hp) 2244 | 2245 | for i := 21 ; i <= 30 ; i ++ { 2246 | if hp[i] > 0 { 2247 | return 2248 | } 2249 | } 2250 | 2251 | atomic.AddInt32(&DONE, 1) 2252 | print("done",runFuncName(),rand.seed) 2253 | } 2254 | 2255 | func run_dead_21_燃烧_变(rand Random, hp [31]int){ 2256 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2257 | if hp[22] < 1000 { 2258 | run_dead_21_燃烧_变_22(rand,hp,2) 2259 | } 2260 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2261 | if hp[22] <= 0 { 2262 | return 2263 | } 2264 | if hp[22] < 1000 { 2265 | run_dead_21_燃烧_变_22(rand,hp,1) 2266 | } 2267 | hp[22] = hp[22] - rand.attack(def[22],hp[22]) 2268 | if hp[22] <= 0 { 2269 | return 2270 | } 2271 | if hp[22] < 1000 { 2272 | run_dead_21_燃烧_变_22(rand,hp,0) 2273 | } 2274 | } 2275 | func run_dead_21_燃烧_变_22(rand Random, hp [31]int, times int){ 2276 | hp[21] = hp[21] - 1000 2277 | hp[22] = hp[22] - 1000 2278 | hp[23] = hp[23] - 1000 2279 | 2280 | atomic.AddInt32(&统计_阶段_w, 1) 2281 | 2282 | for i := 2 - times ; i < len(阶段_5_21速死_燃烧_变) ; i ++ { 2283 | for j := 0 ; j < len(阶段_5_21速死_燃烧_变[i]) ; j ++ { 2284 | enemy := 阶段_5_21速死_燃烧_变[i][j] 2285 | if hp[enemy] > 0 { 2286 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2287 | break 2288 | } 2289 | } 2290 | } 2291 | 2292 | stat(&rand,&hp) 2293 | 2294 | for i := 21 ; i <= 30 ; i ++ { 2295 | if hp[i] > 0 { 2296 | return 2297 | } 2298 | } 2299 | 2300 | atomic.AddInt32(&DONE, 1) 2301 | print("done",runFuncName(),rand.seed) 2302 | } 2303 | 2304 | func run_dead_21_w_变(rand Random, hp [31]int){ 2305 | for i := 0 ; i < 6 ; i ++ { 2306 | for j := 0 ; j < len(阶段_5_21速死_w_变[i]) ; j ++ { 2307 | enemy := 阶段_5_21速死_w_变[i][j] 2308 | if hp[enemy] > 0 { 2309 | hp[enemy] = hp[enemy] - rand.attack(def[enemy],hp[enemy]) 2310 | break 2311 | } 2312 | } 2313 | } 2314 | 2315 | if hp[22] > 0 { 2316 | atomic.AddInt32(&统计_死亡_22, 1) 2317 | return 2318 | } 2319 | if hp[23] > 1000 { 2320 | atomic.AddInt32(&统计_死亡_23, 1) 2321 | return 2322 | } 2323 | 2324 | hp[23] = hp[23] - 1000 2325 | hp[24] = hp[24] - 1000 2326 | hp[25] = hp[25] - 500 2327 | 2328 | atomic.AddInt32(&统计_阶段_w, 1) 2329 | 2330 | for i := 6 ; i < len(阶段_5_21速死_w_变) ; i ++ { 2331 | for j := 0 ; j < len(阶段_5_21速死_w_变[i]) ; j ++ { 2332 | enemy := 阶段_5_21速死_w_变[i][j] 2333 | if hp[enemy] > 0 { 2334 | damage := rand.attack(def[enemy],hp[enemy]) 2335 | //print(i,enemy,hp[enemy],damage,hp[enemy] - damage) 2336 | hp[enemy] = hp[enemy] - damage 2337 | break 2338 | } 2339 | } 2340 | } 2341 | 2342 | stat(&rand,&hp) 2343 | 2344 | for i := 24 ; i <= 30 ; i ++ { 2345 | if hp[i] > 0 { 2346 | return 2347 | } 2348 | } 2349 | 2350 | atomic.AddInt32(&DONE, 1) 2351 | print("done",runFuncName(),rand.seed) 2352 | } 2353 | 2354 | func run_dead_23(rand Random, hp [31]int){ 2355 | 2356 | atomic.AddInt32(&统计_速死_23, 1) 2357 | atomic.AddInt32(&统计_阶段_w, 1) 2358 | 2359 | for i := 0 ; i < len(阶段_5_23速死) ; i ++ { 2360 | for j := 0 ; j < len(阶段_5_23速死[i]) ; j ++ { 2361 | enemy := 阶段_5_23速死[i][j] 2362 | if hp[enemy] > 0 { 2363 | damage := rand.attack(def[enemy],hp[enemy]) 2364 | hp[enemy] = hp[enemy] - damage 2365 | break 2366 | } 2367 | } 2368 | } 2369 | 2370 | stat(&rand,&hp) 2371 | 2372 | for i := 24 ; i <= 30 ; i ++ { 2373 | if hp[i] > 0 { 2374 | return 2375 | } 2376 | } 2377 | 2378 | atomic.AddInt32(&DONE, 1) 2379 | print("done",runFuncName(),rand.seed) 2380 | } 2381 | 2382 | func stat(rand *Random,hp *[31]int){ 2383 | //return 2384 | if hp[25] > 0 { 2385 | return 2386 | } 2387 | 2388 | for i := 1 ; i <= 27 ; i ++ { 2389 | if hp[i] > 0 { 2390 | return 2391 | } 2392 | } 2393 | 2394 | atomic.AddInt32(&统计_死亡_w, 1) 2395 | 2396 | if hp[29] > 0 && hp[28] <= 0 { 2397 | atomic.AddInt32(&统计_流未死, 1) 2398 | //print("流未死. seed:",rand.seed,runFuncName3(),"w hp:",hp[25],"流 hp:",hp[29],"盾 hp:",hp[28]) 2399 | } 2400 | if hp[28] > 0 && hp[29] <= 0 { 2401 | atomic.AddInt32(&统计_盾未死, 1) 2402 | //print("盾未死. seed:",rand.seed,runFuncName3(),"w hp:",hp[25],"流 hp:",hp[29],"盾 hp:",hp[28]) 2403 | } 2404 | } 2405 | 2406 | func runFuncName() string{ 2407 | pc := make([]uintptr,1) 2408 | runtime.Callers(2,pc) 2409 | f := runtime.FuncForPC(pc[0]) 2410 | return f.Name() 2411 | } 2412 | 2413 | func runFuncName3() string{ 2414 | pc := make([]uintptr,1) 2415 | runtime.Callers(3,pc) 2416 | f := runtime.FuncForPC(pc[0]) 2417 | return f.Name() 2418 | } --------------------------------------------------------------------------------