From e544834107fded665194c02b812e0e4dc08cad9b Mon Sep 17 00:00:00 2001 From: Ajay Vallurupalli Date: Tue, 3 Dec 2024 10:53:14 -0500 Subject: [PATCH] Insane update Completely reworked css, migrating to sass added new action system added new glass powers the code is really ugly right now, so I think the next update needs to just de-spagetify everything update plans - clean code add see power menu add new powers add readme add credits add way to see powers while drafting --- .DS_Store | Bin 8196 -> 8196 bytes app.js | 15198 +++++++++++++++++++++--------------- change_logs/12.3.2024.txt | 11 + chess.nimble | 3 + icons/skyglass.svg | 1 + icons/steelglass.svg | 1 + icons/zeroglass.svg | 1 + index.html | 2 +- main.css | 1179 +++ main.css.map | 1 + rows.scss | 264 + src/basePieces.nim | 35 +- src/board.nim | 8 +- src/capitalism.nim | 49 + src/extrapower/glass.nim | 30 + src/main.nim | 656 +- src/names.nim | 10 + src/piece.nim | 253 +- src/port.nim | 8 +- src/power.nim | 30 +- src/powers.nim | 815 +- styles.css | 480 -- styles.scss | 413 + 23 files changed, 12260 insertions(+), 7188 deletions(-) create mode 100644 change_logs/12.3.2024.txt create mode 100644 icons/skyglass.svg create mode 100644 icons/steelglass.svg create mode 100644 icons/zeroglass.svg create mode 100644 main.css create mode 100644 main.css.map create mode 100644 rows.scss create mode 100644 src/capitalism.nim create mode 100644 src/extrapower/glass.nim create mode 100644 src/names.nim delete mode 100644 styles.css create mode 100644 styles.scss diff --git a/.DS_Store b/.DS_Store index 5dbc1fee115392a9a7924017440d1c8d21fec150..ac1a5ad0d2fcfecdc98ca07a7fa6d0b4ab244b6d 100644 GIT binary patch delta 29 lcmZp1XmOa}&nUeyU^hRb^kyD`ewNL%d2*OHvrGJC2LO;`32XoW delta 75 zcmZp1XmOa}&nUAoU^hRb%w`^eeikDJ1_myMVuliiN`@SUR3J-_AsI*(d*>> 0)) >>> 0) == 0))) { s0_1644167215 = ((s0_1644167215 ^ s_1644167213.a0) >>> 0); s1_1644167216 = ((s1_1644167216 ^ s_1644167213.a1) >>> 0); } var _ = next_1644167203(s_1644167213); - i_1795165326 = addInt(i_1795165326, 1); + i_1795165540 = addInt(i_1795165540, 1); } }; }; - res_1795165328 = addInt(res_1795165328, 1); + res_1795165542 = addInt(res_1795165542, 1); } }; }; @@ -4621,20 +4809,20 @@ function randomize_1644167430(seed_1644167431) { } -function getTakesOn_1476395283(p_1476395284, board_1476395285) { - var result_1476395286 = [[]]; +function getTakesOn_1476395656(p_1476395657, board_1476395658) { + var result_1476395659 = [[]]; Label1: { - var x_1476395290 = null; - var i_1795165331 = 0; - var L_1795165332 = (p_1476395284.takes).length; + var x_1476395682 = null; + var i_1795165545 = 0; + var L_1795165546 = (p_1476395657.takes).length; Label2: { Label3: while (true) { - if (!(i_1795165331 < L_1795165332)) break Label3; - x_1476395290 = p_1476395284.takes[chckIndx(i_1795165331, 0, (p_1476395284.takes).length - 1)]; - add_1476395195(result_1476395286, 0, x_1476395290(board_1476395285, p_1476395284)); - i_1795165331 += 1; - if (!(((p_1476395284.takes).length == L_1795165332))) { + if (!(i_1795165545 < L_1795165546)) break Label3; + x_1476395682 = p_1476395657.takes[chckIndx(i_1795165545, 0, (p_1476395657.takes).length - 1)]; + add_1476395683(result_1476395659, 0, x_1476395682(board_1476395658, p_1476395657)); + i_1795165545 += 1; + if (!(((p_1476395657.takes).length == L_1795165546))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -4642,210 +4830,287 @@ function getTakesOn_1476395283(p_1476395284, board_1476395285) { }; }; - return result_1476395286[0]; + return result_1476395659[0]; + +} + +function HEX3DHEX3D_1476395830(x_1476395832, y_1476395833) { + var result_1476395834 = false; + + BeforeRet: { + if (!((x_1476395832["Field0"] == y_1476395833["Field0"]))) { + result_1476395834 = false; + break BeforeRet; + } + + if (!((x_1476395832["Field1"] == y_1476395833["Field1"]))) { + result_1476395834 = false; + break BeforeRet; + } + + result_1476395834 = true; + break BeforeRet; + }; + + return result_1476395834; } -function getMovesOn_1476395168(p_1476395169, board_1476395170) { - var result_1476395171 = [[]]; +function find_1476395811(a_1476395814, item_1476395815) { + var result_1476395816 = 0; + BeforeRet: { + result_1476395816 = 0; Label1: { - var x_1476395194 = null; - var i_1795165335 = 0; - var L_1795165336 = (p_1476395169.moves).length; + var i_1476395829 = {Field0: 0, Field1: 0}; + var i_1795165562 = 0; Label2: { Label3: while (true) { - if (!(i_1795165335 < L_1795165336)) break Label3; - x_1476395194 = p_1476395169.moves[chckIndx(i_1795165335, 0, (p_1476395169.moves).length - 1)]; - add_1476395195(result_1476395171, 0, x_1476395194(board_1476395170, p_1476395169)); - i_1795165335 += 1; - if (!(((p_1476395169.moves).length == L_1795165336))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + if (!(i_1795165562 < (a_1476395814).length)) break Label3; + i_1476395829 = a_1476395814[chckIndx(i_1795165562, 0, (a_1476395814).length - 1)]; + if (HEX3DHEX3D_1476395830(i_1476395829, item_1476395815)) { + break BeforeRet; } + result_1476395816 = addInt(result_1476395816, 1); + i_1795165562 += 1; } }; }; + result_1476395816 = (-1); + }; - return result_1476395171[0]; + return result_1476395816; } -function rand_1644167279(r_1644167281, max_1644167282) { - var result_1644167283 = 0n; +function contains_1476395806(a_1476395808, item_1476395809) { + var result_1476395810 = false; BeforeRet: { - if ((max_1644167282 == 0n)) { + result_1476395810 = (0 <= find_1476395811(a_1476395808, item_1476395809)); break BeforeRet; - } - else { - var max_1644167284 = max_1644167282; - if ((max_1644167284 == 18446744073709551615n)) { - result_1644167283 = next_1644167203(r_1644167281); - break BeforeRet; - } - - var iters_1644167297 = 0; - Label1: { - Label2: while (true) { - if (!true) break Label2; - var x_1644167298 = next_1644167203(r_1644167281); - if (((x_1644167298 <= BigInt.asUintN(64, (4294967295n - (4294967295n % max_1644167284)))) || (20 < iters_1644167297))) { - result_1644167283 = (x_1644167298 % BigInt.asUintN(64, (max_1644167284 + 1n))); - break BeforeRet; - } - else { - iters_1644167297 = addInt(iters_1644167297, 1); - } - - } - }; - } - }; - return result_1644167283; + return result_1476395810; } -function rand_1577058379(r_1577058381, x_1577058382) { - var result_1577058383 = 0; - - if (!((x_1577058382.a <= x_1577058382.b))) { - failedAssertImpl_268435541([114,97,110,100,111,109,46,110,105,109,40,51,51,57,44,32,51,41,32,96,120,46,97,32,60,61,32,120,46,98,96,32]); - } - - result_1577058383 = Number(BigInt.asIntN(32, BigInt.asUintN(64, (rand_1644167279(r_1577058381, BigInt.asUintN(64, (BigInt.asUintN(64, BigInt(x_1577058382.b)) - BigInt.asUintN(64, BigInt(x_1577058382.a))))) + BigInt.asUintN(64, BigInt(x_1577058382.a)))))); - - return result_1577058383; +function addQuoted_889193861(s_889193863, s_889193863_Idx, x_889193864) { + addInt_301990129(s_889193863, s_889193863_Idx, x_889193864); + } -function rand_1577058371(x_1577058373) { - var result_1577058374 = 0; +function HEX24_1476395861(x_1476395863) { + var result_1476395864 = [[]]; - result_1577058374 = rand_1577058379(state_1644167182[0], x_1577058373); + result_1476395864[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym5_1476395875 = 0; + if ((0 < countHEX60gensym5_1476395875)) { + result_1476395864[0].push.apply(result_1476395864[0], [44,32]);; + } + + result_1476395864[0].push.apply(result_1476395864[0], [102,105,108,101]);; + result_1476395864[0].push.apply(result_1476395864[0], [58,32]);; + countHEX60gensym5_1476395875 += 1; + addQuoted_889193861(result_1476395864, 0, x_1476395863["Field0"]); + if ((0 < countHEX60gensym5_1476395875)) { + result_1476395864[0].push.apply(result_1476395864[0], [44,32]);; + } + + result_1476395864[0].push.apply(result_1476395864[0], [114,97,110,107]);; + result_1476395864[0].push.apply(result_1476395864[0], [58,32]);; + countHEX60gensym5_1476395875 += 1; + addQuoted_889193861(result_1476395864, 0, x_1476395863["Field1"]); + result_1476395864[0].push.apply(result_1476395864[0], [41]);; - return result_1577058374; + return result_1476395864[0]; } -function HEX2EHEX2E_1174405168(a_1174405171, b_1174405172) { - var result_1174405173 = ({a: 0, b: 0}); - - result_1174405173 = nimCopy(result_1174405173, {a: a_1174405171, b: b_1174405172}, NTI939524165); - - return result_1174405173; +function getMovesOn_1476395771(p_1476395772, board_1476395773) { + var result_1476395774 = [[]]; -} - -function sample_1795163902(a_1795163904) { - var result_1795163905 = {Field0: 0, Field1: 0}; - - result_1795163905 = a_1795163904[chckIndx(rand_1577058371(HEX2EHEX2E_1174405168(0, (a_1795163904).length - 1)), 0, (a_1795163904).length - 1)]; + Label1: { + var x_1476395778 = null; + var i_1795165549 = 0; + var L_1795165550 = (p_1476395772.moves).length; + Label2: { + Label3: while (true) { + if (!(i_1795165549 < L_1795165550)) break Label3; + x_1476395778 = p_1476395772.moves[chckIndx(i_1795165549, 0, (p_1476395772.moves).length - 1)]; + add_1476395683(result_1476395774, 0, x_1476395778(board_1476395773, p_1476395772)); + i_1795165549 += 1; + if (!(((p_1476395772.moves).length == L_1795165550))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + var takes_1476395783 = getTakesOn_1476395656(p_1476395772, board_1476395773); + Label4: { + var x_1476395805 = {Field0: 0, Field1: 0}; + var i_1795165553 = 0; + var L_1795165554 = (takes_1476395783).length; + Label5: { + Label6: while (true) { + if (!(i_1795165553 < L_1795165554)) break Label6; + x_1476395805 = takes_1476395783[chckIndx(i_1795165553, 0, (takes_1476395783).length - 1)]; + if (contains_1476395806(result_1476395774[0], x_1476395805)) { + rawEcho(HEX24_1476395861(x_1476395805), [32,105,115,32,97,32,116,97,107,101,32,97,110,100,32,97,32,109,111,118,101]); + } + + i_1795165553 += 1; + if (!(((takes_1476395783).length == L_1795165554))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + var resultHEX60gensym12_1476395912 = newSeq_1476395904(0); + Label7: { + var it_1476395916 = {Field0: 0, Field1: 0}; + var i_1795165557 = 0; + var L_1795165558 = (result_1476395774[0]).length; + Label8: { + Label9: while (true) { + if (!(i_1795165557 < L_1795165558)) break Label9; + it_1476395916 = result_1476395774[0][chckIndx(i_1795165557, 0, (result_1476395774[0]).length - 1)]; + if (!(contains_1476395806(takes_1476395783, it_1476395916))) { + var Temporary10 = nimCopy(null, it_1476395916, NTI1476395011); + resultHEX60gensym12_1476395912.push(Temporary10);; + } + + i_1795165557 += 1; + if (!(((result_1476395774[0]).length == L_1795165558))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + result_1476395774[0] = nimCopy(null, resultHEX60gensym12_1476395912, NTI1476395639); - return result_1795163905; + return result_1476395774[0]; } -function HEX3DHEX3D_1476395801(x_1476395803, y_1476395804) { - var result_1476395805 = false; +function rand_1644167279(r_1644167281, max_1644167282) { + var result_1644167283 = 0n; BeforeRet: { - if (!((x_1476395803["Field0"] == y_1476395804["Field0"]))) { - result_1476395805 = false; + if ((max_1644167282 == 0n)) { break BeforeRet; } - - if (!((x_1476395803["Field1"] == y_1476395804["Field1"]))) { - result_1476395805 = false; - break BeforeRet; + else { + var max_1644167284 = max_1644167282; + if ((max_1644167284 == 18446744073709551615n)) { + result_1644167283 = next_1644167203(r_1644167281); + break BeforeRet; + } + + var iters_1644167297 = 0; + Label1: { + Label2: while (true) { + if (!true) break Label2; + var x_1644167298 = next_1644167203(r_1644167281); + if (((x_1644167298 <= BigInt.asUintN(64, (4294967295n - (4294967295n % max_1644167284)))) || (20 < iters_1644167297))) { + result_1644167283 = (x_1644167298 % BigInt.asUintN(64, (max_1644167284 + 1n))); + break BeforeRet; + } + else { + iters_1644167297 = addInt(iters_1644167297, 1); + } + + } + }; } - result_1476395805 = true; - break BeforeRet; }; - return result_1476395805; + return result_1644167283; } -function find_1476395782(a_1476395785, item_1476395786) { - var result_1476395787 = 0; +function rand_1577058378(r_1577058380, x_1577058381) { + var result_1577058382 = 0; - BeforeRet: { - result_1476395787 = 0; - Label1: { - var i_1476395800 = {Field0: 0, Field1: 0}; - var i_1795165341 = 0; - Label2: { - Label3: while (true) { - if (!(i_1795165341 < (a_1476395785).length)) break Label3; - i_1476395800 = a_1476395785[chckIndx(i_1795165341, 0, (a_1476395785).length - 1)]; - if (HEX3DHEX3D_1476395801(i_1476395800, item_1476395786)) { - break BeforeRet; - } - - result_1476395787 = addInt(result_1476395787, 1); - i_1795165341 += 1; - } - }; - }; - result_1476395787 = (-1); - }; + if (!((x_1577058381.a <= x_1577058381.b))) { + failedAssertImpl_268435541([114,97,110,100,111,109,46,110,105,109,40,51,51,57,44,32,51,41,32,96,120,46,97,32,60,61,32,120,46,98,96,32]); + } + + result_1577058382 = Number(BigInt.asIntN(32, BigInt.asUintN(64, (rand_1644167279(r_1577058380, BigInt.asUintN(64, (BigInt.asUintN(64, BigInt(x_1577058381.b)) - BigInt.asUintN(64, BigInt(x_1577058381.a))))) + BigInt.asUintN(64, BigInt(x_1577058381.a)))))); - return result_1476395787; + return result_1577058382; } -function contains_1476395777(a_1476395779, item_1476395780) { - var result_1476395781 = false; +function rand_1577058370(x_1577058372) { + var result_1577058373 = 0; - BeforeRet: { - result_1476395781 = (0 <= find_1476395782(a_1476395779, item_1476395780)); - break BeforeRet; - }; + result_1577058373 = rand_1577058378(state_1644167182[0], x_1577058372); - return result_1476395781; + return result_1577058373; } -function HEX3Aanonymous_1795163877(piece_1795163878, board_1795163879) { +function HEX2EHEX2E_1174405168(a_1174405171, b_1174405172) { + var result_1174405173 = ({a: 0, b: 0}); + + result_1174405173 = nimCopy(result_1174405173, {a: a_1174405171, b: b_1174405172}, NTI939524165); + + return result_1174405173; + +} + +function sample_1795163895(a_1795163897) { + var result_1795163898 = {Field0: 0, Field1: 0}; + + result_1795163898 = a_1795163897[chckIndx(rand_1577058370(HEX2EHEX2E_1174405168(0, (a_1795163897).length - 1)), 0, (a_1795163897).length - 1)]; + + return result_1795163898; + +} + +function HEX3Aanonymous_1795163869(piece_1795163870, board_1795163871, state_1795163872) { BeforeRet: { - if (!(piece_1795163878.rand.Field0)) { - piece_1795163878.rand.Field0 = true; - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795163878.tile.Field1), mulInt(100, piece_1795163878.tile.Field0)), piece_1795163878.rand.Field1))); - var takes_1795163880 = getTakesOn_1476395283(piece_1795163878, board_1795163879); - var moves_1795163881 = getMovesOn_1476395168(piece_1795163878, board_1795163879); - if (((moves_1795163881).length == 0)) { + if (!(piece_1795163870.drunk)) { + piece_1795163870.drunk = true; + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795163870.tile.Field1), mulInt(100, piece_1795163870.tile.Field0)), state_1795163872.Field0.randSeed))); + var takes_1795163873 = getTakesOn_1476395656(piece_1795163870, board_1795163871); + var moves_1795163874 = getMovesOn_1476395771(piece_1795163870, board_1795163871); + if (((moves_1795163874).length == 0)) { break BeforeRet; } - var resultHEX60gensym88_1795163889 = newSeq_1811939476(0); + var resultHEX60gensym88_1795163882 = newSeq_1476395904(0); Label1: { - var it_1795163893 = {Field0: 0, Field1: 0}; - var i_1795165321 = 0; - var L_1795165322 = (moves_1795163881).length; + var it_1795163886 = {Field0: 0, Field1: 0}; + var i_1795165535 = 0; + var L_1795165536 = (moves_1795163874).length; Label2: { Label3: while (true) { - if (!(i_1795165321 < L_1795165322)) break Label3; - it_1795163893 = moves_1795163881[chckIndx(i_1795165321, 0, (moves_1795163881).length - 1)]; - if (!(contains_1476395777(takes_1795163880, it_1795163893))) { - var Temporary4 = nimCopy(null, it_1795163893, NTI1476395011); - resultHEX60gensym88_1795163889.push(Temporary4);; + if (!(i_1795165535 < L_1795165536)) break Label3; + it_1795163886 = moves_1795163874[chckIndx(i_1795165535, 0, (moves_1795163874).length - 1)]; + if (!(contains_1476395806(takes_1795163873, it_1795163886))) { + var Temporary4 = nimCopy(null, it_1795163886, NTI1476395011); + resultHEX60gensym88_1795163882.push(Temporary4);; } - i_1795165321 += 1; - if (!(((moves_1795163881).length == L_1795165322))) { + i_1795165535 += 1; + if (!(((moves_1795163874).length == L_1795165536))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - var attempt_1795163924 = nimCopy(null, sample_1795163902(resultHEX60gensym88_1795163889), NTI1476395011); - if (contains_1476395777(moves_1795163881, attempt_1795163924)) { - piece_1795163878.onMove(piece_1795163878, attempt_1795163924, board_1795163879); + var attempt_1795163917 = nimCopy(null, sample_1795163895(resultHEX60gensym88_1795163882), NTI1476395011); + if (contains_1476395806(moves_1795163874, attempt_1795163917)) { + piece_1795163870.onMove(piece_1795163870, attempt_1795163917, board_1795163871, state_1795163872); } } @@ -4855,35 +5120,35 @@ function HEX3Aanonymous_1795163877(piece_1795163878, board_1795163879) { } -function HEX3Aanonymous_1795163995(side_1795163996, __1795163997, b_1795163998) { +function HEX3Aanonymous_1795163989(side_1795163990, __1795163991, b_1795163992, __1795163993) { Label1: { - var i_1795163999 = 0; - var j_1795164000 = 0; + var i_1795163994 = 0; + var j_1795163995 = 0; Label2: { - var i_1795165313 = 0; - var i_1795165314 = 0; + var i_1795165527 = 0; + var i_1795165528 = 0; Label3: { Label4: while (true) { - if (!(i_1795165314 < 8)) break Label4; - i_1795165313 = i_1795165314; + if (!(i_1795165528 < 8)) break Label4; + i_1795165527 = i_1795165528; Label5: { - var j_1795165317 = 0; - var i_1795165318 = 0; + var j_1795165531 = 0; + var i_1795165532 = 0; Label6: { Label7: while (true) { - if (!(i_1795165318 < 8)) break Label7; - j_1795165317 = i_1795165318; - i_1795163999 = i_1795165313; - j_1795164000 = j_1795165317; - if (((b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)][chckIndx(j_1795164000, 0, (b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)]).length - 1)].item == 5) && isColor_1476395605(b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)][chckIndx(j_1795164000, 0, (b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)]).length - 1)], side_1795163996))) { - b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)][chckIndx(j_1795164000, 0, (b_1795163998[chckIndx(i_1795163999, 0, (b_1795163998).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163877);; + if (!(i_1795165532 < 8)) break Label7; + j_1795165531 = i_1795165532; + i_1795163994 = i_1795165527; + j_1795163995 = j_1795165531; + if (((b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)][chckIndx(j_1795163995, 0, (b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)]).length - 1)].item == 5) && isColor_1476396138(b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)][chckIndx(j_1795163995, 0, (b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)]).length - 1)], side_1795163990))) { + b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)][chckIndx(j_1795163995, 0, (b_1795163992[chckIndx(i_1795163994, 0, (b_1795163992).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163869);; } - i_1795165318 = addInt(i_1795165318, 1); + i_1795165532 = addInt(i_1795165532, 1); } }; }; - i_1795165314 = addInt(i_1795165314, 1); + i_1795165528 = addInt(i_1795165528, 1); } }; }; @@ -4892,36 +5157,36 @@ function HEX3Aanonymous_1795163995(side_1795163996, __1795163997, b_1795163998) } -function HEX3Aanonymous_1795164010(side_1795164011, __1795164012, b_1795164013) { +function HEX3Aanonymous_1795164005(side_1795164006, __1795164007, b_1795164008, __1795164009) { Label1: { - var i_1795164014 = 0; - var j_1795164015 = 0; + var i_1795164010 = 0; + var j_1795164011 = 0; Label2: { - var i_1795165345 = 0; - var i_1795165346 = 0; + var i_1795165567 = 0; + var i_1795165568 = 0; Label3: { Label4: while (true) { - if (!(i_1795165346 < 8)) break Label4; - i_1795165345 = i_1795165346; + if (!(i_1795165568 < 8)) break Label4; + i_1795165567 = i_1795165568; Label5: { - var j_1795165349 = 0; - var i_1795165350 = 0; + var j_1795165571 = 0; + var i_1795165572 = 0; Label6: { Label7: while (true) { - if (!(i_1795165350 < 8)) break Label7; - j_1795165349 = i_1795165350; - i_1795164014 = i_1795165345; - j_1795164015 = j_1795165349; - if (isColor_1476395605(b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)][chckIndx(j_1795164015, 0, (b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)]).length - 1)], side_1795164011)) { - b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)][chckIndx(j_1795164015, 0, (b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163877);; - b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)][chckIndx(j_1795164015, 0, (b_1795164013[chckIndx(i_1795164014, 0, (b_1795164013).length - 1)]).length - 1)].rotate = true; + if (!(i_1795165572 < 8)) break Label7; + j_1795165571 = i_1795165572; + i_1795164010 = i_1795165567; + j_1795164011 = j_1795165571; + if (isColor_1476396138(b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)][chckIndx(j_1795164011, 0, (b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)]).length - 1)], side_1795164006)) { + b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)][chckIndx(j_1795164011, 0, (b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163869);; + b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)][chckIndx(j_1795164011, 0, (b_1795164008[chckIndx(i_1795164010, 0, (b_1795164008).length - 1)]).length - 1)].rotate = true; } - i_1795165350 = addInt(i_1795165350, 1); + i_1795165572 = addInt(i_1795165572, 1); } }; }; - i_1795165346 = addInt(i_1795165346, 1); + i_1795165568 = addInt(i_1795165568, 1); } }; }; @@ -4930,56 +5195,56 @@ function HEX3Aanonymous_1795164010(side_1795164011, __1795164012, b_1795164013) } -function HEX3Aanonymous_1795164166(taken_1795164167, taker_1795164168, board_1795164169) { - var result_1795164172 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; +function HEX3Aanonymous_1795164164(taken_1795164165, taker_1795164166, board_1795164167, state_1795164168) { + var result_1795164171 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; BeforeRet: { - var colontmp__1795165353 = nimCopy(null, taker_1795164168.tile, NTI1476395011); - var colontmp__1795165354 = false; - result_1795164172 = nimCopy(result_1795164172, {Field0: nimCopy(null, colontmp__1795165353, NTI1476395011), Field1: colontmp__1795165354}, NTI1795163882); + var colontmp__1795165575 = nimCopy(null, taker_1795164166.tile, NTI1476395011); + var colontmp__1795165576 = false; + result_1795164171 = nimCopy(result_1795164171, {Field0: nimCopy(null, colontmp__1795165575, NTI1476395011), Field1: colontmp__1795165576}, NTI1795163921); break BeforeRet; }; - return result_1795164172; + return result_1795164171; } -function HEX3Aanonymous_1795164130(piece_1795164131, board_1795164132) { +function HEX3Aanonymous_1795164127(piece_1795164128, board_1795164129, state_1795164130) { BeforeRet: { - if (!(piece_1795164131.rand.Field0)) { - piece_1795164131.rand.Field0 = true; - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164131.tile.Field1), mulInt(100, piece_1795164131.tile.Field0)), piece_1795164131.rand.Field1))); - piece_1795164131.moves.push(HEX3Aanonymous_1509949673);; - var moves_1795164137 = HEX3Aanonymous_1509949673(board_1795164132, piece_1795164131); - var takes_1795164138 = HEX3Aanonymous_1509949688(board_1795164132, piece_1795164131); - var resultHEX60gensym100_1795164143 = newSeq_1811939476(0); - Label1: { - var it_1795164147 = {Field0: 0, Field1: 0}; - var i_1795165356 = 0; - var L_1795165357 = (moves_1795164137).length; + if (!(piece_1795164128.drunk)) { + piece_1795164128.drunk = true; + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164128.tile.Field1), mulInt(100, piece_1795164128.tile.Field0)), state_1795164130.Field0.randSeed))); + piece_1795164128.moves.push(HEX3Aanonymous_1543504105);; + var moves_1795164135 = HEX3Aanonymous_1543504105(board_1795164129, piece_1795164128); + var takes_1795164136 = HEX3Aanonymous_1543504120(board_1795164129, piece_1795164128); + var resultHEX60gensym100_1795164141 = newSeq_1476395904(0); + Label1: { + var it_1795164145 = {Field0: 0, Field1: 0}; + var i_1795165578 = 0; + var L_1795165579 = (moves_1795164135).length; Label2: { Label3: while (true) { - if (!(i_1795165356 < L_1795165357)) break Label3; - it_1795164147 = moves_1795164137[chckIndx(i_1795165356, 0, (moves_1795164137).length - 1)]; - if (!(contains_1476395777(takes_1795164138, it_1795164147))) { - var Temporary4 = nimCopy(null, it_1795164147, NTI1476395011); - resultHEX60gensym100_1795164143.push(Temporary4);; + if (!(i_1795165578 < L_1795165579)) break Label3; + it_1795164145 = moves_1795164135[chckIndx(i_1795165578, 0, (moves_1795164135).length - 1)]; + if (!(contains_1476395806(takes_1795164136, it_1795164145))) { + var Temporary4 = nimCopy(null, it_1795164145, NTI1476395011); + resultHEX60gensym100_1795164141.push(Temporary4);; } - i_1795165356 += 1; - if (!(((moves_1795164137).length == L_1795165357))) { + i_1795165578 += 1; + if (!(((moves_1795164135).length == L_1795165579))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - var attempt_1795164156 = nimCopy(null, resultHEX60gensym100_1795164143, NTI1811939451); - if (((attempt_1795164156).length == 0)) { + var attempt_1795164154 = nimCopy(null, resultHEX60gensym100_1795164141, NTI1476395639); + if (((attempt_1795164154).length == 0)) { break BeforeRet; } else { - piece_1795164131.onMove(piece_1795164131, sample_1795163902(attempt_1795164156), board_1795164132); + piece_1795164128.onMove(piece_1795164128, sample_1795163895(attempt_1795164154), board_1795164129, state_1795164130); } } @@ -5007,11 +5272,11 @@ function rand_1644167304(max_1644167305) { } -function HEX3Aanonymous_1795164174(side_1795164175, __1795164176, b_1795164177) { +function HEX3Aanonymous_1795164173(side_1795164174, __1795164175, b_1795164176, state_1795164177) { var Temporary1; - randomize_1644167430(BigInt(b_1795164177[chckIndx(0, 0, (b_1795164177).length - 1)][chckIndx(0, 0, (b_1795164177[chckIndx(0, 0, (b_1795164177).length - 1)]).length - 1)].rand.Field1)); - if ((side_1795164175 == 0)) { + randomize_1644167430(BigInt(state_1795164177.Field0.randSeed)); + if ((side_1795164174 == 0)) { Temporary1 = 5; } else { @@ -5019,16 +5284,16 @@ function HEX3Aanonymous_1795164174(side_1795164175, __1795164176, b_1795164177) } var rank_1795164182 = Temporary1; - var commoner_1795164199 = {item: 7, color: side_1795164175, moves: [HEX3Aanonymous_1509949673], takes: [], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1795164166, onEndTurn: [HEX3Aanonymous_1795164130], onPromote: [HEX3Aanonymous_1476395438], filePath: [99,105,118,105,108,105,97,110,46,115,118,103], timesMoved: 0, piecesTaken: 0, tile: nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011), promoted: false, colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054)}; + var commoner_1795164199 = {item: 7, color: side_1795164174, moves: [HEX3Aanonymous_1543504105], takes: [], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1795164164, onEndTurn: [HEX3Aanonymous_1795164127], onPromote: [HEX3Aanonymous_1476395595], filePath: [99,105,118,105,108,105,97,110,46,115,118,103], timesMoved: 0, piecesTaken: 0, tile: nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011), promoted: false, colorable: true, rotate: false, drunk: false, index: 0, casts: []}; var spawns_1795164200 = 0; var failsafe_1795164201 = 20; var attempt_1795164202 = rand_1644167304(7); Label2: { Label3: while (true) { if (!(!((spawns_1795164200 == 3)) && !((failsafe_1795164201 == 0)))) break Label3; - if (isAir_1476395588(b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)]).length - 1)])) { - var tile_1795164203 = nimCopy(null, b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)]).length - 1)].tile, NTI1476395011); - b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)]).length - 1)] = nimCopy(b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164177[chckIndx(rank_1795164182, 0, (b_1795164177).length - 1)]).length - 1)], pieceCopy_1476395495(commoner_1795164199, commoner_1795164199.item, commoner_1795164199.color, commoner_1795164199.timesMoved, commoner_1795164199.piecesTaken, tile_1795164203, commoner_1795164199.moves, commoner_1795164199.takes, commoner_1795164199.onMove, commoner_1795164199.onTake, commoner_1795164199.whenTaken, commoner_1795164199.onEndTurn, commoner_1795164199.onPromote, commoner_1795164199.promoted, commoner_1795164199.filePath, commoner_1795164199.colorable, commoner_1795164199.rotate, commoner_1795164199.rand, commoner_1795164199.wallet), NTI1476395026); + if (isAir_1476396121(b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)]).length - 1)])) { + var tile_1795164203 = nimCopy(null, b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)]).length - 1)].tile, NTI1476395011); + b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)]).length - 1)] = nimCopy(b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)][chckIndx(attempt_1795164202, 0, (b_1795164176[chckIndx(rank_1795164182, 0, (b_1795164176).length - 1)]).length - 1)], pieceCopy_1476396045(commoner_1795164199, newIndex_1476395640(state_1795164177), commoner_1795164199.item, commoner_1795164199.color, commoner_1795164199.timesMoved, commoner_1795164199.piecesTaken, tile_1795164203, commoner_1795164199.moves, commoner_1795164199.takes, commoner_1795164199.onMove, commoner_1795164199.onTake, commoner_1795164199.whenTaken, commoner_1795164199.onEndTurn, commoner_1795164199.onPromote, commoner_1795164199.promoted, commoner_1795164199.filePath, commoner_1795164199.colorable, commoner_1795164199.rotate, commoner_1795164199.drunk), NTI1476395032); spawns_1795164200 = addInt(spawns_1795164200, 1); } else { @@ -5042,28 +5307,28 @@ function HEX3Aanonymous_1795164174(side_1795164175, __1795164176, b_1795164177) } -function createLottery_1795164305() { +function createLottery_1795164308() { -function HEX3Aanonymous_1795164308(piece_1795164309, board_1795164310) { - if (!((piece_1795164309.timesMoved == lastTimesMoved_1795164307))) { - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164309.tile.Field1), mulInt(100, piece_1795164309.tile.Field0)), piece_1795164309.rand.Field1))); - var ticket_1795164311 = rand_1644167304(100); - if (((ticket_1795164311 == 42) || (ticket_1795164311 == 17))) { +function HEX3Aanonymous_1795164311(piece_1795164312, board_1795164313, state_1795164314) { + if (!((piece_1795164312.timesMoved == lastTimesMoved_1795164310))) { + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164312.tile.Field1), mulInt(100, piece_1795164312.tile.Field0)), state_1795164314.Field0.randSeed))); + var ticket_1795164315 = rand_1644167304(100); + if ((ticket_1795164315 == 42)) { Label1: { - var pHEX60gensym107_1795164316 = null; - var i_1795165369 = 0; - var L_1795165370 = (piece_1795164309.onPromote).length; + var xHEX60gensym107_1795164320 = null; + var i_1795165591 = 0; + var L_1795165592 = (piece_1795164312.onPromote).length; Label2: { Label3: while (true) { - if (!(i_1795165369 < L_1795165370)) break Label3; - pHEX60gensym107_1795164316 = piece_1795164309.onPromote[chckIndx(i_1795165369, 0, (piece_1795164309.onPromote).length - 1)]; - pHEX60gensym107_1795164316(piece_1795164309, board_1795164310); - if (piece_1795164309.promoted) { + if (!(i_1795165591 < L_1795165592)) break Label3; + xHEX60gensym107_1795164320 = piece_1795164312.onPromote[chckIndx(i_1795165591, 0, (piece_1795164312.onPromote).length - 1)]; + xHEX60gensym107_1795164320(piece_1795164312, board_1795164313, state_1795164314); + if (piece_1795164312.promoted) { break Label1; } - i_1795165369 += 1; - if (!(((piece_1795164309.onPromote).length == L_1795165370))) { + i_1795165591 += 1; + if (!(((piece_1795164312.onPromote).length == L_1795165592))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -5074,49 +5339,49 @@ function HEX3Aanonymous_1795164308(piece_1795164309, board_1795164310) { } - lastTimesMoved_1795164307 = piece_1795164309.timesMoved; + lastTimesMoved_1795164310 = piece_1795164312.timesMoved; } - var result_1795164306 = null; + var result_1795164309 = null; - var lastTimesMoved_1795164307 = 0; - result_1795164306 = HEX3Aanonymous_1795164308; + var lastTimesMoved_1795164310 = 0; + result_1795164309 = HEX3Aanonymous_1795164311; - return result_1795164306; + return result_1795164309; } -function HEX3Aanonymous_1795164319(side_1795164320, __1795164321, b_1795164322) { +function HEX3Aanonymous_1795164323(side_1795164324, __1795164325, b_1795164326, __1795164327) { Label1: { - var i_1795164323 = 0; - var j_1795164324 = 0; + var i_1795164328 = 0; + var j_1795164329 = 0; Label2: { - var i_1795165361 = 0; - var i_1795165362 = 0; + var i_1795165583 = 0; + var i_1795165584 = 0; Label3: { Label4: while (true) { - if (!(i_1795165362 < 8)) break Label4; - i_1795165361 = i_1795165362; + if (!(i_1795165584 < 8)) break Label4; + i_1795165583 = i_1795165584; Label5: { - var j_1795165365 = 0; - var i_1795165366 = 0; + var j_1795165587 = 0; + var i_1795165588 = 0; Label6: { Label7: while (true) { - if (!(i_1795165366 < 8)) break Label7; - j_1795165365 = i_1795165366; - i_1795164323 = i_1795165361; - j_1795164324 = j_1795165365; - if (((b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)][chckIndx(j_1795164324, 0, (b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)]).length - 1)].item == 3) && isColor_1476395605(b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)][chckIndx(j_1795164324, 0, (b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)]).length - 1)], side_1795164320))) { - b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)][chckIndx(j_1795164324, 0, (b_1795164322[chckIndx(i_1795164323, 0, (b_1795164322).length - 1)]).length - 1)].onEndTurn.push(createLottery_1795164305());; + if (!(i_1795165588 < 8)) break Label7; + j_1795165587 = i_1795165588; + i_1795164328 = i_1795165583; + j_1795164329 = j_1795165587; + if (((b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)][chckIndx(j_1795164329, 0, (b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)]).length - 1)].item == 3) && isColor_1476396138(b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)][chckIndx(j_1795164329, 0, (b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)]).length - 1)], side_1795164324))) { + b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)][chckIndx(j_1795164329, 0, (b_1795164326[chckIndx(i_1795164328, 0, (b_1795164326).length - 1)]).length - 1)].onEndTurn.push(createLottery_1795164308());; } - i_1795165366 = addInt(i_1795165366, 1); + i_1795165588 = addInt(i_1795165588, 1); } }; }; - i_1795165362 = addInt(i_1795165362, 1); + i_1795165584 = addInt(i_1795165584, 1); } }; }; @@ -5125,98 +5390,156 @@ function HEX3Aanonymous_1795164319(side_1795164320, __1795164321, b_1795164322) } -function otherSide_1476395613(a_1476395614) { +function otherSide_1476396146(a_1476396147) { var Temporary1; - var result_1476395615 = 0; + var result_1476396148 = 0; BeforeRet: { - if ((a_1476395614 == 1)) { + if ((a_1476396147 == 1)) { Temporary1 = 0; } else { Temporary1 = 1; } - result_1476395615 = Temporary1; + result_1476396148 = Temporary1; break BeforeRet; }; - return result_1476395615; + return result_1476396148; + +} + +function HEX3Aanonymous_1795164339(piece_1795164340, board_1795164341, state_1795164342) { + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164340.tile.Field1), mulInt(100, piece_1795164340.tile.Field0)), state_1795164342.Field0.randSeed))); + var ticket_1795164343 = rand_1644167304(1000); + if ((ticket_1795164343 == 42)) { + Label1: { + var i_1795164344 = 0; + var j_1795164345 = 0; + Label2: { + var i_1795165605 = 0; + var i_1795165606 = 0; + Label3: { + Label4: while (true) { + if (!(i_1795165606 < 8)) break Label4; + i_1795165605 = i_1795165606; + Label5: { + var j_1795165609 = 0; + var i_1795165610 = 0; + Label6: { + Label7: while (true) { + if (!(i_1795165610 < 8)) break Label7; + j_1795165609 = i_1795165610; + i_1795164344 = i_1795165605; + j_1795164345 = j_1795165609; + if (((board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)][chckIndx(j_1795164345, 0, (board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)]).length - 1)].item == 0) && isColor_1476396138(board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)][chckIndx(j_1795164345, 0, (board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)]).length - 1)], otherSide_1476396146(piece_1795164340.color)))) { + board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)][chckIndx(j_1795164345, 0, (board_1795164341[chckIndx(i_1795164344, 0, (board_1795164341).length - 1)]).length - 1)].item = 6; + } + + i_1795165610 = addInt(i_1795165610, 1); + } + }; + }; + i_1795165606 = addInt(i_1795165606, 1); + } + }; + }; + }; + } + + } -function HEX3Aanonymous_1795164334(piece_1795164335, board_1795164336) { - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164335.tile.Field1), mulInt(100, piece_1795164335.tile.Field0)), piece_1795164335.rand.Field1))); - var ticket_1795164337 = rand_1644167304(1000); - if ((ticket_1795164337 == 42)) { +function HEX3Aanonymous_1795164351(side_1795164352, __1795164353, b_1795164354, __1795164355) { Label1: { - var i_1795164338 = 0; - var j_1795164339 = 0; + var i_1795164356 = 0; + var j_1795164357 = 0; Label2: { - var i_1795165383 = 0; - var i_1795165384 = 0; + var i_1795165596 = 0; + var i_1795165597 = 0; Label3: { Label4: while (true) { - if (!(i_1795165384 < 8)) break Label4; - i_1795165383 = i_1795165384; + if (!(i_1795165597 < 8)) break Label4; + i_1795165596 = i_1795165597; Label5: { - var j_1795165387 = 0; - var i_1795165388 = 0; + var j_1795165600 = 0; + var i_1795165601 = 0; Label6: { Label7: while (true) { - if (!(i_1795165388 < 8)) break Label7; - j_1795165387 = i_1795165388; - i_1795164338 = i_1795165383; - j_1795164339 = j_1795165387; - if (((board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)][chckIndx(j_1795164339, 0, (board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)]).length - 1)].item == 0) && isColor_1476395605(board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)][chckIndx(j_1795164339, 0, (board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)]).length - 1)], otherSide_1476395613(piece_1795164335.color)))) { - board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)][chckIndx(j_1795164339, 0, (board_1795164336[chckIndx(i_1795164338, 0, (board_1795164336).length - 1)]).length - 1)].item = 6; + if (!(i_1795165601 < 8)) break Label7; + j_1795165600 = i_1795165601; + i_1795164356 = i_1795165596; + j_1795164357 = j_1795165600; + if (((b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)][chckIndx(j_1795164357, 0, (b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)]).length - 1)].item == 0) && isColor_1476396138(b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)][chckIndx(j_1795164357, 0, (b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)]).length - 1)], side_1795164352))) { + b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)][chckIndx(j_1795164357, 0, (b_1795164354[chckIndx(i_1795164356, 0, (b_1795164354).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164339);; } - i_1795165388 = addInt(i_1795165388, 1); + i_1795165601 = addInt(i_1795165601, 1); } }; }; - i_1795165384 = addInt(i_1795165384, 1); + i_1795165597 = addInt(i_1795165597, 1); } }; }; }; + + +} + +function HEX3Aanonymous_1795164367(piece_1795164368, taking_1795164369, board_1795164370, state_1795164371) { + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164368.tile.Field1), mulInt(100, piece_1795164368.tile.Field0)), state_1795164371.Field0.randSeed))); + var dice_1795164372 = rand_1644167304(20); + piece_1795164368.timesMoved = addInt(piece_1795164368.timesMoved, 1); + if ((dice_1795164372 <= 3)) { + HEX5BHEX5D_1476395509(board_1795164370, taking_1795164369).color = piece_1795164368.color; + HEX5BHEX5D_1476395509(board_1795164370, taking_1795164369).index = newIndex_1476395640(state_1795164371); + pieceSwap_1476395980(piece_1795164368, HEX5BHEX5D_1476395509(board_1795164370, taking_1795164369), board_1795164370); + } + else { + var takeResult_1795164378 = board_1795164370[chckIndx(taking_1795164369.Field1, 0, (board_1795164370).length - 1)][chckIndx(taking_1795164369.Field0, 0, (board_1795164370[chckIndx(taking_1795164369.Field1, 0, (board_1795164370).length - 1)]).length - 1)].whenTaken(board_1795164370[chckIndx(taking_1795164369.Field1, 0, (board_1795164370).length - 1)][chckIndx(taking_1795164369.Field0, 0, (board_1795164370[chckIndx(taking_1795164369.Field1, 0, (board_1795164370).length - 1)]).length - 1)], piece_1795164368, board_1795164370, state_1795164371); + if (takeResult_1795164378.Field1) { + HEX5BHEX5D_1476395509(board_1795164370, takeResult_1795164378.Field0).piecesTaken = addInt(HEX5BHEX5D_1476395509(board_1795164370, takeResult_1795164378.Field0).piecesTaken, 1); + } + } } -function HEX3Aanonymous_1795164345(side_1795164346, __1795164347, b_1795164348) { +function HEX3Aanonymous_1795164386(side_1795164387, __1795164388, b_1795164389, __1795164390) { Label1: { - var i_1795164349 = 0; - var j_1795164350 = 0; + var i_1795164391 = 0; + var j_1795164392 = 0; Label2: { - var i_1795165374 = 0; - var i_1795165375 = 0; + var i_1795165614 = 0; + var i_1795165615 = 0; Label3: { Label4: while (true) { - if (!(i_1795165375 < 8)) break Label4; - i_1795165374 = i_1795165375; + if (!(i_1795165615 < 8)) break Label4; + i_1795165614 = i_1795165615; Label5: { - var j_1795165378 = 0; - var i_1795165379 = 0; + var j_1795165618 = 0; + var i_1795165619 = 0; Label6: { Label7: while (true) { - if (!(i_1795165379 < 8)) break Label7; - j_1795165378 = i_1795165379; - i_1795164349 = i_1795165374; - j_1795164350 = j_1795165378; - if (((b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)][chckIndx(j_1795164350, 0, (b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)]).length - 1)].item == 0) && isColor_1476395605(b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)][chckIndx(j_1795164350, 0, (b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)]).length - 1)], side_1795164346))) { - b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)][chckIndx(j_1795164350, 0, (b_1795164348[chckIndx(i_1795164349, 0, (b_1795164348).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164334);; + if (!(i_1795165619 < 8)) break Label7; + j_1795165618 = i_1795165619; + i_1795164391 = i_1795165614; + j_1795164392 = j_1795165618; + if (((b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)][chckIndx(j_1795164392, 0, (b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)]).length - 1)].item == 2) && isColor_1476396138(b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)][chckIndx(j_1795164392, 0, (b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)]).length - 1)], side_1795164387))) { + b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)][chckIndx(j_1795164392, 0, (b_1795164389[chckIndx(i_1795164391, 0, (b_1795164389).length - 1)]).length - 1)].onTake = HEX3Aanonymous_1795164367; } - i_1795165379 = addInt(i_1795165379, 1); + i_1795165619 = addInt(i_1795165619, 1); } }; }; - i_1795165375 = addInt(i_1795165375, 1); + i_1795165615 = addInt(i_1795165615, 1); } }; }; @@ -5225,35 +5548,35 @@ function HEX3Aanonymous_1795164345(side_1795164346, __1795164347, b_1795164348) } -function HEX3Aanonymous_1795164432(piece_1795164433, board_1795164434) { +function HEX3Aanonymous_1795164443(piece_1795164444, board_1795164445, state_1795164446) { Label1: { - var i_1795164435 = 0; - var j_1795164436 = 0; + var i_1795164447 = 0; + var j_1795164448 = 0; Label2: { - var i_1795165401 = 0; - var i_1795165402 = 0; + var i_1795165632 = 0; + var i_1795165633 = 0; Label3: { Label4: while (true) { - if (!(i_1795165402 < 8)) break Label4; - i_1795165401 = i_1795165402; + if (!(i_1795165633 < 8)) break Label4; + i_1795165632 = i_1795165633; Label5: { - var j_1795165405 = 0; - var i_1795165406 = 0; + var j_1795165636 = 0; + var i_1795165637 = 0; Label6: { Label7: while (true) { - if (!(i_1795165406 < 8)) break Label7; - j_1795165405 = i_1795165406; - i_1795164435 = i_1795165401; - j_1795164436 = j_1795165405; - if (board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)][chckIndx(j_1795164436, 0, (board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)]).length - 1)].promoted) { - board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)][chckIndx(j_1795164436, 0, (board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)]).length - 1)] = nimCopy(board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)][chckIndx(j_1795164436, 0, (board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)]).length - 1)], pieceCopy_1476395495(air_1493172398, 6, 1, 0, 0, board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)][chckIndx(j_1795164436, 0, (board_1795164434[chckIndx(i_1795164435, 0, (board_1795164434).length - 1)]).length - 1)].tile, [], [], air_1493172398.onMove, air_1493172398.onTake, air_1493172398.whenTaken, [], [], false, [], true, false, air_1493172398.rand, air_1493172398.wallet), NTI1476395026); + if (!(i_1795165637 < 8)) break Label7; + j_1795165636 = i_1795165637; + i_1795164447 = i_1795165632; + j_1795164448 = j_1795165636; + if (board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)][chckIndx(j_1795164448, 0, (board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)]).length - 1)].promoted) { + board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)][chckIndx(j_1795164448, 0, (board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)]).length - 1)] = nimCopy(board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)][chckIndx(j_1795164448, 0, (board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, newIndex_1476395640(state_1795164446), 6, 1, 0, 0, board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)][chckIndx(j_1795164448, 0, (board_1795164445[chckIndx(i_1795164447, 0, (board_1795164445).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } - i_1795165406 = addInt(i_1795165406, 1); + i_1795165637 = addInt(i_1795165637, 1); } }; }; - i_1795165402 = addInt(i_1795165402, 1); + i_1795165633 = addInt(i_1795165633, 1); } }; }; @@ -5262,35 +5585,35 @@ function HEX3Aanonymous_1795164432(piece_1795164433, board_1795164434) { } -function HEX3Aanonymous_1795164438(side_1795164439, __1795164440, b_1795164441) { +function HEX3Aanonymous_1795164450(side_1795164451, __1795164452, b_1795164453, __1795164454) { Label1: { - var i_1795164442 = 0; - var j_1795164443 = 0; + var i_1795164455 = 0; + var j_1795164456 = 0; Label2: { - var i_1795165392 = 0; - var i_1795165393 = 0; + var i_1795165623 = 0; + var i_1795165624 = 0; Label3: { Label4: while (true) { - if (!(i_1795165393 < 8)) break Label4; - i_1795165392 = i_1795165393; + if (!(i_1795165624 < 8)) break Label4; + i_1795165623 = i_1795165624; Label5: { - var j_1795165396 = 0; - var i_1795165397 = 0; + var j_1795165627 = 0; + var i_1795165628 = 0; Label6: { Label7: while (true) { - if (!(i_1795165397 < 8)) break Label7; - j_1795165396 = i_1795165397; - i_1795164442 = i_1795165392; - j_1795164443 = j_1795165396; - if (((b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)][chckIndx(j_1795164443, 0, (b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)]).length - 1)].item == 0) && isColor_1476395605(b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)][chckIndx(j_1795164443, 0, (b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)]).length - 1)], side_1795164439))) { - b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)][chckIndx(j_1795164443, 0, (b_1795164441[chckIndx(i_1795164442, 0, (b_1795164441).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164432);; + if (!(i_1795165628 < 8)) break Label7; + j_1795165627 = i_1795165628; + i_1795164455 = i_1795165623; + j_1795164456 = j_1795165627; + if (((b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)][chckIndx(j_1795164456, 0, (b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)]).length - 1)].item == 0) && isColor_1476396138(b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)][chckIndx(j_1795164456, 0, (b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)]).length - 1)], side_1795164451))) { + b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)][chckIndx(j_1795164456, 0, (b_1795164453[chckIndx(i_1795164455, 0, (b_1795164453).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164443);; } - i_1795165397 = addInt(i_1795165397, 1); + i_1795165628 = addInt(i_1795165628, 1); } }; }; - i_1795165393 = addInt(i_1795165393, 1); + i_1795165624 = addInt(i_1795165624, 1); } }; }; @@ -5299,34 +5622,34 @@ function HEX3Aanonymous_1795164438(side_1795164439, __1795164440, b_1795164441) } -function HEX3Aanonymous_1795164453(side_1795164454, __1795164455, b_1795164456) { +function HEX3Aanonymous_1795164466(side_1795164467, __1795164468, b_1795164469, state_1795164470) { var Temporary1; - randomize_1644167430(BigInt(b_1795164456[chckIndx(0, 0, (b_1795164456).length - 1)][chckIndx(0, 0, (b_1795164456[chckIndx(0, 0, (b_1795164456).length - 1)]).length - 1)].rand.Field1)); - var sleeper_1795164464 = rand_1644167304(8); - var failsafe_1795164472 = 9; - if ((side_1795164454 == 0)) { + randomize_1644167430(BigInt(state_1795164470.Field0.randSeed)); + var sleeper_1795164478 = rand_1644167304(7); + var failsafe_1795164486 = 9; + if ((side_1795164467 == 0)) { Temporary1 = 1; } else { Temporary1 = 6; } - var rank_1795164477 = Temporary1; + var rank_1795164491 = Temporary1; Label2: { Label3: while (true) { - if (!(!((b_1795164456[chckIndx(rank_1795164477, 0, (b_1795164456).length - 1)][chckIndx(sleeper_1795164464, 0, (b_1795164456[chckIndx(rank_1795164477, 0, (b_1795164456).length - 1)]).length - 1)].item == 3)) && !((failsafe_1795164472 == 0)))) break Label3; - sleeper_1795164464 = addInt(sleeper_1795164464, 1); - failsafe_1795164472 = subInt(failsafe_1795164472, 1); - sleeper_1795164464 = modInt(sleeper_1795164464, 8); + if (!(!((b_1795164469[chckIndx(rank_1795164491, 0, (b_1795164469).length - 1)][chckIndx(sleeper_1795164478, 0, (b_1795164469[chckIndx(rank_1795164491, 0, (b_1795164469).length - 1)]).length - 1)].item == 3)) && !((failsafe_1795164486 == 0)))) break Label3; + sleeper_1795164478 = addInt(sleeper_1795164478, 1); + failsafe_1795164486 = subInt(failsafe_1795164486, 1); + sleeper_1795164478 = modInt(sleeper_1795164478, 8); } }; - if (!((failsafe_1795164472 == 0))) { - if ((side_1795164454 == 0)) { - b_1795164456[chckIndx(1, 0, (b_1795164456).length - 1)][chckIndx(sleeper_1795164464, 0, (b_1795164456[chckIndx(1, 0, (b_1795164456).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939388);; + if (!((failsafe_1795164486 == 0))) { + if ((side_1795164467 == 0)) { + b_1795164469[chckIndx(1, 0, (b_1795164469).length - 1)][chckIndx(sleeper_1795164478, 0, (b_1795164469[chckIndx(1, 0, (b_1795164469).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939388);; } else { - b_1795164456[chckIndx(6, 0, (b_1795164456).length - 1)][chckIndx(sleeper_1795164464, 0, (b_1795164456[chckIndx(6, 0, (b_1795164456).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939383);; + b_1795164469[chckIndx(6, 0, (b_1795164469).length - 1)][chckIndx(sleeper_1795164478, 0, (b_1795164469[chckIndx(6, 0, (b_1795164469).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939383);; } } @@ -5335,209 +5658,264 @@ function HEX3Aanonymous_1795164453(side_1795164454, __1795164455, b_1795164456) } -function HEX3DHEX3D_1795164554(x_1795164556, y_1795164557) { - var result_1795164558 = false; - - BeforeRet: { - var sameObject_1795164565 = false; - sameObject_1795164565 = x_1795164556 === y_1795164557 - if (sameObject_1795164565) { - result_1795164558 = true; - break BeforeRet; - } +function alwaysCost_1828716773(cost_1828716774) { - if (!(((x_1795164556).length == (y_1795164557).length))) { - result_1795164558 = false; - break BeforeRet; +function HEX3Aanonymous_1828716776(piece_1828716777, b_1828716778, s_1828716779) { + var result_1828716780 = 0; + + BeforeRet: { + result_1828716780 = cost_1828716774; + break BeforeRet; + }; + + return result_1828716780; + } - + + var result_1828716775 = null; + + result_1828716775 = HEX3Aanonymous_1828716776; + + return result_1828716775; + +} + +function HEX3Aanonymous_1795164519(piece_1795164520, board_1795164521, state_1795164522) { Label1: { - var i_1795164579 = 0; - var colontmp__1795165419 = 0; - colontmp__1795165419 = subInt((x_1795164556).length, 1); - var res_1795165420 = 0; + var xHEX60gensym118_1795164527 = null; + var i_1795165650 = 0; + var L_1795165651 = (piece_1795164520.onPromote).length; Label2: { Label3: while (true) { - if (!(res_1795165420 <= colontmp__1795165419)) break Label3; - i_1795164579 = res_1795165420; - if (!((x_1795164556[chckIndx(i_1795164579, 0, (x_1795164556).length - 1)] == y_1795164557[chckIndx(i_1795164579, 0, (y_1795164557).length - 1)]))) { - result_1795164558 = false; - break BeforeRet; + if (!(i_1795165650 < L_1795165651)) break Label3; + xHEX60gensym118_1795164527 = piece_1795164520.onPromote[chckIndx(i_1795165650, 0, (piece_1795164520.onPromote).length - 1)]; + xHEX60gensym118_1795164527(piece_1795164520, board_1795164521, state_1795164522); + if (piece_1795164520.promoted) { + break Label1; + } + + i_1795165650 += 1; + if (!(((piece_1795164520.onPromote).length == L_1795165651))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } - res_1795165420 = addInt(res_1795165420, 1); } }; }; - result_1795164558 = true; - break BeforeRet; - }; - - return result_1795164558; + piece_1795164520.promoted = true; + } -function HEX3Aanonymous_1795164505(piece_1795164506, board_1795164507) { +function HEX3DHEX3D_1795164540(x_1795164542, y_1795164543) { + var result_1795164544 = false; + + BeforeRet: { + var sameObject_1795164551 = false; + sameObject_1795164551 = x_1795164542 === y_1795164543 + if (sameObject_1795164551) { + result_1795164544 = true; + break BeforeRet; + } + + if (!(((x_1795164542).length == (y_1795164543).length))) { + result_1795164544 = false; + break BeforeRet; + } + Label1: { - var pHEX60gensym118_1795164512 = null; - var i_1795165423 = 0; - var L_1795165424 = (piece_1795164506.onPromote).length; + var i_1795164565 = 0; + var colontmp__1795165654 = 0; + colontmp__1795165654 = subInt((x_1795164542).length, 1); + var res_1795165655 = 0; Label2: { Label3: while (true) { - if (!(i_1795165423 < L_1795165424)) break Label3; - pHEX60gensym118_1795164512 = piece_1795164506.onPromote[chckIndx(i_1795165423, 0, (piece_1795164506.onPromote).length - 1)]; - pHEX60gensym118_1795164512(piece_1795164506, board_1795164507); - if (piece_1795164506.promoted) { - break Label1; - } - - i_1795165423 += 1; - if (!(((piece_1795164506.onPromote).length == L_1795165424))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + if (!(res_1795165655 <= colontmp__1795165654)) break Label3; + i_1795164565 = res_1795165655; + if (!((x_1795164542[chckIndx(i_1795164565, 0, (x_1795164542).length - 1)] == y_1795164543[chckIndx(i_1795164565, 0, (y_1795164543).length - 1)]))) { + result_1795164544 = false; + break BeforeRet; } + res_1795165655 = addInt(res_1795165655, 1); } }; }; - piece_1795164506.promoted = true; + result_1795164544 = true; + break BeforeRet; + }; + + return result_1795164544; - } -function HEX3Aanonymous_1795164516(piece_1795164517, board_1795164518) { - var result_1795164519 = false; +function HEX3Aanonymous_1795164531(piece_1795164532, board_1795164533, s_1795164534) { + var result_1795164535 = false; BeforeRet: { - result_1795164519 = !(piece_1795164517.promoted); + result_1795164535 = (!(piece_1795164532.promoted) && !(HEX3DHEX3D_1795164540(piece_1795164532.onPromote, [HEX3Aanonymous_1476395595]))); break BeforeRet; }; - return result_1795164519; + return result_1795164535; + +} + +function some_1660946688(val_1660946690) { + var result_1660946691 = ({val: 0, has: false}); + + result_1660946691.has = true; + result_1660946691.val = val_1660946690; + + return result_1660946691; + +} + +function initWallet_1828716646(side_1828716647, s_1828716648) { + s_1828716648.Field1[chckIndx(side_1828716647, 0, (s_1828716648.Field1).length - 1)].wallet = nimCopy(s_1828716648.Field1[chckIndx(side_1828716647, 0, (s_1828716648.Field1).length - 1)].wallet, some_1660946688(0), NTI1476395090); + + +} + +function isSome_1660947689(self_1660947691) { + var result_1660947692 = false; + + result_1660947692 = self_1660947691.has; + + return result_1660947692; + +} + +function none_1476395149() { + var result_1476395156 = ({val: 0, has: false}); + + return result_1476395156; + +} + +function map_1828716622(self_1828716625, callback_1828716627) { + var Temporary1; + + var result_1828716628 = ({val: 0, has: false}); + + if (isSome_1660947689(self_1828716625)) { + Temporary1 = some_1660946688(callback_1828716627(self_1828716625.val)); + } + else { + Temporary1 = none_1476395149(); + } + + result_1828716628 = nimCopy(result_1828716628, Temporary1, NTI1476395090); + + return result_1828716628; + +} + +function addMoney_1828716586(side_1828716587, money_1828716588, s_1828716589) { + +function HEX3Aanonymous_1828716606(x_1828716617) { + var result_1828716621 = 0; + + result_1828716621 = addInt(x_1828716617, money_1828716588); + return result_1828716621; + + } + + if (!(isSome_1660947689(s_1828716589.Field1[chckIndx(side_1828716587, 0, (s_1828716589.Field1).length - 1)].wallet))) { + failedAssertImpl_268435541([99,97,112,105,116,97,108,105,115,109,46,110,105,109,40,49,55,44,32,53,41,32,96,115,46,115,105,100,101,91,115,105,100,101,93,46,119,97,108,108,101,116,46,105,115,83,111,109,101,40,41,96,32]); + } + + s_1828716589.Field1[chckIndx(side_1828716587, 0, (s_1828716589.Field1).length - 1)].wallet = nimCopy(s_1828716589.Field1[chckIndx(side_1828716587, 0, (s_1828716589.Field1).length - 1)].wallet, map_1828716622(s_1828716589.Field1[chckIndx(side_1828716587, 0, (s_1828716589.Field1).length - 1)].wallet, HEX3Aanonymous_1828716606), NTI1476395090); + + } -function moneyForTake_1795164521() { +function moneyForTake_1795164571() { -function HEX3Aanonymous_1795164524(piece_1795164525, b_1795164526) { - var allPiecesTaken_1795164527 = 0; +function HEX3Aanonymous_1795164574(piece_1795164575, b_1795164576, state_1795164577) { + var allPiecesTaken_1795164578 = 0; Label1: { - var i_1795164528 = 0; - var j_1795164529 = 0; + var i_1795164579 = 0; + var j_1795164580 = 0; Label2: { - var i_1795165428 = 0; - var i_1795165429 = 0; + var i_1795165659 = 0; + var i_1795165660 = 0; Label3: { Label4: while (true) { - if (!(i_1795165429 < 8)) break Label4; - i_1795165428 = i_1795165429; + if (!(i_1795165660 < 8)) break Label4; + i_1795165659 = i_1795165660; Label5: { - var j_1795165432 = 0; - var i_1795165433 = 0; + var j_1795165663 = 0; + var i_1795165664 = 0; Label6: { Label7: while (true) { - if (!(i_1795165433 < 8)) break Label7; - j_1795165432 = i_1795165433; - i_1795164528 = i_1795165428; - j_1795164529 = j_1795165432; - if (sameColor_1476395596(b_1795164526[chckIndx(i_1795164528, 0, (b_1795164526).length - 1)][chckIndx(j_1795164529, 0, (b_1795164526[chckIndx(i_1795164528, 0, (b_1795164526).length - 1)]).length - 1)], piece_1795164525)) { - allPiecesTaken_1795164527 = addInt(allPiecesTaken_1795164527, b_1795164526[chckIndx(i_1795164528, 0, (b_1795164526).length - 1)][chckIndx(j_1795164529, 0, (b_1795164526[chckIndx(i_1795164528, 0, (b_1795164526).length - 1)]).length - 1)].piecesTaken); - } - - i_1795165433 = addInt(i_1795165433, 1); - } - }; - }; - i_1795165429 = addInt(i_1795165429, 1); - } - }; - }; - }; - if ((lastPiecesTaken_1795164523 < allPiecesTaken_1795164527)) { - Label8: { - var i_1795164534 = 0; - var j_1795164535 = 0; - Label9: { - var i_1795165437 = 0; - var i_1795165438 = 0; - Label10: { - Label11: while (true) { - if (!(i_1795165438 < 8)) break Label11; - i_1795165437 = i_1795165438; - Label12: { - var j_1795165441 = 0; - var i_1795165442 = 0; - Label13: { - Label14: while (true) { - if (!(i_1795165442 < 8)) break Label14; - j_1795165441 = i_1795165442; - i_1795164534 = i_1795165437; - j_1795164535 = j_1795165441; - if (((b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)][chckIndx(j_1795164535, 0, (b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)]).length - 1)].item == 0) && sameColor_1476395596(b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)][chckIndx(j_1795164535, 0, (b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)]).length - 1)], piece_1795164525))) { - b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)][chckIndx(j_1795164535, 0, (b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)]).length - 1)].wallet.Field0 = addInt(b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)][chckIndx(j_1795164535, 0, (b_1795164526[chckIndx(i_1795164534, 0, (b_1795164526).length - 1)]).length - 1)].wallet.Field0, mulInt(3, subInt(allPiecesTaken_1795164527, lastPiecesTaken_1795164523))); + if (!(i_1795165664 < 8)) break Label7; + j_1795165663 = i_1795165664; + i_1795164579 = i_1795165659; + j_1795164580 = j_1795165663; + if (sameColor_1476396129(b_1795164576[chckIndx(i_1795164579, 0, (b_1795164576).length - 1)][chckIndx(j_1795164580, 0, (b_1795164576[chckIndx(i_1795164579, 0, (b_1795164576).length - 1)]).length - 1)], piece_1795164575)) { + allPiecesTaken_1795164578 = addInt(allPiecesTaken_1795164578, b_1795164576[chckIndx(i_1795164579, 0, (b_1795164576).length - 1)][chckIndx(j_1795164580, 0, (b_1795164576[chckIndx(i_1795164579, 0, (b_1795164576).length - 1)]).length - 1)].piecesTaken); } - i_1795165442 = addInt(i_1795165442, 1); + i_1795165664 = addInt(i_1795165664, 1); } }; }; - i_1795165438 = addInt(i_1795165438, 1); + i_1795165660 = addInt(i_1795165660, 1); } }; }; }; + if ((lastPiecesTaken_1795164573 < allPiecesTaken_1795164578)) { + addMoney_1828716586(piece_1795164575.color, 3, state_1795164577); } - lastPiecesTaken_1795164523 = allPiecesTaken_1795164527; + lastPiecesTaken_1795164573 = allPiecesTaken_1795164578; } - var result_1795164522 = null; + var result_1795164572 = null; - var lastPiecesTaken_1795164523 = 0; - result_1795164522 = HEX3Aanonymous_1795164524; + var lastPiecesTaken_1795164573 = 0; + result_1795164572 = HEX3Aanonymous_1795164574; - return result_1795164522; + return result_1795164572; } -function HEX3Aanonymous_1795164544(side_1795164545, __1795164546, b_1795164547) { +function HEX3Aanonymous_1795164585(side_1795164586, __1795164587, b_1795164588, s_1795164589) { + s_1795164589.Field1[chckIndx(side_1795164586, 0, (s_1795164589.Field1).length - 1)].buys.push({Field0: [80,114,111,109,111,116,101], Field1: alwaysCost_1828716773(30), Field2: HEX3Aanonymous_1795164519, Field3: HEX3Aanonymous_1795164531});; + initWallet_1828716646(side_1795164586, s_1795164589); Label1: { - var i_1795164548 = 0; - var j_1795164549 = 0; + var i_1795164598 = 0; + var j_1795164599 = 0; Label2: { - var i_1795165411 = 0; - var i_1795165412 = 0; + var i_1795165642 = 0; + var i_1795165643 = 0; Label3: { Label4: while (true) { - if (!(i_1795165412 < 8)) break Label4; - i_1795165411 = i_1795165412; + if (!(i_1795165643 < 8)) break Label4; + i_1795165642 = i_1795165643; Label5: { - var j_1795165415 = 0; - var i_1795165416 = 0; + var j_1795165646 = 0; + var i_1795165647 = 0; Label6: { Label7: while (true) { - if (!(i_1795165416 < 8)) break Label7; - j_1795165415 = i_1795165416; - i_1795164548 = i_1795165411; - j_1795164549 = j_1795165415; - if (isColor_1476395605(b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)], side_1795164545)) { - if (!(HEX3DHEX3D_1795164554(b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)].onPromote, [HEX3Aanonymous_1476395438]))) { - b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)].wallet.Field1.push({Field0: [80,114,111,109,111,116,101], Field1: 21, Field2: HEX3Aanonymous_1795164505, Field3: HEX3Aanonymous_1795164516});; - } - - b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)].wallet.Field0 = 0; - if ((b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)].item == 0)) { - b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)][chckIndx(j_1795164549, 0, (b_1795164547[chckIndx(i_1795164548, 0, (b_1795164547).length - 1)]).length - 1)].onEndTurn.push(moneyForTake_1795164521());; + if (!(i_1795165647 < 8)) break Label7; + j_1795165646 = i_1795165647; + i_1795164598 = i_1795165642; + j_1795164599 = j_1795165646; + if (((b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)][chckIndx(j_1795164599, 0, (b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)]).length - 1)].item == 0) && (b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)][chckIndx(j_1795164599, 0, (b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)]).length - 1)].color == side_1795164586))) { + b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)][chckIndx(j_1795164599, 0, (b_1795164588[chckIndx(i_1795164598, 0, (b_1795164588).length - 1)]).length - 1)].onEndTurn.push(moneyForTake_1795164571());; } - } - - i_1795165416 = addInt(i_1795165416, 1); + i_1795165647 = addInt(i_1795165647, 1); } }; }; - i_1795165412 = addInt(i_1795165412, 1); + i_1795165643 = addInt(i_1795165643, 1); } }; }; @@ -5546,151 +5924,525 @@ function HEX3Aanonymous_1795164544(side_1795164545, __1795164546, b_1795164547) } -function registerSynergy_1728053325(s_1728053326, secret_1728053327, secretSecret_1728053328) { - var Temporary4; - var Temporary5; - var Temporary6; +function some_1795165108(val_1795165110) { + var result_1795165111 = ({val: {Field0: 0, Field1: null, Field2: null}, has: false}); - if (!((secret_1728053327 || !(secretSecret_1728053328)))) { - failedAssertImpl_268435541([112,111,119,101,114,46,110,105,109,40,56,51,44,32,53,41,32,96,115,101,99,114,101,116,32,111,114,32,110,111,116,32,115,101,99,114,101,116,83,101,99,114,101,116,96,32]); - } - - var x_1728053334 = nimCopy(null, s_1728053326, NTI1728053254); - x_1728053334.Field0.rarity = x_1728053334.Field1; - x_1728053334.Field0.index = addInt(powers_1728053317[0][chckIndx(subInt((powers_1728053317[0]).length, 1), 0, (powers_1728053317[0]).length - 1)].index, 1); - x_1728053334.Field4 = x_1728053334.Field0.index; - var sHEX60gensym2_1728053343 = nimCopy(null, s_1728053326.Field2, NTI1728053259); - var nHEX60gensym2_1728053347 = (sHEX60gensym2_1728053343).length; - if (!((0 < nHEX60gensym2_1728053347))) { - failedAssertImpl_268435541([115,101,113,117,116,105,108,115,46,110,105,109,40,57,55,55,44,32,51,41,32,96,110,96,103,101,110,115,121,109,50,32,62,32,48,96,32,67,97,110,39,116,32,102,111,108,100,32,101,109,112,116,121,32,115,101,113,117,101,110,99,101,115]); + result_1795165111.has = true; + result_1795165111.val = nimCopy(result_1795165111.val, val_1795165110, NTI1476395030); + + return result_1795165111; + +} + +function HEX3Aanonymous_1795164999(piece_1795165000, to_1795165001, b_1795165002, s_1795165003) { + BeforeRet: { + if (!((b_1795165002[chckIndx(to_1795165001.Field1, 0, (b_1795165002).length - 1)][chckIndx(to_1795165001.Field0, 0, (b_1795165002[chckIndx(to_1795165001.Field1, 0, (b_1795165002).length - 1)]).length - 1)].item == 6))) { + break BeforeRet; } - var resultHEX60gensym2_1728053353 = nimCopy(null, sHEX60gensym2_1728053343[chckIndx(subInt(nHEX60gensym2_1728053347, 1), 0, (sHEX60gensym2_1728053343).length - 1)], NTI33554449); - Label1: { - var iHEX60gensym2_1728053359 = 0; - var colontmp__1795165445 = 0; - colontmp__1795165445 = subInt(nHEX60gensym2_1728053347, 2); - var res_1795165447 = colontmp__1795165445; - Label2: { - Label3: while (true) { - if (!(0 <= res_1795165447)) break Label3; - iHEX60gensym2_1728053359 = res_1795165447; - var a_1728053360 = nimCopy(null, sHEX60gensym2_1728053343[chckIndx(iHEX60gensym2_1728053359, 0, (sHEX60gensym2_1728053343).length - 1)], NTI33554449); - var b_1728053361 = nimCopy(null, resultHEX60gensym2_1728053353, NTI33554449); - resultHEX60gensym2_1728053353 = nimCopy(null, (a_1728053360 || []).concat([32,43,32] || [],b_1728053361 || []), NTI33554449); - res_1795165447 = subInt(res_1795165447, 1); - } - }; - }; - var requirements_1728053362 = nimCopy(null, resultHEX60gensym2_1728053353, NTI33554449); - if ((secret_1728053327 && !(secretSecret_1728053328))) { - x_1728053334.Field0.description = nimCopy(null, ([83,101,99,114,101,116,32,115,121,110,101,114,103,121,33,32,40] || []).concat(requirements_1728053362 || [],[41,32,45,45,32] || [],x_1728053334.Field0.description || []), NTI33554449); - if (eqStrings(x_1728053334.Field0.technicalName, [])) { - Temporary4 = (x_1728053334.Field0.name || []).concat([32,40,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + piece_1795165000.onMove(piece_1795165000, to_1795165001, b_1795165002, s_1795165003); + }; + + +} + +function HEX5BHEX5D_1476395457(b_1476395458, tile_1476395459) { + var result_1476395460 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + + BeforeRet: { + result_1476395460 = nimCopy(result_1476395460, b_1476395458[chckIndx(tile_1476395459.Field1, 0, (b_1476395458).length - 1)][chckIndx(tile_1476395459.Field0, 0, (b_1476395458[chckIndx(tile_1476395459.Field1, 0, (b_1476395458).length - 1)]).length - 1)], NTI1476395032); + break BeforeRet; + }; + + return result_1476395460; + +} + +function getPiecesChecking_1476396252(b_1476396253, c_1476396254) { + var result_1476396255 = []; + + var kingTile_1476396256 = nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011); + Label1: { + var row_1476396261 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_1795165681 = 0; + Label2: { + Label3: while (true) { + if (!true) break Label3; + row_1476396261 = nimCopy(row_1476396261, b_1476396253[chckIndx(i_1795165681, 0, (b_1476396253).length - 1)], NTI1476395012); + Label4: { + var p_1476396266 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_1795165678 = 0; + Label5: { + Label6: while (true) { + if (!true) break Label6; + p_1476396266 = nimCopy(p_1476396266, row_1476396261[chckIndx(i_1795165678, 0, (row_1476396261).length - 1)], NTI1476395032); + if (((p_1476396266.item == 0) && isColor_1476396138(p_1476396266, c_1476396254))) { + kingTile_1476396256 = nimCopy(kingTile_1476396256, p_1476396266.tile, NTI1476395011); + } + + if ((7 <= i_1795165678)) { + break Label5; + } + + i_1795165678 += 1; + } + }; + }; + if ((7 <= i_1795165681)) { + break Label2; + } + + i_1795165681 += 1; + } + }; + }; + Label7: { + var row_1476396275 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_1795165687 = 0; + Label8: { + Label9: while (true) { + if (!true) break Label9; + row_1476396275 = nimCopy(row_1476396275, b_1476396253[chckIndx(i_1795165687, 0, (b_1476396253).length - 1)], NTI1476395012); + Label10: { + var p_1476396280 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_1795165685 = 0; + Label11: { + Label12: while (true) { + if (!true) break Label12; + p_1476396280 = nimCopy(p_1476396280, row_1476396275[chckIndx(i_1795165685, 0, (row_1476396275).length - 1)], NTI1476395032); + if ((!(isColor_1476396138(p_1476396280, c_1476396254)) && contains_1476395806(getTakesOn_1476395656(p_1476396280, b_1476396253), kingTile_1476396256))) { + var Temporary13 = nimCopy(null, p_1476396280.tile, NTI1476395011); + result_1476396255.push(Temporary13);; + } + + if ((7 <= i_1795165685)) { + break Label11; + } + + i_1795165685 += 1; + } + }; + }; + if ((7 <= i_1795165687)) { + break Label8; + } + + i_1795165687 += 1; + } + }; + }; + + return result_1476396255; + +} + +function wouldCheckAt_1476396289(p_1476396290, at_1476396291, b_1476396292) { + var result_1476396293 = false; + + BeforeRet: { + var testboard_1476396294 = [nimCopy(null, b_1476396292, NTI1476395013)]; + var testpiece_1476396295 = [nimCopy(null, p_1476396290, NTI1476395032)]; + var emptyState_1476396296 = [{Field0: ({nextIndex: 0, nextGroup: 0, randSeed: 0, turnNumber: 0}), Field1: [({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]}), ({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]})]}]; + pieceMove_1476395965(testpiece_1476396295[0], at_1476396291, testboard_1476396294[0], emptyState_1476396296[0]); + result_1476396293 = ((getPiecesChecking_1476396252(b_1476396292, otherSide_1476396146(p_1476396290.color))).length < (getPiecesChecking_1476396252(testboard_1476396294[0], otherSide_1476396146(p_1476396290.color))).length); + break BeforeRet; + }; + + return result_1476396293; + +} + +function HEX3Aanonymous_1795164975(side_1795164976, piece_1795164977, b_1795164978, __1795164979) { + var result_1795164980 = []; + + BeforeRet: { + if (!((piece_1795164977.color == side_1795164976))) { + result_1795164980 = nimCopy(null, [], NTI1543504077); + break BeforeRet; + } + else { + Label1: { + var tile_1795164989 = {Field0: 0, Field1: 0}; + Label2: { + var i_1795165668 = 0; + var i_1795165669 = 0; + Label3: { + Label4: while (true) { + if (!(i_1795165669 < 8)) break Label4; + i_1795165668 = i_1795165669; + Label5: { + var j_1795165672 = 0; + var i_1795165673 = 0; + Label6: { + Label7: while (true) { + if (!(i_1795165673 < 8)) break Label7; + j_1795165672 = i_1795165673; + tile_1795164989 = nimCopy(tile_1795164989, {Field0: i_1795165668, Field1: j_1795165672}, NTI1476395011); + if (((HEX5BHEX5D_1476395457(b_1795164978, tile_1795164989).item == 6) && !(wouldCheckAt_1476396289(piece_1795164977, tile_1795164989, b_1795164978)))) { + var Temporary8 = nimCopy(null, tile_1795164989, NTI1476395011); + result_1795164980.push(Temporary8);; + } + + i_1795165673 = addInt(i_1795165673, 1); + } + }; + }; + i_1795165669 = addInt(i_1795165669, 1); + } + }; + }; + }; + } + + }; + + return result_1795164980; + +} + +function HEX3Aanonymous_1795165100(side_1795165101, __1795165102, __1795165103, s_1795165104) { + s_1795165104.Field1[chckIndx(side_1795165101, 0, (s_1795165104.Field1).length - 1)].glass[chckIndx(0, 0, (s_1795165104.Field1[chckIndx(side_1795165101, 0, (s_1795165104.Field1).length - 1)].glass).length - 1)] = nimCopy(s_1795165104.Field1[chckIndx(side_1795165101, 0, (s_1795165104.Field1).length - 1)].glass[chckIndx(0, 0, (s_1795165104.Field1[chckIndx(side_1795165101, 0, (s_1795165104.Field1).length - 1)].glass).length - 1)], some_1795165108({Field0: 2, Field1: HEX3Aanonymous_1795164999, Field2: HEX3Aanonymous_1795164975}), NTI1476395068); + + +} + +function createZeroGlassAction_1795165028(side_1795165029) { + +function HEX3Aanonymous_1795165031(__1795165032, to_1795165033, b_1795165034, s_1795165035) { + BeforeRet: { + if ((b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)][chckIndx(to_1795165033.Field0, 0, (b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)]).length - 1)].item == 6)) { + break BeforeRet; + } + + b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)][chckIndx(to_1795165033.Field0, 0, (b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)]).length - 1)] = nimCopy(b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)][chckIndx(to_1795165033.Field0, 0, (b_1795165034[chckIndx(to_1795165033.Field1, 0, (b_1795165034).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, HEX5BHEX5D_1476395509(b_1795165034, to_1795165033).index, 6, 1, 0, 0, to_1795165033, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); + s_1795165035.Field1[chckIndx(side_1795165029, 0, (s_1795165035.Field1).length - 1)].abilityTakes = addInt(s_1795165035.Field1[chckIndx(side_1795165029, 0, (s_1795165035.Field1).length - 1)].abilityTakes, 1); + }; + + + } + + var result_1795165030 = null; + + result_1795165030 = HEX3Aanonymous_1795165031; + + return result_1795165030; + +} + +function HEX3Aanonymous_1795165011(side_1795165012, piece_1795165013, b_1795165014, __1795165015) { + var result_1795165016 = []; + + Label1: { + var i_1795165017 = 0; + var j_1795165018 = 0; + Label2: { + var i_1795165691 = 0; + var i_1795165692 = 0; + Label3: { + Label4: while (true) { + if (!(i_1795165692 < 8)) break Label4; + i_1795165691 = i_1795165692; + Label5: { + var j_1795165695 = 0; + var i_1795165696 = 0; + Label6: { + Label7: while (true) { + if (!(i_1795165696 < 8)) break Label7; + j_1795165695 = i_1795165696; + i_1795165017 = i_1795165691; + j_1795165018 = j_1795165695; + if (!((b_1795165014[chckIndx(i_1795165017, 0, (b_1795165014).length - 1)][chckIndx(j_1795165018, 0, (b_1795165014[chckIndx(i_1795165017, 0, (b_1795165014).length - 1)]).length - 1)].item == 0))) { + var Temporary8 = nimCopy(null, b_1795165014[chckIndx(i_1795165017, 0, (b_1795165014).length - 1)][chckIndx(j_1795165018, 0, (b_1795165014[chckIndx(i_1795165017, 0, (b_1795165014).length - 1)]).length - 1)].tile, NTI1476395011); + result_1795165016.push(Temporary8);; + } + + i_1795165696 = addInt(i_1795165696, 1); + } + }; + }; + i_1795165692 = addInt(i_1795165692, 1); + } + }; + }; + }; + + return result_1795165016; + +} + +function HEX3Aanonymous_1795165114(side_1795165115, __1795165116, __1795165117, s_1795165118) { + s_1795165118.Field1[chckIndx(side_1795165115, 0, (s_1795165118.Field1).length - 1)].glass[chckIndx(1, 0, (s_1795165118.Field1[chckIndx(side_1795165115, 0, (s_1795165118.Field1).length - 1)].glass).length - 1)] = nimCopy(s_1795165118.Field1[chckIndx(side_1795165115, 0, (s_1795165118.Field1).length - 1)].glass[chckIndx(1, 0, (s_1795165118.Field1[chckIndx(side_1795165115, 0, (s_1795165118.Field1).length - 1)].glass).length - 1)], some_1795165108({Field0: 2, Field1: createZeroGlassAction_1795165028(side_1795165115), Field2: HEX3Aanonymous_1795165011}), NTI1476395068); + + +} + +function HEX3Aanonymous_1795165084(piece_1795165085, to_1795165086, b_1795165087, s_1795165088) { + BeforeRet: { + if ((b_1795165087[chckIndx(to_1795165086.Field1, 0, (b_1795165087).length - 1)][chckIndx(to_1795165086.Field0, 0, (b_1795165087[chckIndx(to_1795165086.Field1, 0, (b_1795165087).length - 1)]).length - 1)].item == 6)) { + break BeforeRet; + } + + piece_1795165085.onTake(piece_1795165085, to_1795165086, b_1795165087, s_1795165088); + }; + + +} + +function HEX3Aanonymous_1795165045(side_1795165046, piece_1795165047, b_1795165048, __1795165049) { + var result_1795165050 = []; + + BeforeRet: { + if (!(isAtEnd_1476396323(piece_1795165047))) { + if ((piece_1795165047.color == 1)) { + result_1795165050 = nimCopy(null, [nimCopy(null, tileAbove_1560281230(piece_1795165047.tile), NTI1476395011)], NTI1795164634); + break BeforeRet; + } + else { + result_1795165050 = nimCopy(null, [nimCopy(null, tileBelow_1560281233(piece_1795165047.tile), NTI1476395011)], NTI1795164634); + break BeforeRet; + } + + } + else { + result_1795165050 = nimCopy(null, [], NTI1543504077); + break BeforeRet; + } + + }; + + return result_1795165050; + +} + +function forward_1560281242(p_1560281243) { + var result_1560281244 = {Field0: 0, Field1: 0}; + + BeforeRet: { + if ((p_1560281243.color == 1)) { + result_1560281244 = nimCopy(result_1560281244, tileAbove_1560281230(p_1560281243.tile), NTI1476395011); + break BeforeRet; + } + else { + result_1560281244 = nimCopy(result_1560281244, tileBelow_1560281233(p_1560281243.tile), NTI1476395011); + break BeforeRet; + } + + }; + + return result_1560281244; + +} + +function HEX3Aanonymous_1795165126(piece_1795165127, __1795165128, state_1795165129) { + Label1: { + var i_1795165193 = 0; + var c_1795165194 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var i_1795165709 = 0; + var L_1795165710 = (piece_1795165127.casts).length; + Label2: { + Label3: while (true) { + if (!(i_1795165709 < L_1795165710)) break Label3; + i_1795165193 = i_1795165709; + c_1795165194 = nimCopy(c_1795165194, piece_1795165127.casts[chckIndx(i_1795165709, 0, (piece_1795165127.casts).length - 1)], NTI1476395023); + if ((c_1795165194.Field2 == 2)) { + piece_1795165127.casts[chckIndx(i_1795165193, 0, (piece_1795165127.casts).length - 1)].Field0 = nimCopy(piece_1795165127.casts[chckIndx(i_1795165193, 0, (piece_1795165127.casts).length - 1)].Field0, forward_1560281242(piece_1795165127), NTI1476395011); + } + + i_1795165709 += 1; + if (!(((piece_1795165127.casts).length == L_1795165710))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + + +} + +function HEX3Aanonymous_1795165201(side_1795165202, __1795165203, b_1795165204, s_1795165205) { + s_1795165205.Field1[chckIndx(side_1795165202, 0, (s_1795165205.Field1).length - 1)].glass[chckIndx(2, 0, (s_1795165205.Field1[chckIndx(side_1795165202, 0, (s_1795165205.Field1).length - 1)].glass).length - 1)] = nimCopy(s_1795165205.Field1[chckIndx(side_1795165202, 0, (s_1795165205.Field1).length - 1)].glass[chckIndx(2, 0, (s_1795165205.Field1[chckIndx(side_1795165202, 0, (s_1795165205.Field1).length - 1)].glass).length - 1)], some_1795165108({Field0: 3, Field1: HEX3Aanonymous_1795165084, Field2: HEX3Aanonymous_1795165045}), NTI1476395068); + Label1: { + var i_1795165212 = 0; + var j_1795165213 = 0; + Label2: { + var i_1795165700 = 0; + var i_1795165701 = 0; + Label3: { + Label4: while (true) { + if (!(i_1795165701 < 8)) break Label4; + i_1795165700 = i_1795165701; + Label5: { + var j_1795165704 = 0; + var i_1795165705 = 0; + Label6: { + Label7: while (true) { + if (!(i_1795165705 < 8)) break Label7; + j_1795165704 = i_1795165705; + i_1795165212 = i_1795165700; + j_1795165213 = j_1795165704; + if (isColor_1476396138(b_1795165204[chckIndx(i_1795165212, 0, (b_1795165204).length - 1)][chckIndx(j_1795165213, 0, (b_1795165204[chckIndx(i_1795165212, 0, (b_1795165204).length - 1)]).length - 1)], side_1795165202)) { + b_1795165204[chckIndx(i_1795165212, 0, (b_1795165204).length - 1)][chckIndx(j_1795165213, 0, (b_1795165204[chckIndx(i_1795165212, 0, (b_1795165204).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795165126);; + } + + i_1795165705 = addInt(i_1795165705, 1); + } + }; + }; + i_1795165701 = addInt(i_1795165701, 1); + } + }; + }; + }; + + +} + +function registerSynergy_1728053330(s_1728053331, secret_1728053332, secretSecret_1728053333) { + var Temporary4; + var Temporary5; + var Temporary6; + + if (!((secret_1728053332 || !(secretSecret_1728053333)))) { + failedAssertImpl_268435541([112,111,119,101,114,46,110,105,109,40,56,53,44,32,53,41,32,96,115,101,99,114,101,116,32,111,114,32,110,111,116,32,115,101,99,114,101,116,83,101,99,114,101,116,96,32]); + } + + var x_1728053339 = nimCopy(null, s_1728053331, NTI1728053255); + x_1728053339.Field0.rarity = x_1728053339.Field1; + x_1728053339.Field0.index = addInt(powers_1728053322[0][chckIndx(subInt((powers_1728053322[0]).length, 1), 0, (powers_1728053322[0]).length - 1)].index, 1); + x_1728053339.Field4 = x_1728053339.Field0.index; + var sHEX60gensym2_1728053348 = nimCopy(null, s_1728053331.Field2, NTI1728053260); + var nHEX60gensym2_1728053352 = (sHEX60gensym2_1728053348).length; + if (!((0 < nHEX60gensym2_1728053352))) { + failedAssertImpl_268435541([115,101,113,117,116,105,108,115,46,110,105,109,40,57,55,55,44,32,51,41,32,96,110,96,103,101,110,115,121,109,50,32,62,32,48,96,32,67,97,110,39,116,32,102,111,108,100,32,101,109,112,116,121,32,115,101,113,117,101,110,99,101,115]); + } + + var resultHEX60gensym2_1728053358 = nimCopy(null, sHEX60gensym2_1728053348[chckIndx(subInt(nHEX60gensym2_1728053352, 1), 0, (sHEX60gensym2_1728053348).length - 1)], NTI33554449); + Label1: { + var iHEX60gensym2_1728053364 = 0; + var colontmp__1795165713 = 0; + colontmp__1795165713 = subInt(nHEX60gensym2_1728053352, 2); + var res_1795165715 = colontmp__1795165713; + Label2: { + Label3: while (true) { + if (!(0 <= res_1795165715)) break Label3; + iHEX60gensym2_1728053364 = res_1795165715; + var a_1728053365 = nimCopy(null, sHEX60gensym2_1728053348[chckIndx(iHEX60gensym2_1728053364, 0, (sHEX60gensym2_1728053348).length - 1)], NTI33554449); + var b_1728053366 = nimCopy(null, resultHEX60gensym2_1728053358, NTI33554449); + resultHEX60gensym2_1728053358 = nimCopy(null, (a_1728053365 || []).concat([32,43,32] || [],b_1728053366 || []), NTI33554449); + res_1795165715 = subInt(res_1795165715, 1); + } + }; + }; + var requirements_1728053367 = nimCopy(null, resultHEX60gensym2_1728053358, NTI33554449); + if ((secret_1728053332 && !(secretSecret_1728053333))) { + x_1728053339.Field0.description = nimCopy(null, ([83,101,99,114,101,116,32,115,121,110,101,114,103,121,33,32,40] || []).concat(requirements_1728053367 || [],[41,32,45,45,32] || [],x_1728053339.Field0.description || []), NTI33554449); + if (eqStrings(x_1728053339.Field0.technicalName, [])) { + Temporary4 = (x_1728053339.Field0.name || []).concat([32,40,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } else { - Temporary4 = (x_1728053334.Field0.technicalName || []).concat([32,40,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + Temporary4 = (x_1728053339.Field0.technicalName || []).concat([32,40,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } - x_1728053334.Field0.technicalName = nimCopy(null, Temporary4, NTI33554449); + x_1728053339.Field0.technicalName = nimCopy(null, Temporary4, NTI33554449); } else { - if (!(secret_1728053327)) { - x_1728053334.Field0.description = nimCopy(null, ([83,121,110,101,114,103,121,33,32,40] || []).concat(requirements_1728053362 || [],[41,32] || [],x_1728053334.Field0.description || []), NTI33554449); - if (eqStrings(x_1728053334.Field0.technicalName, [])) { - Temporary5 = (x_1728053334.Field0.name || []).concat([32,40,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + if (!(secret_1728053332)) { + x_1728053339.Field0.description = nimCopy(null, ([83,121,110,101,114,103,121,33,32,40] || []).concat(requirements_1728053367 || [],[41,32] || [],x_1728053339.Field0.description || []), NTI33554449); + if (eqStrings(x_1728053339.Field0.technicalName, [])) { + Temporary5 = (x_1728053339.Field0.name || []).concat([32,40,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } else { - Temporary5 = (x_1728053334.Field0.technicalName || []).concat([32,40,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + Temporary5 = (x_1728053339.Field0.technicalName || []).concat([32,40,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } - x_1728053334.Field0.technicalName = nimCopy(null, Temporary5, NTI33554449); + x_1728053339.Field0.technicalName = nimCopy(null, Temporary5, NTI33554449); } else { - if (eqStrings(x_1728053334.Field0.technicalName, [])) { - Temporary6 = (x_1728053334.Field0.name || []).concat([32,40,83,101,99,114,101,116,32,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + if (eqStrings(x_1728053339.Field0.technicalName, [])) { + Temporary6 = (x_1728053339.Field0.name || []).concat([32,40,83,101,99,114,101,116,32,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } else { - Temporary6 = (x_1728053334.Field0.technicalName || []).concat([32,40,83,101,99,114,101,116,32,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053362 || [],[41] || []); + Temporary6 = (x_1728053339.Field0.technicalName || []).concat([32,40,83,101,99,114,101,116,32,83,101,99,114,101,116,32,83,121,110,101,114,103,121,32,111,102,32] || [],requirements_1728053367 || [],[41] || []); } - x_1728053334.Field0.technicalName = nimCopy(null, Temporary6, NTI33554449); + x_1728053339.Field0.technicalName = nimCopy(null, Temporary6, NTI33554449); } } - var Temporary7 = nimCopy(null, x_1728053334.Field0, NTI1728053253); - powers_1728053317[0].push(Temporary7);; - if (secretSecret_1728053328) { - var Temporary8 = nimCopy(null, x_1728053334, NTI1728053254); - secretSecretSynergies_1728053320[0].push(Temporary8);; + var Temporary7 = nimCopy(null, x_1728053339.Field0, NTI1728053254); + powers_1728053322[0].push(Temporary7);; + if (secretSecret_1728053333) { + var Temporary8 = nimCopy(null, x_1728053339, NTI1728053255); + secretSecretSynergies_1728053325[0].push(Temporary8);; } else { - if (secret_1728053327) { - var Temporary9 = nimCopy(null, x_1728053334, NTI1728053254); - secretSynergies_1728053319[0].push(Temporary9);; + if (secret_1728053332) { + var Temporary9 = nimCopy(null, x_1728053339, NTI1728053255); + secretSynergies_1728053324[0].push(Temporary9);; } else { - var Temporary10 = nimCopy(null, x_1728053334, NTI1728053254); - draftSynergies_1728053318[0].push(Temporary10);; + var Temporary10 = nimCopy(null, x_1728053339, NTI1728053255); + draftSynergies_1728053323[0].push(Temporary10);; } } } -function HEX3Aanonymous_1795162817(side_1795162818, viewerSide_1795162819, b_1795162820) { - HEX3Aanonymous_1795162329(side_1795162818, viewerSide_1795162819, b_1795162820); - HEX3Aanonymous_1795162412(side_1795162818, viewerSide_1795162819, b_1795162820); - HEX3Aanonymous_1795162572(side_1795162818, viewerSide_1795162819, b_1795162820); - HEX3Aanonymous_1795162619(side_1795162818, viewerSide_1795162819, b_1795162820); +function HEX3Aanonymous_1795162768(side_1795162769, viewerSide_1795162770, b_1795162771, s_1795162772) { + HEX3Aanonymous_1795162319(side_1795162769, viewerSide_1795162770, b_1795162771, s_1795162772); + HEX3Aanonymous_1795162403(side_1795162769, viewerSide_1795162770, b_1795162771, s_1795162772); + HEX3Aanonymous_1795162557(side_1795162769, viewerSide_1795162770, b_1795162771, s_1795162772); + HEX3Aanonymous_1795162605(side_1795162769, viewerSide_1795162770, b_1795162771, s_1795162772); } -function HEX3Aanonymous_1795163335(side_1795163336, viewSide_1795163337, b_1795163338) { - HEX3Aanonymous_1795162511(side_1795163336, viewSide_1795163337, b_1795163338); - HEX3Aanonymous_1795162521(side_1795163336, viewSide_1795163337, b_1795163338); - HEX3Aanonymous_1795162491(side_1795163336, viewSide_1795163337, b_1795163338); - HEX3Aanonymous_1795162501(side_1795163336, viewSide_1795163337, b_1795163338); +function HEX3Aanonymous_1795163320(side_1795163321, viewSide_1795163322, b_1795163323, state_1795163324) { + HEX3Aanonymous_1795162507(side_1795163321, viewSide_1795163322, b_1795163323, state_1795163324); + HEX3Aanonymous_1795162518(side_1795163321, viewSide_1795163322, b_1795163323, state_1795163324); + HEX3Aanonymous_1795162485(side_1795163321, viewSide_1795163322, b_1795163323, state_1795163324); + HEX3Aanonymous_1795162496(side_1795163321, viewSide_1795163322, b_1795163323, state_1795163324); } -function HEX3Aanonymous_1795163362(side_1795163363, viewSide_1795163364, b_1795163365) { +function HEX3Aanonymous_1795163348(side_1795163349, viewSide_1795163350, b_1795163351, __1795163352) { Label1: { - var i_1795163366 = 0; - var j_1795163367 = 0; + var i_1795163353 = 0; + var j_1795163354 = 0; Label2: { - var i_1795165451 = 0; - var i_1795165452 = 0; + var i_1795165719 = 0; + var i_1795165720 = 0; Label3: { Label4: while (true) { - if (!(i_1795165452 < 8)) break Label4; - i_1795165451 = i_1795165452; + if (!(i_1795165720 < 8)) break Label4; + i_1795165719 = i_1795165720; Label5: { - var j_1795165455 = 0; - var i_1795165456 = 0; + var j_1795165723 = 0; + var i_1795165724 = 0; Label6: { Label7: while (true) { - if (!(i_1795165456 < 8)) break Label7; - j_1795165455 = i_1795165456; - i_1795163366 = i_1795165451; - j_1795163367 = j_1795165455; - if (((b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)].item == 3) && isColor_1476395605(b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)], side_1795163363))) { - if ((b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)].color == 0)) { - b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939388);; + if (!(i_1795165724 < 8)) break Label7; + j_1795165723 = i_1795165724; + i_1795163353 = i_1795165719; + j_1795163354 = j_1795165723; + if (((b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)].item == 3) && isColor_1476396138(b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)], side_1795163349))) { + if ((b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)].color == 0)) { + b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939388);; } else { - if ((b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)].color == 1)) { - b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)][chckIndx(j_1795163367, 0, (b_1795163365[chckIndx(i_1795163366, 0, (b_1795163365).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939383);; + if ((b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)].color == 1)) { + b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)][chckIndx(j_1795163354, 0, (b_1795163351[chckIndx(i_1795163353, 0, (b_1795163351).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939383);; } } } - i_1795165456 = addInt(i_1795165456, 1); + i_1795165724 = addInt(i_1795165724, 1); } }; }; - i_1795165452 = addInt(i_1795165452, 1); + i_1795165720 = addInt(i_1795165720, 1); } }; }; @@ -5699,56 +6451,56 @@ function HEX3Aanonymous_1795163362(side_1795163363, viewSide_1795163364, b_17951 } -function HEX3Aanonymous_1811939615(board_1811939616, p_1811939617) { - var result_1811939618 = [[]]; +function HEX3Aanonymous_1811939592(board_1811939593, p_1811939594) { + var result_1811939595 = [[]]; - var _ = addIfFree_1509949448(result_1811939618, 0, board_1811939616, p_1811939617.tile, shooterFactory_1526726777(0, 1)); - var _ = addIfFree_1509949448(result_1811939618, 0, board_1811939616, p_1811939617.tile, shooterFactory_1526726777(0, 2)); + var _ = addIfFree_1543503880(result_1811939595, 0, board_1811939593, p_1811939594.tile, shooterFactory_1560281208(0, 1)); + var _ = addIfFree_1543503880(result_1811939595, 0, board_1811939593, p_1811939594.tile, shooterFactory_1560281208(0, 2)); - return result_1811939618[0]; + return result_1811939595[0]; } -function HEX3Aanonymous_1811939625(board_1811939626, p_1811939627) { - var result_1811939628 = [[]]; +function HEX3Aanonymous_1811939602(board_1811939603, p_1811939604) { + var result_1811939605 = [[]]; - var _ = addIfFree_1509949448(result_1811939628, 0, board_1811939626, p_1811939627.tile, shooterFactory_1526726777(0, (-1))); - var _ = addIfFree_1509949448(result_1811939628, 0, board_1811939626, p_1811939627.tile, shooterFactory_1526726777(0, (-2))); + var _ = addIfFree_1543503880(result_1811939605, 0, board_1811939603, p_1811939604.tile, shooterFactory_1560281208(0, (-1))); + var _ = addIfFree_1543503880(result_1811939605, 0, board_1811939603, p_1811939604.tile, shooterFactory_1560281208(0, (-2))); - return result_1811939628[0]; + return result_1811939605[0]; } -function HEX3Aanonymous_1795163441(side_1795163442, __1795163443, b_1795163444) { +function HEX3Aanonymous_1795163430(side_1795163431, __1795163432, b_1795163433, __1795163434) { Label1: { - var i_1795163445 = 0; - var j_1795163446 = 0; + var i_1795163435 = 0; + var j_1795163436 = 0; Label2: { - var i_1795165460 = 0; - var i_1795165461 = 0; + var i_1795165728 = 0; + var i_1795165729 = 0; Label3: { Label4: while (true) { - if (!(i_1795165461 < 8)) break Label4; - i_1795165460 = i_1795165461; + if (!(i_1795165729 < 8)) break Label4; + i_1795165728 = i_1795165729; Label5: { - var j_1795165464 = 0; - var i_1795165465 = 0; + var j_1795165732 = 0; + var i_1795165733 = 0; Label6: { Label7: while (true) { - if (!(i_1795165465 < 8)) break Label7; - j_1795165464 = i_1795165465; - i_1795163445 = i_1795165460; - j_1795163446 = j_1795165464; - if (((b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)][chckIndx(j_1795163446, 0, (b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)]).length - 1)].item == 2) && isColor_1476395605(b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)][chckIndx(j_1795163446, 0, (b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)]).length - 1)], side_1795163442))) { - add_1795162141(b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)][chckIndx(j_1795163446, 0, (b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1509949890, HEX3Aanonymous_1811939615, HEX3Aanonymous_1811939625]); - add_1795162141(b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)][chckIndx(j_1795163446, 0, (b_1795163444[chckIndx(i_1795163445, 0, (b_1795163444).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1509949895, HEX3Aanonymous_1811939620, HEX3Aanonymous_1811939630]); + if (!(i_1795165733 < 8)) break Label7; + j_1795165732 = i_1795165733; + i_1795163435 = i_1795165728; + j_1795163436 = j_1795165732; + if (((b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)][chckIndx(j_1795163436, 0, (b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)]).length - 1)].item == 2) && isColor_1476396138(b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)][chckIndx(j_1795163436, 0, (b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)]).length - 1)], side_1795163431))) { + add_1795162144(b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)][chckIndx(j_1795163436, 0, (b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1543504322, HEX3Aanonymous_1811939592, HEX3Aanonymous_1811939602]); + add_1795162144(b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)][chckIndx(j_1795163436, 0, (b_1795163433[chckIndx(i_1795163435, 0, (b_1795163433).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1543504327, HEX3Aanonymous_1811939597, HEX3Aanonymous_1811939607]); } - i_1795165465 = addInt(i_1795165465, 1); + i_1795165733 = addInt(i_1795165733, 1); } }; }; - i_1795165461 = addInt(i_1795165461, 1); + i_1795165729 = addInt(i_1795165729, 1); } }; }; @@ -5757,36 +6509,36 @@ function HEX3Aanonymous_1795163441(side_1795163442, __1795163443, b_1795163444) } -function HEX3Aanonymous_1795163620(piece_1795163621, board_1795163622) { - if ((piece_1795163621.piecesTaken == 3)) { +function HEX3Aanonymous_1795163617(piece_1795163618, board_1795163619, state_1795163620) { + if ((piece_1795163618.piecesTaken == 3)) { Label1: { - var i_1795163623 = 0; - var j_1795163624 = 0; + var i_1795163621 = 0; + var j_1795163622 = 0; Label2: { - var i_1795165478 = 0; - var i_1795165479 = 0; + var i_1795165746 = 0; + var i_1795165747 = 0; Label3: { Label4: while (true) { - if (!(i_1795165479 < 8)) break Label4; - i_1795165478 = i_1795165479; + if (!(i_1795165747 < 8)) break Label4; + i_1795165746 = i_1795165747; Label5: { - var j_1795165482 = 0; - var i_1795165483 = 0; + var j_1795165750 = 0; + var i_1795165751 = 0; Label6: { Label7: while (true) { - if (!(i_1795165483 < 8)) break Label7; - j_1795165482 = i_1795165483; - i_1795163623 = i_1795165478; - j_1795163624 = j_1795165482; - if (((board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)][chckIndx(j_1795163624, 0, (board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)]).length - 1)].item == 0) && !(sameColor_1476395596(board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)][chckIndx(j_1795163624, 0, (board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)]).length - 1)], piece_1795163621)))) { - board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)][chckIndx(j_1795163624, 0, (board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)]).length - 1)] = nimCopy(board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)][chckIndx(j_1795163624, 0, (board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)]).length - 1)], {item: 6, tile: nimCopy(null, board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)][chckIndx(j_1795163624, 0, (board_1795163622[chckIndx(i_1795163623, 0, (board_1795163622).length - 1)]).length - 1)].tile, NTI1476395011), timesMoved: 0, piecesTaken: 0, promoted: false, filePath: [], colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054), color: 0, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: []}, NTI1476395026); + if (!(i_1795165751 < 8)) break Label7; + j_1795165750 = i_1795165751; + i_1795163621 = i_1795165746; + j_1795163622 = j_1795165750; + if (((board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)].item == 0) && !(sameColor_1476396129(board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)], piece_1795163618)))) { + board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)] = nimCopy(board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)].index, 6, 1, 0, 0, board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)][chckIndx(j_1795163622, 0, (board_1795163619[chckIndx(i_1795163621, 0, (board_1795163619).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } - i_1795165483 = addInt(i_1795165483, 1); + i_1795165751 = addInt(i_1795165751, 1); } }; }; - i_1795165479 = addInt(i_1795165479, 1); + i_1795165747 = addInt(i_1795165747, 1); } }; }; @@ -5797,35 +6549,35 @@ function HEX3Aanonymous_1795163620(piece_1795163621, board_1795163622) { } -function HEX3Aanonymous_1795163630(side_1795163631, __1795163632, b_1795163633) { +function HEX3Aanonymous_1795163628(side_1795163629, __1795163630, b_1795163631, __1795163632) { Label1: { - var i_1795163634 = 0; - var j_1795163635 = 0; + var i_1795163633 = 0; + var j_1795163634 = 0; Label2: { - var i_1795165469 = 0; - var i_1795165470 = 0; + var i_1795165737 = 0; + var i_1795165738 = 0; Label3: { Label4: while (true) { - if (!(i_1795165470 < 8)) break Label4; - i_1795165469 = i_1795165470; + if (!(i_1795165738 < 8)) break Label4; + i_1795165737 = i_1795165738; Label5: { - var j_1795165473 = 0; - var i_1795165474 = 0; + var j_1795165741 = 0; + var i_1795165742 = 0; Label6: { Label7: while (true) { - if (!(i_1795165474 < 8)) break Label7; - j_1795165473 = i_1795165474; - i_1795163634 = i_1795165469; - j_1795163635 = j_1795165473; - if (((b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)][chckIndx(j_1795163635, 0, (b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)]).length - 1)].item == 0) && isColor_1476395605(b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)][chckIndx(j_1795163635, 0, (b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)]).length - 1)], side_1795163631))) { - b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)][chckIndx(j_1795163635, 0, (b_1795163633[chckIndx(i_1795163634, 0, (b_1795163633).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163620);; + if (!(i_1795165742 < 8)) break Label7; + j_1795165741 = i_1795165742; + i_1795163633 = i_1795165737; + j_1795163634 = j_1795165741; + if (((b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)][chckIndx(j_1795163634, 0, (b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)]).length - 1)].item == 0) && isColor_1476396138(b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)][chckIndx(j_1795163634, 0, (b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)]).length - 1)], side_1795163629))) { + b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)][chckIndx(j_1795163634, 0, (b_1795163631[chckIndx(i_1795163633, 0, (b_1795163631).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163617);; } - i_1795165474 = addInt(i_1795165474, 1); + i_1795165742 = addInt(i_1795165742, 1); } }; }; - i_1795165470 = addInt(i_1795165470, 1); + i_1795165738 = addInt(i_1795165738, 1); } }; }; @@ -5834,18 +6586,19 @@ function HEX3Aanonymous_1795163630(side_1795163631, __1795163632, b_1795163633) } -function HEX3Aanonymous_1795164389(piece_1795164390, taking_1795164391, board_1795164392) { - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164390.tile.Field1), mulInt(100, piece_1795164390.tile.Field0)), piece_1795164390.rand.Field1))); - var dice_1795164393 = rand_1644167304(20); - piece_1795164390.timesMoved = addInt(piece_1795164390.timesMoved, 1); - if ((dice_1795164393 <= 6)) { - board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)][chckIndx(taking_1795164391.Field0, 0, (board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)]).length - 1)].color = piece_1795164390.color; - pieceSwap_1476395429(piece_1795164390, board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)][chckIndx(taking_1795164391.Field0, 0, (board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)]).length - 1)], board_1795164392); +function HEX3Aanonymous_1795164398(piece_1795164399, taking_1795164400, board_1795164401, state_1795164402) { + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164399.tile.Field1), mulInt(100, piece_1795164399.tile.Field0)), state_1795164402.Field0.randSeed))); + var dice_1795164403 = rand_1644167304(20); + piece_1795164399.timesMoved = addInt(piece_1795164399.timesMoved, 1); + if ((dice_1795164403 <= 6)) { + HEX5BHEX5D_1476395509(board_1795164401, taking_1795164400).color = piece_1795164399.color; + HEX5BHEX5D_1476395509(board_1795164401, taking_1795164400).index = newIndex_1476395640(state_1795164402); + pieceSwap_1476395980(piece_1795164399, HEX5BHEX5D_1476395509(board_1795164401, taking_1795164400), board_1795164401); } else { - var takeResult_1795164399 = board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)][chckIndx(taking_1795164391.Field0, 0, (board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)]).length - 1)].whenTaken(board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)][chckIndx(taking_1795164391.Field0, 0, (board_1795164392[chckIndx(taking_1795164391.Field1, 0, (board_1795164392).length - 1)]).length - 1)], piece_1795164390, board_1795164392); - if (takeResult_1795164399.Field1) { - board_1795164392[chckIndx(takeResult_1795164399.Field0.Field1, 0, (board_1795164392).length - 1)][chckIndx(takeResult_1795164399.Field0.Field0, 0, (board_1795164392[chckIndx(takeResult_1795164399.Field0.Field1, 0, (board_1795164392).length - 1)]).length - 1)].piecesTaken = addInt(board_1795164392[chckIndx(takeResult_1795164399.Field0.Field1, 0, (board_1795164392).length - 1)][chckIndx(takeResult_1795164399.Field0.Field0, 0, (board_1795164392[chckIndx(takeResult_1795164399.Field0.Field1, 0, (board_1795164392).length - 1)]).length - 1)].piecesTaken, 1); + var takeResult_1795164409 = board_1795164401[chckIndx(taking_1795164400.Field1, 0, (board_1795164401).length - 1)][chckIndx(taking_1795164400.Field0, 0, (board_1795164401[chckIndx(taking_1795164400.Field1, 0, (board_1795164401).length - 1)]).length - 1)].whenTaken(board_1795164401[chckIndx(taking_1795164400.Field1, 0, (board_1795164401).length - 1)][chckIndx(taking_1795164400.Field0, 0, (board_1795164401[chckIndx(taking_1795164400.Field1, 0, (board_1795164401).length - 1)]).length - 1)], piece_1795164399, board_1795164401, state_1795164402); + if (takeResult_1795164409.Field1) { + HEX5BHEX5D_1476395509(board_1795164401, takeResult_1795164409.Field0).piecesTaken = addInt(HEX5BHEX5D_1476395509(board_1795164401, takeResult_1795164409.Field0).piecesTaken, 1); } } @@ -5854,35 +6607,35 @@ function HEX3Aanonymous_1795164389(piece_1795164390, taking_1795164391, board_17 } -function HEX3Aanonymous_1795164407(side_1795164408, __1795164409, b_1795164410) { +function HEX3Aanonymous_1795164417(side_1795164418, __1795164419, b_1795164420, __1795164421) { Label1: { - var i_1795164411 = 0; - var j_1795164412 = 0; + var i_1795164422 = 0; + var j_1795164423 = 0; Label2: { - var i_1795165487 = 0; - var i_1795165488 = 0; + var i_1795165755 = 0; + var i_1795165756 = 0; Label3: { Label4: while (true) { - if (!(i_1795165488 < 8)) break Label4; - i_1795165487 = i_1795165488; + if (!(i_1795165756 < 8)) break Label4; + i_1795165755 = i_1795165756; Label5: { - var j_1795165491 = 0; - var i_1795165492 = 0; + var j_1795165759 = 0; + var i_1795165760 = 0; Label6: { Label7: while (true) { - if (!(i_1795165492 < 8)) break Label7; - j_1795165491 = i_1795165492; - i_1795164411 = i_1795165487; - j_1795164412 = j_1795165491; - if (((b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)][chckIndx(j_1795164412, 0, (b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)]).length - 1)].item == 2) && isColor_1476395605(b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)][chckIndx(j_1795164412, 0, (b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)]).length - 1)], side_1795164408))) { - b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)][chckIndx(j_1795164412, 0, (b_1795164410[chckIndx(i_1795164411, 0, (b_1795164410).length - 1)]).length - 1)].onTake = HEX3Aanonymous_1795164389; + if (!(i_1795165760 < 8)) break Label7; + j_1795165759 = i_1795165760; + i_1795164422 = i_1795165755; + j_1795164423 = j_1795165759; + if (((b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)][chckIndx(j_1795164423, 0, (b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)]).length - 1)].item == 2) && isColor_1476396138(b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)][chckIndx(j_1795164423, 0, (b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)]).length - 1)], side_1795164418))) { + b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)][chckIndx(j_1795164423, 0, (b_1795164420[chckIndx(i_1795164422, 0, (b_1795164420).length - 1)]).length - 1)].onTake = HEX3Aanonymous_1795164398; } - i_1795165492 = addInt(i_1795165492, 1); + i_1795165760 = addInt(i_1795165760, 1); } }; }; - i_1795165488 = addInt(i_1795165488, 1); + i_1795165756 = addInt(i_1795165756, 1); } }; }; @@ -5891,114 +6644,114 @@ function HEX3Aanonymous_1795164407(side_1795164408, __1795164409, b_1795164410) } -function HEX3Aanonymous_1795162934(taken_1795162935, taker_1795162936, board_1795162937) { - var result_1795162940 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; +function HEX3Aanonymous_1795162890(taken_1795162891, taker_1795162892, board_1795162893, state_1795162894) { + var result_1795162897 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; BeforeRet: { - if (HEX3DHEX3D_1526726773(taken_1795162935.tile, taker_1795162936.tile)) { + if (HEX3DHEX3D_1560281204(taken_1795162891.tile, taker_1795162892.tile)) { Label1: { - var i_1795162941 = 0; - var j_1795162942 = 0; + var i_1795162898 = 0; + var j_1795162899 = 0; Label2: { - var i_1795165510 = 0; - var i_1795165511 = 0; + var i_1795165778 = 0; + var i_1795165779 = 0; Label3: { Label4: while (true) { - if (!(i_1795165511 < 8)) break Label4; - i_1795165510 = i_1795165511; + if (!(i_1795165779 < 8)) break Label4; + i_1795165778 = i_1795165779; Label5: { - var j_1795165514 = 0; - var i_1795165515 = 0; + var j_1795165782 = 0; + var i_1795165783 = 0; Label6: { Label7: while (true) { - if (!(i_1795165515 < 8)) break Label7; - j_1795165514 = i_1795165515; - i_1795162941 = i_1795165510; - j_1795162942 = j_1795165514; - if (sameColor_1476395596(board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)], taken_1795162935)) { + if (!(i_1795165783 < 8)) break Label7; + j_1795165782 = i_1795165783; + i_1795162898 = i_1795165778; + j_1795162899 = j_1795165782; + if (sameColor_1476396129(board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)], taken_1795162891)) { Label8: { - var pHEX60gensym41_1795162947 = null; - var colontmp__1795165505 = []; - colontmp__1795165505 = board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)].onPromote; - var i_1795165506 = 0; - var L_1795165507 = (colontmp__1795165505).length; + var xHEX60gensym41_1795162904 = null; + var colontmp__1795165773 = []; + colontmp__1795165773 = board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)].onPromote; + var i_1795165774 = 0; + var L_1795165775 = (colontmp__1795165773).length; Label9: { Label10: while (true) { - if (!(i_1795165506 < L_1795165507)) break Label10; - pHEX60gensym41_1795162947 = colontmp__1795165505[chckIndx(i_1795165506, 0, (colontmp__1795165505).length - 1)]; - pHEX60gensym41_1795162947(board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)], board_1795162937); - if (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)].promoted) { + if (!(i_1795165774 < L_1795165775)) break Label10; + xHEX60gensym41_1795162904 = colontmp__1795165773[chckIndx(i_1795165774, 0, (colontmp__1795165773).length - 1)]; + xHEX60gensym41_1795162904(board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)], board_1795162893, state_1795162894); + if (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)].promoted) { break Label8; } - i_1795165506 += 1; - if (!(((colontmp__1795165505).length == L_1795165507))) { + i_1795165774 += 1; + if (!(((colontmp__1795165773).length == L_1795165775))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)].moves.push(HEX3Aanonymous_1509949890);; - board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)][chckIndx(j_1795162942, 0, (board_1795162937[chckIndx(i_1795162941, 0, (board_1795162937).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1509949895);; + board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)].moves.push(HEX3Aanonymous_1543504322);; + board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)][chckIndx(j_1795162899, 0, (board_1795162893[chckIndx(i_1795162898, 0, (board_1795162893).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1543504327);; } - i_1795165515 = addInt(i_1795165515, 1); + i_1795165783 = addInt(i_1795165783, 1); } }; }; - i_1795165511 = addInt(i_1795165511, 1); + i_1795165779 = addInt(i_1795165779, 1); } }; }; }; - taken_1795162935 = nimCopy(taken_1795162935, pieceCopy_1476395495(air_1493172398, 6, 1, 0, 0, taken_1795162935.tile, [], [], air_1493172398.onMove, air_1493172398.onTake, air_1493172398.whenTaken, [], [], false, [], true, false, air_1493172398.rand, air_1493172398.wallet), NTI1476395026); - var colontmp__1795165517 = nimCopy(null, taken_1795162935.tile, NTI1476395011); - var colontmp__1795165518 = true; - result_1795162940 = nimCopy(result_1795162940, {Field0: nimCopy(null, colontmp__1795165517, NTI1476395011), Field1: colontmp__1795165518}, NTI1795162838); + taken_1795162891 = nimCopy(taken_1795162891, pieceCopy_1476396045(air_1526726831, taken_1795162891.index, 6, 1, 0, 0, taken_1795162891.tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); + var colontmp__1795165785 = nimCopy(null, taken_1795162891.tile, NTI1476395011); + var colontmp__1795165786 = true; + result_1795162897 = nimCopy(result_1795162897, {Field0: nimCopy(null, colontmp__1795165785, NTI1476395011), Field1: colontmp__1795165786}, NTI1795162811); break BeforeRet; } else { - result_1795162940 = nimCopy(result_1795162940, HEX3Aanonymous_1476395442(taken_1795162935, taker_1795162936, board_1795162937), NTI1795162838); + result_1795162897 = nimCopy(result_1795162897, HEX3Aanonymous_1476395989(taken_1795162891, taker_1795162892, board_1795162893, state_1795162894), NTI1795162811); break BeforeRet; } }; - return result_1795162940; + return result_1795162897; } -function HEX3Aanonymous_1795162959(side_1795162960, viewSide_1795162961, b_1795162962) { +function HEX3Aanonymous_1795162916(side_1795162917, viewSide_1795162918, b_1795162919, __1795162920) { Label1: { - var i_1795162963 = 0; - var j_1795162964 = 0; + var i_1795162921 = 0; + var j_1795162922 = 0; Label2: { - var i_1795165496 = 0; - var i_1795165497 = 0; + var i_1795165764 = 0; + var i_1795165765 = 0; Label3: { Label4: while (true) { - if (!(i_1795165497 < 8)) break Label4; - i_1795165496 = i_1795165497; + if (!(i_1795165765 < 8)) break Label4; + i_1795165764 = i_1795165765; Label5: { - var j_1795165500 = 0; - var i_1795165501 = 0; + var j_1795165768 = 0; + var i_1795165769 = 0; Label6: { Label7: while (true) { - if (!(i_1795165501 < 8)) break Label7; - j_1795165500 = i_1795165501; - i_1795162963 = i_1795165496; - j_1795162964 = j_1795165500; - if (((b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)][chckIndx(j_1795162964, 0, (b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)][chckIndx(j_1795162964, 0, (b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)]).length - 1)], side_1795162960))) { - b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)][chckIndx(j_1795162964, 0, (b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)]).length - 1)].whenTaken = HEX3Aanonymous_1795162934; - b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)][chckIndx(j_1795162964, 0, (b_1795162962[chckIndx(i_1795162963, 0, (b_1795162962).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939532);; + if (!(i_1795165769 < 8)) break Label7; + j_1795165768 = i_1795165769; + i_1795162921 = i_1795165764; + j_1795162922 = j_1795165768; + if (((b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)][chckIndx(j_1795162922, 0, (b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)][chckIndx(j_1795162922, 0, (b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)]).length - 1)], side_1795162917))) { + b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)][chckIndx(j_1795162922, 0, (b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)]).length - 1)].whenTaken = HEX3Aanonymous_1795162890; + b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)][chckIndx(j_1795162922, 0, (b_1795162919[chckIndx(i_1795162921, 0, (b_1795162919).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939509);; } - i_1795165501 = addInt(i_1795165501, 1); + i_1795165769 = addInt(i_1795165769, 1); } }; }; - i_1795165497 = addInt(i_1795165497, 1); + i_1795165765 = addInt(i_1795165765, 1); } }; }; @@ -6007,114 +6760,114 @@ function HEX3Aanonymous_1795162959(side_1795162960, viewSide_1795162961, b_17951 } -function HEX3Aanonymous_1795162988(taken_1795162989, taker_1795162990, board_1795162991) { - var result_1795162994 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; +function HEX3Aanonymous_1795162946(taken_1795162947, taker_1795162948, board_1795162949, state_1795162950) { + var result_1795162953 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; BeforeRet: { - if (HEX3DHEX3D_1526726773(taken_1795162989.tile, taker_1795162990.tile)) { + if (HEX3DHEX3D_1560281204(taken_1795162947.tile, taker_1795162948.tile)) { Label1: { - var i_1795162995 = 0; - var j_1795162996 = 0; + var i_1795162954 = 0; + var j_1795162955 = 0; Label2: { - var i_1795165535 = 0; - var i_1795165536 = 0; + var i_1795165803 = 0; + var i_1795165804 = 0; Label3: { Label4: while (true) { - if (!(i_1795165536 < 8)) break Label4; - i_1795165535 = i_1795165536; + if (!(i_1795165804 < 8)) break Label4; + i_1795165803 = i_1795165804; Label5: { - var j_1795165539 = 0; - var i_1795165540 = 0; + var j_1795165807 = 0; + var i_1795165808 = 0; Label6: { Label7: while (true) { - if (!(i_1795165540 < 8)) break Label7; - j_1795165539 = i_1795165540; - i_1795162995 = i_1795165535; - j_1795162996 = j_1795165539; - if (sameColor_1476395596(board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)], taken_1795162989)) { + if (!(i_1795165808 < 8)) break Label7; + j_1795165807 = i_1795165808; + i_1795162954 = i_1795165803; + j_1795162955 = j_1795165807; + if (sameColor_1476396129(board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)], taken_1795162947)) { Label8: { - var pHEX60gensym45_1795163001 = null; - var colontmp__1795165530 = []; - colontmp__1795165530 = board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)].onPromote; - var i_1795165531 = 0; - var L_1795165532 = (colontmp__1795165530).length; + var xHEX60gensym45_1795162960 = null; + var colontmp__1795165798 = []; + colontmp__1795165798 = board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)].onPromote; + var i_1795165799 = 0; + var L_1795165800 = (colontmp__1795165798).length; Label9: { Label10: while (true) { - if (!(i_1795165531 < L_1795165532)) break Label10; - pHEX60gensym45_1795163001 = colontmp__1795165530[chckIndx(i_1795165531, 0, (colontmp__1795165530).length - 1)]; - pHEX60gensym45_1795163001(board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)], board_1795162991); - if (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)].promoted) { + if (!(i_1795165799 < L_1795165800)) break Label10; + xHEX60gensym45_1795162960 = colontmp__1795165798[chckIndx(i_1795165799, 0, (colontmp__1795165798).length - 1)]; + xHEX60gensym45_1795162960(board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)], board_1795162949, state_1795162950); + if (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)].promoted) { break Label8; } - i_1795165531 += 1; - if (!(((colontmp__1795165530).length == L_1795165532))) { + i_1795165799 += 1; + if (!(((colontmp__1795165798).length == L_1795165800))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)].moves.push(HEX3Aanonymous_1811939527);; - board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)][chckIndx(j_1795162996, 0, (board_1795162991[chckIndx(i_1795162995, 0, (board_1795162991).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939522);; + board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)].moves.push(HEX3Aanonymous_1811939504);; + board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)][chckIndx(j_1795162955, 0, (board_1795162949[chckIndx(i_1795162954, 0, (board_1795162949).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939499);; } - i_1795165540 = addInt(i_1795165540, 1); + i_1795165808 = addInt(i_1795165808, 1); } }; }; - i_1795165536 = addInt(i_1795165536, 1); + i_1795165804 = addInt(i_1795165804, 1); } }; }; }; - taken_1795162989 = nimCopy(taken_1795162989, pieceCopy_1476395495(air_1493172398, 6, 1, 0, 0, taken_1795162989.tile, [], [], air_1493172398.onMove, air_1493172398.onTake, air_1493172398.whenTaken, [], [], false, [], true, false, air_1493172398.rand, air_1493172398.wallet), NTI1476395026); - var colontmp__1795165542 = nimCopy(null, taken_1795162989.tile, NTI1476395011); - var colontmp__1795165543 = true; - result_1795162994 = nimCopy(result_1795162994, {Field0: nimCopy(null, colontmp__1795165542, NTI1476395011), Field1: colontmp__1795165543}, NTI1795162882); + taken_1795162947 = nimCopy(taken_1795162947, pieceCopy_1476396045(air_1526726831, taken_1795162947.index, 6, 1, 0, 0, taken_1795162947.tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); + var colontmp__1795165810 = nimCopy(null, taken_1795162947.tile, NTI1476395011); + var colontmp__1795165811 = true; + result_1795162953 = nimCopy(result_1795162953, {Field0: nimCopy(null, colontmp__1795165810, NTI1476395011), Field1: colontmp__1795165811}, NTI1795162857); break BeforeRet; } else { - result_1795162994 = nimCopy(result_1795162994, HEX3Aanonymous_1476395442(taken_1795162989, taker_1795162990, board_1795162991), NTI1795162882); + result_1795162953 = nimCopy(result_1795162953, HEX3Aanonymous_1476395989(taken_1795162947, taker_1795162948, board_1795162949, state_1795162950), NTI1795162857); break BeforeRet; } }; - return result_1795162994; + return result_1795162953; } -function HEX3Aanonymous_1795163013(side_1795163014, viewSide_1795163015, b_1795163016) { +function HEX3Aanonymous_1795162972(side_1795162973, viewSide_1795162974, b_1795162975, __1795162976) { Label1: { - var i_1795163017 = 0; - var j_1795163018 = 0; + var i_1795162977 = 0; + var j_1795162978 = 0; Label2: { - var i_1795165521 = 0; - var i_1795165522 = 0; + var i_1795165789 = 0; + var i_1795165790 = 0; Label3: { Label4: while (true) { - if (!(i_1795165522 < 8)) break Label4; - i_1795165521 = i_1795165522; + if (!(i_1795165790 < 8)) break Label4; + i_1795165789 = i_1795165790; Label5: { - var j_1795165525 = 0; - var i_1795165526 = 0; + var j_1795165793 = 0; + var i_1795165794 = 0; Label6: { Label7: while (true) { - if (!(i_1795165526 < 8)) break Label7; - j_1795165525 = i_1795165526; - i_1795163017 = i_1795165521; - j_1795163018 = j_1795165525; - if (((b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)][chckIndx(j_1795163018, 0, (b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)][chckIndx(j_1795163018, 0, (b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)]).length - 1)], side_1795163014))) { - b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)][chckIndx(j_1795163018, 0, (b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)]).length - 1)].whenTaken = HEX3Aanonymous_1795162988; - b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)][chckIndx(j_1795163018, 0, (b_1795163016[chckIndx(i_1795163017, 0, (b_1795163016).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939532);; + if (!(i_1795165794 < 8)) break Label7; + j_1795165793 = i_1795165794; + i_1795162977 = i_1795165789; + j_1795162978 = j_1795165793; + if (((b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)][chckIndx(j_1795162978, 0, (b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)][chckIndx(j_1795162978, 0, (b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)]).length - 1)], side_1795162973))) { + b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)][chckIndx(j_1795162978, 0, (b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)]).length - 1)].whenTaken = HEX3Aanonymous_1795162946; + b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)][chckIndx(j_1795162978, 0, (b_1795162975[chckIndx(i_1795162977, 0, (b_1795162975).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939509);; } - i_1795165526 = addInt(i_1795165526, 1); + i_1795165794 = addInt(i_1795165794, 1); } }; }; - i_1795165522 = addInt(i_1795165522, 1); + i_1795165790 = addInt(i_1795165790, 1); } }; }; @@ -6123,45 +6876,45 @@ function HEX3Aanonymous_1795163013(side_1795163014, viewSide_1795163015, b_17951 } -function HEX3Aanonymous_1795163107(side_1795163108, viewSide_1795163109, b_1795163110) { - HEX3Aanonymous_1795163069(side_1795163108, viewSide_1795163109, b_1795163110); - HEX3Aanonymous_1795163042(side_1795163108, viewSide_1795163109, b_1795163110); - HEX3Aanonymous_1795162542(side_1795163108, viewSide_1795163109, b_1795163110); +function HEX3Aanonymous_1795163070(side_1795163071, viewSide_1795163072, b_1795163073, state_1795163074) { + HEX3Aanonymous_1795163030(side_1795163071, viewSide_1795163072, b_1795163073, state_1795163074); + HEX3Aanonymous_1795163002(side_1795163071, viewSide_1795163072, b_1795163073, state_1795163074); + HEX3Aanonymous_1795162541(side_1795163071, viewSide_1795163072, b_1795163073, state_1795163074); Label1: { - var i_1795163111 = 0; - var j_1795163112 = 0; + var i_1795163075 = 0; + var j_1795163076 = 0; Label2: { - var i_1795165546 = 0; - var i_1795165547 = 0; + var i_1795165814 = 0; + var i_1795165815 = 0; Label3: { Label4: while (true) { - if (!(i_1795165547 < 8)) break Label4; - i_1795165546 = i_1795165547; + if (!(i_1795165815 < 8)) break Label4; + i_1795165814 = i_1795165815; Label5: { - var j_1795165550 = 0; - var i_1795165551 = 0; + var j_1795165818 = 0; + var i_1795165819 = 0; Label6: { Label7: while (true) { - if (!(i_1795165551 < 8)) break Label7; - j_1795165550 = i_1795165551; - i_1795163111 = i_1795165546; - j_1795163112 = j_1795165550; - if (((b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)].item == 3) && isColor_1476395605(b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)], side_1795163108))) { - if ((b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)].color == 0)) { - b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939401);; + if (!(i_1795165819 < 8)) break Label7; + j_1795165818 = i_1795165819; + i_1795163075 = i_1795165814; + j_1795163076 = j_1795165818; + if (((b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)].item == 3) && isColor_1476396138(b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)], side_1795163071))) { + if ((b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)].color == 0)) { + b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939401);; } else { - if ((b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)].color == 1)) { - b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)][chckIndx(j_1795163112, 0, (b_1795163110[chckIndx(i_1795163111, 0, (b_1795163110).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939395);; + if ((b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)].color == 1)) { + b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)][chckIndx(j_1795163076, 0, (b_1795163073[chckIndx(i_1795163075, 0, (b_1795163073).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939395);; } } } - i_1795165551 = addInt(i_1795165551, 1); + i_1795165819 = addInt(i_1795165819, 1); } }; }; - i_1795165547 = addInt(i_1795165547, 1); + i_1795165815 = addInt(i_1795165815, 1); } }; }; @@ -6170,41 +6923,41 @@ function HEX3Aanonymous_1795163107(side_1795163108, viewSide_1795163109, b_17951 } -function HEX3Aanonymous_1795163169(side_1795163170, viewSide_1795163171, b_1795163172) { +function HEX3Aanonymous_1795163134(side_1795163135, viewSide_1795163136, b_1795163137, __1795163138) { Label1: { - var i_1795163173 = 0; - var j_1795163174 = 0; + var i_1795163139 = 0; + var j_1795163140 = 0; Label2: { - var i_1795165555 = 0; - var i_1795165556 = 0; + var i_1795165823 = 0; + var i_1795165824 = 0; Label3: { Label4: while (true) { - if (!(i_1795165556 < 8)) break Label4; - i_1795165555 = i_1795165556; + if (!(i_1795165824 < 8)) break Label4; + i_1795165823 = i_1795165824; Label5: { - var j_1795165559 = 0; - var i_1795165560 = 0; + var j_1795165827 = 0; + var i_1795165828 = 0; Label6: { Label7: while (true) { - if (!(i_1795165560 < 8)) break Label7; - j_1795165559 = i_1795165560; - i_1795163173 = i_1795165555; - j_1795163174 = j_1795165559; - if ((!((b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)].item == 1)) && isColor_1476395605(b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)], side_1795163170))) { - b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)] = nimCopy(b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)], {item: 6, tile: nimCopy(null, b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)].tile, NTI1476395011), timesMoved: 0, piecesTaken: 0, promoted: false, filePath: [], colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054), color: 0, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: []}, NTI1476395026); + if (!(i_1795165828 < 8)) break Label7; + j_1795165827 = i_1795165828; + i_1795163139 = i_1795165823; + j_1795163140 = j_1795165827; + if ((!((b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)].item == 1)) && isColor_1476396138(b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)], side_1795163135))) { + b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)] = nimCopy(b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)].index, 6, 1, 0, 0, b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } else { - if (((b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)], side_1795163170))) { - add_1795162141(b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1509949890, HEX3Aanonymous_1811939527]); - add_1795162141(b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1509949895, HEX3Aanonymous_1811939522]); - b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)][chckIndx(j_1795163174, 0, (b_1795163172[chckIndx(i_1795163173, 0, (b_1795163172).length - 1)]).length - 1)].item = 0; + if (((b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)], side_1795163135))) { + add_1795162144(b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1543504322, HEX3Aanonymous_1811939504]); + add_1795162144(b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1543504327, HEX3Aanonymous_1811939499]); + b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)][chckIndx(j_1795163140, 0, (b_1795163137[chckIndx(i_1795163139, 0, (b_1795163137).length - 1)]).length - 1)].item = 0; } } - i_1795165560 = addInt(i_1795165560, 1); + i_1795165828 = addInt(i_1795165828, 1); } }; }; - i_1795165556 = addInt(i_1795165556, 1); + i_1795165824 = addInt(i_1795165824, 1); } }; }; @@ -6213,59 +6966,59 @@ function HEX3Aanonymous_1795163169(side_1795163170, viewSide_1795163171, b_17951 } -function HEX3Aanonymous_1795163312(side_1795163313, viewSide_1795163314, b_1795163315) { - if ((side_1795163313 == 0)) { - pieceMove_1476395295(b_1795163315[chckIndx(1, 0, (b_1795163315).length - 1)][chckIndx(3, 0, (b_1795163315[chckIndx(1, 0, (b_1795163315).length - 1)]).length - 1)], 3, 3, b_1795163315); - pieceMove_1476395295(b_1795163315[chckIndx(1, 0, (b_1795163315).length - 1)][chckIndx(4, 0, (b_1795163315[chckIndx(1, 0, (b_1795163315).length - 1)]).length - 1)], 3, 4, b_1795163315); +function HEX3Aanonymous_1795163296(side_1795163297, viewSide_1795163298, b_1795163299, s_1795163300) { + if ((side_1795163297 == 0)) { + pieceMove_1476395941(b_1795163299[chckIndx(1, 0, (b_1795163299).length - 1)][chckIndx(3, 0, (b_1795163299[chckIndx(1, 0, (b_1795163299).length - 1)]).length - 1)], 3, 3, b_1795163299, s_1795163300); + pieceMove_1476395941(b_1795163299[chckIndx(1, 0, (b_1795163299).length - 1)][chckIndx(4, 0, (b_1795163299[chckIndx(1, 0, (b_1795163299).length - 1)]).length - 1)], 3, 4, b_1795163299, s_1795163300); } else { - pieceMove_1476395295(b_1795163315[chckIndx(6, 0, (b_1795163315).length - 1)][chckIndx(3, 0, (b_1795163315[chckIndx(6, 0, (b_1795163315).length - 1)]).length - 1)], 4, 3, b_1795163315); - pieceMove_1476395295(b_1795163315[chckIndx(6, 0, (b_1795163315).length - 1)][chckIndx(4, 0, (b_1795163315[chckIndx(6, 0, (b_1795163315).length - 1)]).length - 1)], 4, 4, b_1795163315); + pieceMove_1476395941(b_1795163299[chckIndx(6, 0, (b_1795163299).length - 1)][chckIndx(3, 0, (b_1795163299[chckIndx(6, 0, (b_1795163299).length - 1)]).length - 1)], 4, 3, b_1795163299, s_1795163300); + pieceMove_1476395941(b_1795163299[chckIndx(6, 0, (b_1795163299).length - 1)][chckIndx(4, 0, (b_1795163299[chckIndx(6, 0, (b_1795163299).length - 1)]).length - 1)], 4, 4, b_1795163299, s_1795163300); } } -function HEX3Aanonymous_1795163200(side_1795163201, viewSide_1795163202, b_1795163203) { +function HEX3Aanonymous_1795163166(side_1795163167, viewSide_1795163168, b_1795163169, __1795163170) { Label1: { - var i_1795163204 = 0; - var j_1795163205 = 0; + var i_1795163171 = 0; + var j_1795163172 = 0; Label2: { - var i_1795165564 = 0; - var i_1795165565 = 0; + var i_1795165832 = 0; + var i_1795165833 = 0; Label3: { Label4: while (true) { - if (!(i_1795165565 < 8)) break Label4; - i_1795165564 = i_1795165565; + if (!(i_1795165833 < 8)) break Label4; + i_1795165832 = i_1795165833; Label5: { - var j_1795165568 = 0; - var i_1795165569 = 0; + var j_1795165836 = 0; + var i_1795165837 = 0; Label6: { Label7: while (true) { - if (!(i_1795165569 < 8)) break Label7; - j_1795165568 = i_1795165569; - i_1795163204 = i_1795165564; - j_1795163205 = j_1795165568; - if ((!((b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].item == 1)) && isColor_1476395605(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], side_1795163201))) { - b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)] = nimCopy(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], {item: 6, tile: nimCopy(null, b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].tile, NTI1476395011), timesMoved: 0, piecesTaken: 0, promoted: false, filePath: [], colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054), color: 0, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: []}, NTI1476395026); + if (!(i_1795165837 < 8)) break Label7; + j_1795165836 = i_1795165837; + i_1795163171 = i_1795165832; + j_1795163172 = j_1795165836; + if ((!((b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].item == 1)) && isColor_1476396138(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], side_1795163167))) { + b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)] = nimCopy(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].index, 6, 1, 0, 0, b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } else { - if (((b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], side_1795163201))) { - add_1795162141(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1509949890, HEX3Aanonymous_1811939527]); - add_1795162141(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1509949895, HEX3Aanonymous_1811939522]); - b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].item = 0; + if (((b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], side_1795163167))) { + add_1795162144(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], "moves", [HEX3Aanonymous_1543504322, HEX3Aanonymous_1811939504, HEX3Aanonymous_1811939602, HEX3Aanonymous_1811939592]); + add_1795162144(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], "takes", [HEX3Aanonymous_1543504327, HEX3Aanonymous_1811939499, HEX3Aanonymous_1811939607, HEX3Aanonymous_1811939597]); + b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].item = 0; } else { - if (((b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].item == 2) && !(isColor_1476395605(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], side_1795163201)))) { - b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)] = nimCopy(b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)], {item: 6, tile: nimCopy(null, b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)][chckIndx(j_1795163205, 0, (b_1795163203[chckIndx(i_1795163204, 0, (b_1795163203).length - 1)]).length - 1)].tile, NTI1476395011), timesMoved: 0, piecesTaken: 0, promoted: false, filePath: [], colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054), color: 0, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: []}, NTI1476395026); + if (((b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].item == 2) && !(isColor_1476396138(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], side_1795163167)))) { + b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)] = nimCopy(b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].index, 6, 1, 0, 0, b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)][chckIndx(j_1795163172, 0, (b_1795163169[chckIndx(i_1795163171, 0, (b_1795163169).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } }} - i_1795165569 = addInt(i_1795165569, 1); + i_1795165837 = addInt(i_1795165837, 1); } }; }; - i_1795165565 = addInt(i_1795165565, 1); + i_1795165833 = addInt(i_1795165833, 1); } }; }; @@ -6274,29 +7027,29 @@ function HEX3Aanonymous_1795163200(side_1795163201, viewSide_1795163202, b_17951 } -function HEX3Aanonymous_1795164231(side_1795164232, __1795164233, b_1795164234) { +function HEX3Aanonymous_1795164231(side_1795164232, __1795164233, b_1795164234, s_1795164235) { var Temporary8; Label1: { - var i_1795164235 = 0; - var j_1795164236 = 0; + var i_1795164236 = 0; + var j_1795164237 = 0; Label2: { - var i_1795165573 = 0; - var i_1795165574 = 0; + var i_1795165841 = 0; + var i_1795165842 = 0; Label3: { Label4: while (true) { - if (!(i_1795165574 < 8)) break Label4; - i_1795165573 = i_1795165574; + if (!(i_1795165842 < 8)) break Label4; + i_1795165841 = i_1795165842; Label5: { - var j_1795165577 = 0; - var i_1795165578 = 0; + var j_1795165845 = 0; + var i_1795165846 = 0; Label6: { Label7: while (true) { - if (!(i_1795165578 < 8)) break Label7; - j_1795165577 = i_1795165578; - i_1795164235 = i_1795165573; - j_1795164236 = j_1795165577; - if ((((b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].item == 5) && isColor_1476395605(b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)], side_1795164232)) && (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved == 1))) { + if (!(i_1795165846 < 8)) break Label7; + j_1795165845 = i_1795165846; + i_1795164236 = i_1795165841; + j_1795164237 = j_1795165845; + if ((((b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].item == 5) && isColor_1476396138(b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)], side_1795164232)) && (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved == 1))) { if ((side_1795164232 == 0)) { Temporary8 = (-1); } @@ -6304,16 +7057,16 @@ function HEX3Aanonymous_1795164231(side_1795164232, __1795164233, b_1795164234) Temporary8 = 1; } - var back_1795164245 = Temporary8; - b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved = addInt(b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved, 1); - pieceMove_1476395295(b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)], addInt(b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].tile.Field1, back_1795164245), b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)][chckIndx(j_1795164236, 0, (b_1795164234[chckIndx(i_1795164235, 0, (b_1795164234).length - 1)]).length - 1)].tile.Field0, b_1795164234); + var back_1795164246 = Temporary8; + b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved = addInt(b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].timesMoved, 1); + pieceMove_1476395941(b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)], addInt(b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].tile.Field1, back_1795164246), b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)][chckIndx(j_1795164237, 0, (b_1795164234[chckIndx(i_1795164236, 0, (b_1795164234).length - 1)]).length - 1)].tile.Field0, b_1795164234, s_1795164235); } - i_1795165578 = addInt(i_1795165578, 1); + i_1795165846 = addInt(i_1795165846, 1); } }; }; - i_1795165574 = addInt(i_1795165574, 1); + i_1795165842 = addInt(i_1795165842, 1); } }; }; @@ -6322,36 +7075,36 @@ function HEX3Aanonymous_1795164231(side_1795164232, __1795164233, b_1795164234) } -function HEX3Aanonymous_1795164266(piece_1795164267, board_1795164268) { - if ((piece_1795164267.piecesTaken == 7)) { +function HEX3Aanonymous_1795164267(piece_1795164268, board_1795164269, state_1795164270) { + if ((piece_1795164268.piecesTaken == 7)) { Label1: { - var i_1795164269 = 0; - var j_1795164270 = 0; + var i_1795164271 = 0; + var j_1795164272 = 0; Label2: { - var i_1795165591 = 0; - var i_1795165592 = 0; + var i_1795165859 = 0; + var i_1795165860 = 0; Label3: { Label4: while (true) { - if (!(i_1795165592 < 8)) break Label4; - i_1795165591 = i_1795165592; + if (!(i_1795165860 < 8)) break Label4; + i_1795165859 = i_1795165860; Label5: { - var j_1795165595 = 0; - var i_1795165596 = 0; + var j_1795165863 = 0; + var i_1795165864 = 0; Label6: { Label7: while (true) { - if (!(i_1795165596 < 8)) break Label7; - j_1795165595 = i_1795165596; - i_1795164269 = i_1795165591; - j_1795164270 = j_1795165595; - if (((board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)][chckIndx(j_1795164270, 0, (board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)]).length - 1)].item == 0) && !(sameColor_1476395596(board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)][chckIndx(j_1795164270, 0, (board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)]).length - 1)], piece_1795164267)))) { - board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)][chckIndx(j_1795164270, 0, (board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)]).length - 1)] = nimCopy(board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)][chckIndx(j_1795164270, 0, (board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)]).length - 1)], {item: 6, tile: nimCopy(null, board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)][chckIndx(j_1795164270, 0, (board_1795164268[chckIndx(i_1795164269, 0, (board_1795164268).length - 1)]).length - 1)].tile, NTI1476395011), timesMoved: 0, piecesTaken: 0, promoted: false, filePath: [], colorable: true, rotate: false, rand: nimCopy(null, {Field0: false, Field1: 0}, NTI1476395052), wallet: nimCopy(null, {Field0: (-1), Field1: []}, NTI1476395054), color: 0, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: []}, NTI1476395026); + if (!(i_1795165864 < 8)) break Label7; + j_1795165863 = i_1795165864; + i_1795164271 = i_1795165859; + j_1795164272 = j_1795165863; + if (((board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)].item == 0) && !(sameColor_1476396129(board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)], piece_1795164268)))) { + board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)] = nimCopy(board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)].index, 6, 1, 0, 0, board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)][chckIndx(j_1795164272, 0, (board_1795164269[chckIndx(i_1795164271, 0, (board_1795164269).length - 1)]).length - 1)].tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); } - i_1795165596 = addInt(i_1795165596, 1); + i_1795165864 = addInt(i_1795165864, 1); } }; }; - i_1795165592 = addInt(i_1795165592, 1); + i_1795165860 = addInt(i_1795165860, 1); } }; }; @@ -6362,35 +7115,35 @@ function HEX3Aanonymous_1795164266(piece_1795164267, board_1795164268) { } -function HEX3Aanonymous_1795164276(side_1795164277, __1795164278, b_1795164279) { +function HEX3Aanonymous_1795164278(side_1795164279, __1795164280, b_1795164281, __1795164282) { Label1: { - var i_1795164280 = 0; - var j_1795164281 = 0; + var i_1795164283 = 0; + var j_1795164284 = 0; Label2: { - var i_1795165582 = 0; - var i_1795165583 = 0; + var i_1795165850 = 0; + var i_1795165851 = 0; Label3: { Label4: while (true) { - if (!(i_1795165583 < 8)) break Label4; - i_1795165582 = i_1795165583; + if (!(i_1795165851 < 8)) break Label4; + i_1795165850 = i_1795165851; Label5: { - var j_1795165586 = 0; - var i_1795165587 = 0; + var j_1795165854 = 0; + var i_1795165855 = 0; Label6: { Label7: while (true) { - if (!(i_1795165587 < 8)) break Label7; - j_1795165586 = i_1795165587; - i_1795164280 = i_1795165582; - j_1795164281 = j_1795165586; - if (((b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)][chckIndx(j_1795164281, 0, (b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)]).length - 1)].item == 0) && isColor_1476395605(b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)][chckIndx(j_1795164281, 0, (b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)]).length - 1)], side_1795164277))) { - b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)][chckIndx(j_1795164281, 0, (b_1795164279[chckIndx(i_1795164280, 0, (b_1795164279).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164266);; + if (!(i_1795165855 < 8)) break Label7; + j_1795165854 = i_1795165855; + i_1795164283 = i_1795165850; + j_1795164284 = j_1795165854; + if (((b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)][chckIndx(j_1795164284, 0, (b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)]).length - 1)].item == 0) && isColor_1476396138(b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)][chckIndx(j_1795164284, 0, (b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)]).length - 1)], side_1795164279))) { + b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)][chckIndx(j_1795164284, 0, (b_1795164281[chckIndx(i_1795164283, 0, (b_1795164281).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164267);; } - i_1795165587 = addInt(i_1795165587, 1); + i_1795165855 = addInt(i_1795165855, 1); } }; }; - i_1795165583 = addInt(i_1795165583, 1); + i_1795165851 = addInt(i_1795165851, 1); } }; }; @@ -6399,24 +7152,24 @@ function HEX3Aanonymous_1795164276(side_1795164277, __1795164278, b_1795164279) } -function HEX3Aanonymous_1795164633(piece_1795164634, board_1795164635) { +function HEX3Aanonymous_1795164649(piece_1795164650, board_1795164651, state_1795164652) { var Temporary2; var Temporary5; - piece_1795164634.onMove(piece_1795164634, tileAbove_1526726799(piece_1795164634.tile), board_1795164635); + piece_1795164650.onMove(piece_1795164650, tileBelow_1560281233(piece_1795164650.tile), board_1795164651, state_1795164652); Label1: { - var pHEX60gensym124_1795164640 = null; - var colontmp__1795165608 = []; - colontmp__1795165608 = (Temporary2 = board_1795164635[chckIndx(tileAbove_1526726799(piece_1795164634.tile).Field1, 0, (board_1795164635).length - 1)], Temporary2)[chckIndx(piece_1795164634.tile.Field0, 0, (Temporary2).length - 1)].onEndTurn; - var i_1795165609 = 0; - var L_1795165610 = (colontmp__1795165608).length; + var xHEX60gensym127_1795164657 = null; + var colontmp__1795165867 = []; + colontmp__1795165867 = (Temporary2 = board_1795164651[chckIndx(tileBelow_1560281233(piece_1795164650.tile).Field1, 0, (board_1795164651).length - 1)], Temporary2)[chckIndx(piece_1795164650.tile.Field0, 0, (Temporary2).length - 1)].onEndTurn; + var i_1795165868 = 0; + var L_1795165869 = (colontmp__1795165867).length; Label3: { Label4: while (true) { - if (!(i_1795165609 < L_1795165610)) break Label4; - pHEX60gensym124_1795164640 = colontmp__1795165608[chckIndx(i_1795165609, 0, (colontmp__1795165608).length - 1)]; - pHEX60gensym124_1795164640((Temporary5 = board_1795164635[chckIndx(tileAbove_1526726799(piece_1795164634.tile).Field1, 0, (board_1795164635).length - 1)], Temporary5)[chckIndx(piece_1795164634.tile.Field0, 0, (Temporary5).length - 1)], board_1795164635); - i_1795165609 += 1; - if (!(((colontmp__1795165608).length == L_1795165610))) { + if (!(i_1795165868 < L_1795165869)) break Label4; + xHEX60gensym127_1795164657 = colontmp__1795165867[chckIndx(i_1795165868, 0, (colontmp__1795165867).length - 1)]; + xHEX60gensym127_1795164657((Temporary5 = board_1795164651[chckIndx(tileBelow_1560281233(piece_1795164650.tile).Field1, 0, (board_1795164651).length - 1)], Temporary5)[chckIndx(piece_1795164650.tile.Field0, 0, (Temporary5).length - 1)], board_1795164651, state_1795164652); + i_1795165868 += 1; + if (!(((colontmp__1795165867).length == L_1795165869))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -6427,38 +7180,38 @@ function HEX3Aanonymous_1795164633(piece_1795164634, board_1795164635) { } -function HEX3Aanonymous_1795164646(piece_1795164647, board_1795164648) { +function HEX3Aanonymous_1795164663(piece_1795164664, board_1795164665, s_1795164666) { var Temporary1; - var result_1795164649 = false; + var result_1795164667 = false; BeforeRet: { - result_1795164649 = (!((piece_1795164647.tile.Field1 == 0)) && isAir_1476395588((Temporary1 = board_1795164648[chckIndx(tileAbove_1526726799(piece_1795164647.tile).Field1, 0, (board_1795164648).length - 1)], Temporary1)[chckIndx(piece_1795164647.tile.Field0, 0, (Temporary1).length - 1)])); + result_1795164667 = (!((piece_1795164664.tile.Field1 == 7)) && isAir_1476396121((Temporary1 = board_1795164665[chckIndx(tileBelow_1560281233(piece_1795164664.tile).Field1, 0, (board_1795164665).length - 1)], Temporary1)[chckIndx(piece_1795164664.tile.Field0, 0, (Temporary1).length - 1)])); break BeforeRet; }; - return result_1795164649; + return result_1795164667; } -function HEX3Aanonymous_1795164651(piece_1795164652, board_1795164653) { +function HEX3Aanonymous_1795164629(piece_1795164630, board_1795164631, state_1795164632) { var Temporary2; var Temporary5; - piece_1795164652.onMove(piece_1795164652, tileBelow_1526726802(piece_1795164652.tile), board_1795164653); + piece_1795164630.onMove(piece_1795164630, tileAbove_1560281230(piece_1795164630.tile), board_1795164631, state_1795164632); Label1: { - var pHEX60gensym127_1795164658 = null; - var colontmp__1795165613 = []; - colontmp__1795165613 = (Temporary2 = board_1795164653[chckIndx(tileBelow_1526726802(piece_1795164652.tile).Field1, 0, (board_1795164653).length - 1)], Temporary2)[chckIndx(piece_1795164652.tile.Field0, 0, (Temporary2).length - 1)].onEndTurn; - var i_1795165614 = 0; - var L_1795165615 = (colontmp__1795165613).length; + var xHEX60gensym124_1795164637 = null; + var colontmp__1795165872 = []; + colontmp__1795165872 = (Temporary2 = board_1795164631[chckIndx(tileAbove_1560281230(piece_1795164630.tile).Field1, 0, (board_1795164631).length - 1)], Temporary2)[chckIndx(piece_1795164630.tile.Field0, 0, (Temporary2).length - 1)].onEndTurn; + var i_1795165873 = 0; + var L_1795165874 = (colontmp__1795165872).length; Label3: { Label4: while (true) { - if (!(i_1795165614 < L_1795165615)) break Label4; - pHEX60gensym127_1795164658 = colontmp__1795165613[chckIndx(i_1795165614, 0, (colontmp__1795165613).length - 1)]; - pHEX60gensym127_1795164658((Temporary5 = board_1795164653[chckIndx(tileBelow_1526726802(piece_1795164652.tile).Field1, 0, (board_1795164653).length - 1)], Temporary5)[chckIndx(piece_1795164652.tile.Field0, 0, (Temporary5).length - 1)], board_1795164653); - i_1795165614 += 1; - if (!(((colontmp__1795165613).length == L_1795165615))) { + if (!(i_1795165873 < L_1795165874)) break Label4; + xHEX60gensym124_1795164637 = colontmp__1795165872[chckIndx(i_1795165873, 0, (colontmp__1795165872).length - 1)]; + xHEX60gensym124_1795164637((Temporary5 = board_1795164631[chckIndx(tileAbove_1560281230(piece_1795164630.tile).Field1, 0, (board_1795164631).length - 1)], Temporary5)[chckIndx(piece_1795164630.tile.Field0, 0, (Temporary5).length - 1)], board_1795164631, state_1795164632); + i_1795165873 += 1; + if (!(((colontmp__1795165872).length == L_1795165874))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -6469,423 +7222,250 @@ function HEX3Aanonymous_1795164651(piece_1795164652, board_1795164653) { } -function HEX3Aanonymous_1795164664(piece_1795164665, board_1795164666) { +function HEX3Aanonymous_1795164643(piece_1795164644, board_1795164645, s_1795164646) { var Temporary1; - var result_1795164667 = false; + var result_1795164647 = false; BeforeRet: { - result_1795164667 = (!((piece_1795164665.tile.Field1 == 7)) && isAir_1476395588((Temporary1 = board_1795164666[chckIndx(tileBelow_1526726802(piece_1795164665.tile).Field1, 0, (board_1795164666).length - 1)], Temporary1)[chckIndx(piece_1795164665.tile.Field0, 0, (Temporary1).length - 1)])); + result_1795164647 = (!((piece_1795164644.tile.Field1 == 0)) && isAir_1476396121((Temporary1 = board_1795164645[chckIndx(tileAbove_1560281230(piece_1795164644.tile).Field1, 0, (board_1795164645).length - 1)], Temporary1)[chckIndx(piece_1795164644.tile.Field0, 0, (Temporary1).length - 1)])); break BeforeRet; }; - return result_1795164667; + return result_1795164647; } -function HEX3Aanonymous_1795164669(side_1795164670, __1795164671, b_1795164672) { - Label1: { - var i_1795164673 = 0; - var j_1795164674 = 0; - Label2: { - var i_1795165600 = 0; - var i_1795165601 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165601 < 8)) break Label4; - i_1795165600 = i_1795165601; - Label5: { - var j_1795165604 = 0; - var i_1795165605 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165605 < 8)) break Label7; - j_1795165604 = i_1795165605; - i_1795164673 = i_1795165600; - j_1795164674 = j_1795165604; - if (isColor_1476395605(b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)][chckIndx(j_1795164674, 0, (b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)]).length - 1)], side_1795164670)) { - if ((b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)][chckIndx(j_1795164674, 0, (b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)]).length - 1)].color == 1)) { - b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)][chckIndx(j_1795164674, 0, (b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)]).length - 1)].wallet.Field1.push({Field0: [77,111,118,101,32,85,112], Field1: 5, Field2: HEX3Aanonymous_1795164633, Field3: HEX3Aanonymous_1795164646});; - } - else { - b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)][chckIndx(j_1795164674, 0, (b_1795164672[chckIndx(i_1795164673, 0, (b_1795164672).length - 1)]).length - 1)].wallet.Field1.push({Field0: [77,111,118,101,32,85,112], Field1: 5, Field2: HEX3Aanonymous_1795164651, Field3: HEX3Aanonymous_1795164664});; - } - - } - - i_1795165605 = addInt(i_1795165605, 1); - } - }; - }; - i_1795165601 = addInt(i_1795165601, 1); - } - }; - }; - }; +function HEX3Aanonymous_1795164669(side_1795164670, __1795164671, b_1795164672, s_1795164673) { + if ((side_1795164670 == 0)) { + s_1795164673.Field1[chckIndx(side_1795164670, 0, (s_1795164673.Field1).length - 1)].buys.push({Field0: [77,111,118,101,32,85,112], Field1: alwaysCost_1828716773(7), Field2: HEX3Aanonymous_1795164649, Field3: HEX3Aanonymous_1795164663});; + } + else { + s_1795164673.Field1[chckIndx(side_1795164670, 0, (s_1795164673.Field1).length - 1)].buys.push({Field0: [77,111,118,101,32,85,112], Field1: alwaysCost_1828716773(7), Field2: HEX3Aanonymous_1795164629, Field3: HEX3Aanonymous_1795164643});; + } + } -function HEX3Aanonymous_1795164714(side_1795164715, __1795164716, b_1795164717) { - Label1: { - var i_1795164718 = 0; - var j_1795164719 = 0; - Label2: { - var i_1795165619 = 0; - var i_1795165620 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165620 < 8)) break Label4; - i_1795165619 = i_1795165620; - Label5: { - var j_1795165623 = 0; - var i_1795165624 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165624 < 8)) break Label7; - j_1795165623 = i_1795165624; - i_1795164718 = i_1795165619; - j_1795164719 = j_1795165623; - if (isColor_1476395605(b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)][chckIndx(j_1795164719, 0, (b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)]).length - 1)], side_1795164715)) { - if ((b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)][chckIndx(j_1795164719, 0, (b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)]).length - 1)].color == 1)) { - b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)][chckIndx(j_1795164719, 0, (b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)]).length - 1)].wallet.Field1.push({Field0: [77,111,118,101,32,66,97,99,107], Field1: 4, Field2: HEX3Aanonymous_1795164651, Field3: HEX3Aanonymous_1795164664});; - } - else { - b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)][chckIndx(j_1795164719, 0, (b_1795164717[chckIndx(i_1795164718, 0, (b_1795164717).length - 1)]).length - 1)].wallet.Field1.push({Field0: [77,111,118,101,32,66,97,99,107], Field1: 4, Field2: HEX3Aanonymous_1795164633, Field3: HEX3Aanonymous_1795164646});; - } - - } - - i_1795165624 = addInt(i_1795165624, 1); - } - }; - }; - i_1795165620 = addInt(i_1795165620, 1); - } - }; - }; - }; +function HEX3Aanonymous_1795164713(side_1795164714, __1795164715, b_1795164716, s_1795164717) { + if ((side_1795164714 == 0)) { + s_1795164717.Field1[chckIndx(side_1795164714, 0, (s_1795164717.Field1).length - 1)].buys.push({Field0: [77,111,118,101,32,66,97,99,107], Field1: alwaysCost_1828716773(7), Field2: HEX3Aanonymous_1795164629, Field3: HEX3Aanonymous_1795164643});; + } + else { + s_1795164717.Field1[chckIndx(side_1795164714, 0, (s_1795164717.Field1).length - 1)].buys.push({Field0: [77,111,118,101,32,66,97,99,107], Field1: alwaysCost_1828716773(7), Field2: HEX3Aanonymous_1795164649, Field3: HEX3Aanonymous_1795164663});; + } + } -function HEX3Aanonymous_1795164755(side_1795164756, __1795164757, b_1795164758) { - Label1: { - var i_1795164759 = 0; - var j_1795164760 = 0; - Label2: { - var i_1795165628 = 0; - var i_1795165629 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165629 < 8)) break Label4; - i_1795165628 = i_1795165629; - Label5: { - var j_1795165632 = 0; - var i_1795165633 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165633 < 8)) break Label7; - j_1795165632 = i_1795165633; - i_1795164759 = i_1795165628; - j_1795164760 = j_1795165632; - if (((b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)][chckIndx(j_1795164760, 0, (b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)]).length - 1)].item == 0) && isColor_1476395605(b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)][chckIndx(j_1795164760, 0, (b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)]).length - 1)], side_1795164756))) { - b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)][chckIndx(j_1795164760, 0, (b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)]).length - 1)].wallet.Field0 = addInt(b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)][chckIndx(j_1795164760, 0, (b_1795164758[chckIndx(i_1795164759, 0, (b_1795164758).length - 1)]).length - 1)].wallet.Field0, 10); - } - - i_1795165633 = addInt(i_1795165633, 1); - } - }; - }; - i_1795165629 = addInt(i_1795165629, 1); - } - }; - }; - }; +function HEX3Aanonymous_1795164753(side_1795164754, __1795164755, b_1795164756, s_1795164757) { + addMoney_1828716586(side_1795164754, 10, s_1795164757); } -function buyMoveUpgrade_1795164784(move_1795164785) { +function buyMoveUpgrade_1828716669(move_1828716670) { -function HEX3Aanonymous_1795164787(piece_1795164788, board_1795164789) { - piece_1795164788.moves.push(move_1795164785);; +function HEX3Aanonymous_1828716672(piece_1828716673, board_1828716674, __1828716675) { + piece_1828716673.moves.push(move_1828716670);; } - var result_1795164786 = null; + var result_1828716671 = null; - result_1795164786 = HEX3Aanonymous_1795164787; + result_1828716671 = HEX3Aanonymous_1828716672; - return result_1795164786; + return result_1828716671; } -function find_1795164806(a_1795164809, item_1795164810) { - var result_1795164811 = 0; +function find_1828716708(a_1828716711, item_1828716712) { + var result_1828716713 = 0; BeforeRet: { - result_1795164811 = 0; + result_1828716713 = 0; Label1: { - var i_1795164824 = null; - var i_1795165646 = 0; + var i_1828716727 = null; + var i_1795165878 = 0; Label2: { Label3: while (true) { - if (!(i_1795165646 < (a_1795164809).length)) break Label3; - i_1795164824 = a_1795164809[chckIndx(i_1795165646, 0, (a_1795164809).length - 1)]; - if ((i_1795164824 == item_1795164810)) { + if (!(i_1795165878 < (a_1828716711).length)) break Label3; + i_1828716727 = a_1828716711[chckIndx(i_1795165878, 0, (a_1828716711).length - 1)]; + if ((i_1828716727 == item_1828716712)) { break BeforeRet; } - result_1795164811 = addInt(result_1795164811, 1); - i_1795165646 += 1; + result_1828716713 = addInt(result_1828716713, 1); + i_1795165878 += 1; } }; }; - result_1795164811 = (-1); + result_1828716713 = (-1); }; - return result_1795164811; + return result_1828716713; } -function contains_1795164801(a_1795164803, item_1795164804) { - var result_1795164805 = false; +function contains_1828716703(a_1828716705, item_1828716706) { + var result_1828716707 = false; BeforeRet: { - result_1795164805 = (0 <= find_1795164806(a_1795164803, item_1795164804)); + result_1828716707 = (0 <= find_1828716708(a_1828716705, item_1828716706)); break BeforeRet; }; - return result_1795164805; + return result_1828716707; } -function buyMoveUpgradeCondition_1795164794(move_1795164795) { +function buyMoveUpgradeCondition_1828716695(move_1828716696) { -function HEX3Aanonymous_1795164797(piece_1795164798, board_1795164799) { - var result_1795164800 = false; +function HEX3Aanonymous_1828716698(piece_1828716699, board_1828716700, s_1828716701) { + var result_1828716702 = false; BeforeRet: { - result_1795164800 = !(contains_1795164801(piece_1795164798.moves, move_1795164795)); + result_1828716702 = !(contains_1828716703(piece_1828716699.moves, move_1828716696)); break BeforeRet; }; - return result_1795164800; + return result_1828716702; } - var result_1795164796 = null; + var result_1828716697 = null; - result_1795164796 = HEX3Aanonymous_1795164797; + result_1828716697 = HEX3Aanonymous_1828716698; - return result_1795164796; + return result_1828716697; } -function HEX3Aanonymous_1795164834(side_1795164835, __1795164836, b_1795164837) { - var action_1795164838 = buyMoveUpgrade_1795164784(HEX3Aanonymous_1509949890); - var condition_1795164839 = buyMoveUpgradeCondition_1795164794(HEX3Aanonymous_1509949890); - Label1: { - var i_1795164840 = 0; - var j_1795164841 = 0; - Label2: { - var i_1795165637 = 0; - var i_1795165638 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165638 < 8)) break Label4; - i_1795165637 = i_1795165638; - Label5: { - var j_1795165641 = 0; - var i_1795165642 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165642 < 8)) break Label7; - j_1795165641 = i_1795165642; - i_1795164840 = i_1795165637; - j_1795164841 = j_1795165641; - if (isColor_1476395605(b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)][chckIndx(j_1795164841, 0, (b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)]).length - 1)], side_1795164835)) { - if (!((b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)][chckIndx(j_1795164841, 0, (b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)]).length - 1)].item == 0))) { - b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)][chckIndx(j_1795164841, 0, (b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)]).length - 1)].wallet.Field1.push({Field0: [85,112,103,114,97,100,101], Field1: 7, Field2: action_1795164838, Field3: condition_1795164839});; - } - else { - b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)][chckIndx(j_1795164841, 0, (b_1795164837[chckIndx(i_1795164840, 0, (b_1795164837).length - 1)]).length - 1)].wallet.Field1.push({Field0: [85,112,103,114,97,100,101], Field1: 15, Field2: action_1795164838, Field3: condition_1795164839});; - } - - } - - i_1795165642 = addInt(i_1795165642, 1); - } - }; - }; - i_1795165638 = addInt(i_1795165638, 1); - } - }; +function exceptCost_1828716796(normalCost_1828716797, exceptPiece_1828716798, exceptCost_1828716799) { + +function HEX3Aanonymous_1828716801(piece_1828716802, b_1828716803, s_1828716804) { + var Temporary1; + + var result_1828716805 = 0; + + BeforeRet: { + if (!((piece_1828716802.item == exceptPiece_1828716798))) { + Temporary1 = normalCost_1828716797; + } + else { + Temporary1 = exceptCost_1828716799; + } + + result_1828716805 = Temporary1; + break BeforeRet; }; - }; + + return result_1828716805; + + } + + var result_1828716800 = null; + + result_1828716800 = HEX3Aanonymous_1828716801; + + return result_1828716800; + +} + +function HEX3Aanonymous_1795164773(side_1795164774, __1795164775, b_1795164776, s_1795164777) { + var action_1795164778 = buyMoveUpgrade_1828716669(HEX3Aanonymous_1543504322); + var condition_1795164779 = buyMoveUpgradeCondition_1828716695(HEX3Aanonymous_1543504322); + s_1795164777.Field1[chckIndx(side_1795164774, 0, (s_1795164777.Field1).length - 1)].buys.push({Field0: [85,112,103,114,97,100,101], Field1: exceptCost_1828716796(8, 0, 38), Field2: action_1795164778, Field3: condition_1795164779});; } -function HEX3Aanonymous_1795164877(side_1795164878, __1795164879, b_1795164880) { - var action_1795164881 = buyMoveUpgrade_1795164784(HEX3Aanonymous_1811939527); - var condition_1795164882 = buyMoveUpgradeCondition_1795164794(HEX3Aanonymous_1811939527); - Label1: { - var i_1795164883 = 0; - var j_1795164884 = 0; - Label2: { - var i_1795165650 = 0; - var i_1795165651 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165651 < 8)) break Label4; - i_1795165650 = i_1795165651; - Label5: { - var j_1795165654 = 0; - var i_1795165655 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165655 < 8)) break Label7; - j_1795165654 = i_1795165655; - i_1795164883 = i_1795165650; - j_1795164884 = j_1795165654; - if (isColor_1476395605(b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)][chckIndx(j_1795164884, 0, (b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)]).length - 1)], side_1795164878)) { - if (!((b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)][chckIndx(j_1795164884, 0, (b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)]).length - 1)].item == 0))) { - b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)][chckIndx(j_1795164884, 0, (b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)]).length - 1)].wallet.Field1.push({Field0: [85,112,103,114,97,100,101], Field1: 7, Field2: action_1795164881, Field3: condition_1795164882});; - } - else { - b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)][chckIndx(j_1795164884, 0, (b_1795164880[chckIndx(i_1795164883, 0, (b_1795164880).length - 1)]).length - 1)].wallet.Field1.push({Field0: [85,112,103,114,97,100,101], Field1: 15, Field2: action_1795164881, Field3: condition_1795164882});; - } - - } - - i_1795165655 = addInt(i_1795165655, 1); - } - }; - }; - i_1795165651 = addInt(i_1795165651, 1); - } - }; - }; - }; +function HEX3Aanonymous_1795164803(side_1795164804, __1795164805, b_1795164806, s_1795164807) { + var action_1795164808 = buyMoveUpgrade_1828716669(HEX3Aanonymous_1811939504); + var condition_1795164809 = buyMoveUpgradeCondition_1828716695(HEX3Aanonymous_1811939504); + s_1795164807.Field1[chckIndx(side_1795164804, 0, (s_1795164807.Field1).length - 1)].buys.push({Field0: [85,112,103,114,97,100,101], Field1: exceptCost_1828716796(8, 0, 38), Field2: action_1795164808, Field3: condition_1795164809});; } -function HEX3Aanonymous_1795164920(piece_1795164921, b_1795164922) { - b_1795164922[chckIndx(piece_1795164921.tile.Field1, 0, (b_1795164922).length - 1)][chckIndx(piece_1795164921.tile.Field0, 0, (b_1795164922[chckIndx(piece_1795164921.tile.Field1, 0, (b_1795164922).length - 1)]).length - 1)] = nimCopy(b_1795164922[chckIndx(piece_1795164921.tile.Field1, 0, (b_1795164922).length - 1)][chckIndx(piece_1795164921.tile.Field0, 0, (b_1795164922[chckIndx(piece_1795164921.tile.Field1, 0, (b_1795164922).length - 1)]).length - 1)], pieceCopy_1476395495(air_1493172398, 6, 1, 0, 0, piece_1795164921.tile, [], [], air_1493172398.onMove, air_1493172398.onTake, air_1493172398.whenTaken, [], [], false, [], true, false, air_1493172398.rand, air_1493172398.wallet), NTI1476395026); +function createPieceMarket_1795164853(cost_1795164854, rate_1795164855) { + +function HEX3Aanonymous_1795164859(piece_1795164860, b_1795164861, s_1795164862) { + var result_1795164863 = 0; + + var piecesSold_1795164864 = s_1795164862.Field1[chckIndx(piece_1795164860.color, 0, (s_1795164862.Field1).length - 1)].piecesSold; + if (!((s_1795164862.Field0.turnNumber == lastTurnSold_1795164857))) { + lastTurnSold_1795164857 = s_1795164862.Field0.turnNumber; + lastPiecesSold_1795164858 = piecesSold_1795164864; + } + + result_1795164863 = addInt(cost_1795164854, mulInt(rate_1795164855, subInt(lastPiecesSold_1795164858, piecesSold_1795164864))); + + return result_1795164863; + + } + + var result_1795164856 = null; + + var lastTurnSold_1795164857 = (-1); + var lastPiecesSold_1795164858 = 0; + result_1795164856 = HEX3Aanonymous_1795164859; + + return result_1795164856; + +} + +function HEX3Aanonymous_1795164833(piece_1795164834, b_1795164835, state_1795164836) { + b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)][chckIndx(piece_1795164834.tile.Field0, 0, (b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)]).length - 1)] = nimCopy(b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)][chckIndx(piece_1795164834.tile.Field0, 0, (b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)]).length - 1)], pieceCopy_1476396045(air_1526726831, b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)][chckIndx(piece_1795164834.tile.Field0, 0, (b_1795164835[chckIndx(piece_1795164834.tile.Field1, 0, (b_1795164835).length - 1)]).length - 1)].index, 6, 1, 0, 0, piece_1795164834.tile, [], [], air_1526726831.onMove, air_1526726831.onTake, air_1526726831.whenTaken, [], [], false, [], true, false, false), NTI1476395032); + state_1795164836.Field1[chckIndx(piece_1795164834.color, 0, (state_1795164836.Field1).length - 1)].piecesSold = addInt(state_1795164836.Field1[chckIndx(piece_1795164834.color, 0, (state_1795164836.Field1).length - 1)].piecesSold, 1); } -function HEX3Aanonymous_1795164924(piece_1795164925, b_1795164926) { - var result_1795164927 = false; +function HEX3Aanonymous_1795164843(piece_1795164844, board_1795164845, s_1795164846) { + var result_1795164847 = false; BeforeRet: { - result_1795164927 = true; + result_1795164847 = !((piece_1795164844.item == 0)); break BeforeRet; }; - return result_1795164927; + return result_1795164847; } -function HEX3Aanonymous_1795164929(side_1795164930, __1795164931, b_1795164932) { - Label1: { - var i_1795164933 = 0; - var j_1795164934 = 0; - Label2: { - var i_1795165659 = 0; - var i_1795165660 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165660 < 8)) break Label4; - i_1795165659 = i_1795165660; - Label5: { - var j_1795165663 = 0; - var i_1795165664 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165664 < 8)) break Label7; - j_1795165663 = i_1795165664; - i_1795164933 = i_1795165659; - j_1795164934 = j_1795165663; - if (isColor_1476395605(b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)][chckIndx(j_1795164934, 0, (b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)]).length - 1)], side_1795164930)) { - if (!((b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)][chckIndx(j_1795164934, 0, (b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)]).length - 1)].item == 0))) { - b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)][chckIndx(j_1795164934, 0, (b_1795164932[chckIndx(i_1795164933, 0, (b_1795164932).length - 1)]).length - 1)].wallet.Field1.push({Field0: [83,101,108,108], Field1: (-3), Field2: HEX3Aanonymous_1795164920, Field3: HEX3Aanonymous_1795164924});; - } - - } - - i_1795165664 = addInt(i_1795165664, 1); - } - }; - }; - i_1795165660 = addInt(i_1795165660, 1); - } - }; - }; - }; +function HEX3Aanonymous_1795164865(side_1795164866, __1795164867, b_1795164868, s_1795164869) { + s_1795164869.Field1[chckIndx(side_1795164866, 0, (s_1795164869.Field1).length - 1)].buys.push({Field0: [83,101,108,108], Field1: createPieceMarket_1795164853((-3), (-1)), Field2: HEX3Aanonymous_1795164833, Field3: HEX3Aanonymous_1795164843});; } -function createSuperLottery_1795164962() { +function createSuperLottery_1795164893() { -function HEX3Aanonymous_1795164965(piece_1795164966, board_1795164967) { - if (!((piece_1795164966.timesMoved == lastTimesMoved_1795164964))) { - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164966.tile.Field1), mulInt(100, piece_1795164966.tile.Field0)), piece_1795164966.rand.Field1))); - var ticket_1795164968 = rand_1644167304(100); - if (((ticket_1795164968 == 42) || (ticket_1795164968 == 17))) { +function HEX3Aanonymous_1795164896(piece_1795164897, board_1795164898, state_1795164899) { + if (!((piece_1795164897.timesMoved == lastTimesMoved_1795164895))) { + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164897.tile.Field1), mulInt(100, piece_1795164897.tile.Field0)), state_1795164899.Field0.randSeed))); + var ticket_1795164900 = rand_1644167304(100); + if ((ticket_1795164900 == 42)) { + addMoney_1828716586(piece_1795164897.color, 10, state_1795164899); Label1: { - var i_1795164969 = 0; - var j_1795164970 = 0; + var xHEX60gensym139_1795164905 = null; + var i_1795165890 = 0; + var L_1795165891 = (piece_1795164897.onPromote).length; Label2: { - var i_1795165677 = 0; - var i_1795165678 = 0; - Label3: { - Label4: while (true) { - if (!(i_1795165678 < 8)) break Label4; - i_1795165677 = i_1795165678; - Label5: { - var j_1795165681 = 0; - var i_1795165682 = 0; - Label6: { - Label7: while (true) { - if (!(i_1795165682 < 8)) break Label7; - j_1795165681 = i_1795165682; - i_1795164969 = i_1795165677; - j_1795164970 = j_1795165681; - if (((board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)][chckIndx(j_1795164970, 0, (board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)]).length - 1)].item == 0) && sameColor_1476395596(board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)][chckIndx(j_1795164970, 0, (board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)]).length - 1)], piece_1795164966))) { - board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)][chckIndx(j_1795164970, 0, (board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)]).length - 1)].wallet.Field0 = addInt(board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)][chckIndx(j_1795164970, 0, (board_1795164967[chckIndx(i_1795164969, 0, (board_1795164967).length - 1)]).length - 1)].wallet.Field0, 10); - } - - i_1795165682 = addInt(i_1795165682, 1); - } - }; - }; - i_1795165678 = addInt(i_1795165678, 1); - } - }; - }; - }; - Label8: { - var pHEX60gensym144_1795164983 = null; - var i_1795165685 = 0; - var L_1795165686 = (piece_1795164966.onPromote).length; - Label9: { - Label10: while (true) { - if (!(i_1795165685 < L_1795165686)) break Label10; - pHEX60gensym144_1795164983 = piece_1795164966.onPromote[chckIndx(i_1795165685, 0, (piece_1795164966.onPromote).length - 1)]; - pHEX60gensym144_1795164983(piece_1795164966, board_1795164967); - if (piece_1795164966.promoted) { - break Label8; + Label3: while (true) { + if (!(i_1795165890 < L_1795165891)) break Label3; + xHEX60gensym139_1795164905 = piece_1795164897.onPromote[chckIndx(i_1795165890, 0, (piece_1795164897.onPromote).length - 1)]; + xHEX60gensym139_1795164905(piece_1795164897, board_1795164898, state_1795164899); + if (piece_1795164897.promoted) { + break Label1; } - i_1795165685 += 1; - if (!(((piece_1795164966.onPromote).length == L_1795165686))) { + i_1795165890 += 1; + if (!(((piece_1795164897.onPromote).length == L_1795165891))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -6896,49 +7476,49 @@ function HEX3Aanonymous_1795164965(piece_1795164966, board_1795164967) { } - lastTimesMoved_1795164964 = piece_1795164966.timesMoved; + lastTimesMoved_1795164895 = piece_1795164897.timesMoved; } - var result_1795164963 = null; + var result_1795164894 = null; - var lastTimesMoved_1795164964 = 0; - result_1795164963 = HEX3Aanonymous_1795164965; + var lastTimesMoved_1795164895 = 0; + result_1795164894 = HEX3Aanonymous_1795164896; - return result_1795164963; + return result_1795164894; } -function HEX3Aanonymous_1795164986(side_1795164987, __1795164988, b_1795164989) { +function HEX3Aanonymous_1795164908(side_1795164909, __1795164910, b_1795164911, __1795164912) { Label1: { - var i_1795164990 = 0; - var j_1795164991 = 0; + var i_1795164913 = 0; + var j_1795164914 = 0; Label2: { - var i_1795165668 = 0; - var i_1795165669 = 0; + var i_1795165882 = 0; + var i_1795165883 = 0; Label3: { Label4: while (true) { - if (!(i_1795165669 < 8)) break Label4; - i_1795165668 = i_1795165669; + if (!(i_1795165883 < 8)) break Label4; + i_1795165882 = i_1795165883; Label5: { - var j_1795165672 = 0; - var i_1795165673 = 0; + var j_1795165886 = 0; + var i_1795165887 = 0; Label6: { Label7: while (true) { - if (!(i_1795165673 < 8)) break Label7; - j_1795165672 = i_1795165673; - i_1795164990 = i_1795165668; - j_1795164991 = j_1795165672; - if (((b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)][chckIndx(j_1795164991, 0, (b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)]).length - 1)].item == 3) && isColor_1476395605(b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)][chckIndx(j_1795164991, 0, (b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)]).length - 1)], side_1795164987))) { - b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)][chckIndx(j_1795164991, 0, (b_1795164989[chckIndx(i_1795164990, 0, (b_1795164989).length - 1)]).length - 1)].onEndTurn.push(createSuperLottery_1795164962());; + if (!(i_1795165887 < 8)) break Label7; + j_1795165886 = i_1795165887; + i_1795164913 = i_1795165882; + j_1795164914 = j_1795165886; + if (((b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)][chckIndx(j_1795164914, 0, (b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)]).length - 1)].item == 3) && isColor_1476396138(b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)][chckIndx(j_1795164914, 0, (b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)]).length - 1)], side_1795164909))) { + b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)][chckIndx(j_1795164914, 0, (b_1795164911[chckIndx(i_1795164913, 0, (b_1795164911).length - 1)]).length - 1)].onEndTurn.push(createSuperLottery_1795164893());; } - i_1795165673 = addInt(i_1795165673, 1); + i_1795165887 = addInt(i_1795165887, 1); } }; }; - i_1795165669 = addInt(i_1795165669, 1); + i_1795165883 = addInt(i_1795165883, 1); } }; }; @@ -6947,60 +7527,60 @@ function HEX3Aanonymous_1795164986(side_1795164987, __1795164988, b_1795164989) } -function HEX26_1795163937(x_1795163939, y_1795163940) { - var result_1795163941 = []; +function HEX26_1795163931(x_1795163933, y_1795163934) { + var result_1795163935 = []; - result_1795163941 = new Array(chckRange(addInt((x_1795163939).length, (y_1795163940).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1795163939).length, (y_1795163940).length), 0, 2147483647) ; ++i) { result_1795163941[i] = {Field0: 0, Field1: 0}; } Label1: { - var i_1795163959 = 0; - var colontmp__1795165698 = 0; - colontmp__1795165698 = subInt((x_1795163939).length, 1); - var res_1795165699 = 0; + result_1795163935 = new Array(chckRange(addInt((x_1795163933).length, (y_1795163934).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1795163933).length, (y_1795163934).length), 0, 2147483647) ; ++i) { result_1795163935[i] = {Field0: 0, Field1: 0}; } Label1: { + var i_1795163953 = 0; + var colontmp__1795165903 = 0; + colontmp__1795165903 = subInt((x_1795163933).length, 1); + var res_1795165904 = 0; Label2: { Label3: while (true) { - if (!(res_1795165699 <= colontmp__1795165698)) break Label3; - i_1795163959 = res_1795165699; - result_1795163941[chckIndx(i_1795163959, 0, (result_1795163941).length - 1)] = nimCopy(result_1795163941[chckIndx(i_1795163959, 0, (result_1795163941).length - 1)], x_1795163939[chckIndx(i_1795163959, 0, (x_1795163939).length - 1)], NTI1476395011); - res_1795165699 = addInt(res_1795165699, 1); + if (!(res_1795165904 <= colontmp__1795165903)) break Label3; + i_1795163953 = res_1795165904; + result_1795163935[chckIndx(i_1795163953, 0, (result_1795163935).length - 1)] = nimCopy(result_1795163935[chckIndx(i_1795163953, 0, (result_1795163935).length - 1)], x_1795163933[chckIndx(i_1795163953, 0, (x_1795163933).length - 1)], NTI1476395011); + res_1795165904 = addInt(res_1795165904, 1); } }; }; Label4: { - var i_1795163967 = 0; - var colontmp__1795165702 = 0; - colontmp__1795165702 = subInt((y_1795163940).length, 1); - var res_1795165703 = 0; + var i_1795163961 = 0; + var colontmp__1795165907 = 0; + colontmp__1795165907 = subInt((y_1795163934).length, 1); + var res_1795165908 = 0; Label5: { Label6: while (true) { - if (!(res_1795165703 <= colontmp__1795165702)) break Label6; - i_1795163967 = res_1795165703; - result_1795163941[chckIndx(addInt(i_1795163967, (x_1795163939).length), 0, (result_1795163941).length - 1)] = nimCopy(result_1795163941[chckIndx(addInt(i_1795163967, (x_1795163939).length), 0, (result_1795163941).length - 1)], y_1795163940[chckIndx(i_1795163967, 0, (y_1795163940).length - 1)], NTI1476395011); - res_1795165703 = addInt(res_1795165703, 1); + if (!(res_1795165908 <= colontmp__1795165907)) break Label6; + i_1795163961 = res_1795165908; + result_1795163935[chckIndx(addInt(i_1795163961, (x_1795163933).length), 0, (result_1795163935).length - 1)] = nimCopy(result_1795163935[chckIndx(addInt(i_1795163961, (x_1795163933).length), 0, (result_1795163935).length - 1)], y_1795163934[chckIndx(i_1795163961, 0, (y_1795163934).length - 1)], NTI1476395011); + res_1795165908 = addInt(res_1795165908, 1); } }; }; - return result_1795163941; + return result_1795163935; } -function HEX3Aanonymous_1795163932(piece_1795163933, board_1795163934) { +function HEX3Aanonymous_1795163925(piece_1795163926, board_1795163927, state_1795163928) { BeforeRet: { - if (!(piece_1795163933.rand.Field0)) { - piece_1795163933.rand.Field0 = true; - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795163933.tile.Field1), mulInt(100, piece_1795163933.tile.Field0)), piece_1795163933.rand.Field1))); - var takes_1795163935 = getTakesOn_1476395283(piece_1795163933, board_1795163934); - var moves_1795163936 = getMovesOn_1476395168(piece_1795163933, board_1795163934); - if (((HEX26_1795163937(moves_1795163936, takes_1795163935)).length == 0)) { + if (!(piece_1795163926.drunk)) { + piece_1795163926.drunk = true; + randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795163926.tile.Field1), mulInt(100, piece_1795163926.tile.Field0)), state_1795163928.Field0.randSeed))); + var takes_1795163929 = getTakesOn_1476395656(piece_1795163926, board_1795163927); + var moves_1795163930 = getMovesOn_1476395771(piece_1795163926, board_1795163927); + if (((HEX26_1795163931(moves_1795163930, takes_1795163929)).length == 0)) { break BeforeRet; } - var randomAction_1795163981 = nimCopy(null, sample_1795163902(HEX26_1795163937(moves_1795163936, takes_1795163935)), NTI1476395011); - if (contains_1476395777(takes_1795163935, randomAction_1795163981)) { - piece_1795163933.onTake(piece_1795163933, randomAction_1795163981, board_1795163934); + var randomAction_1795163975 = nimCopy(null, sample_1795163895(HEX26_1795163931(moves_1795163930, takes_1795163929)), NTI1476395011); + if (contains_1476395806(takes_1795163929, randomAction_1795163975)) { + piece_1795163926.onTake(piece_1795163926, randomAction_1795163975, board_1795163927, state_1795163928); } else { - if (contains_1476395777(moves_1795163936, randomAction_1795163981)) { - piece_1795163933.onMove(piece_1795163933, randomAction_1795163981, board_1795163934); + if (contains_1476395806(moves_1795163930, randomAction_1795163975)) { + piece_1795163926.onMove(piece_1795163926, randomAction_1795163975, board_1795163927, state_1795163928); } } } @@ -7010,36 +7590,36 @@ function HEX3Aanonymous_1795163932(piece_1795163933, board_1795163934) { } -function HEX3Aanonymous_1795164021(side_1795164022, __1795164023, b_1795164024) { +function HEX3Aanonymous_1795164017(side_1795164018, __1795164019, b_1795164020, __1795164021) { Label1: { - var i_1795164025 = 0; - var j_1795164026 = 0; + var i_1795164022 = 0; + var j_1795164023 = 0; Label2: { - var i_1795165690 = 0; - var i_1795165691 = 0; + var i_1795165895 = 0; + var i_1795165896 = 0; Label3: { Label4: while (true) { - if (!(i_1795165691 < 8)) break Label4; - i_1795165690 = i_1795165691; + if (!(i_1795165896 < 8)) break Label4; + i_1795165895 = i_1795165896; Label5: { - var j_1795165694 = 0; - var i_1795165695 = 0; + var j_1795165899 = 0; + var i_1795165900 = 0; Label6: { Label7: while (true) { - if (!(i_1795165695 < 8)) break Label7; - j_1795165694 = i_1795165695; - i_1795164025 = i_1795165690; - j_1795164026 = j_1795165694; - if (isColor_1476395605(b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)][chckIndx(j_1795164026, 0, (b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)]).length - 1)], side_1795164022)) { - b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)][chckIndx(j_1795164026, 0, (b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163932);; - b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)][chckIndx(j_1795164026, 0, (b_1795164024[chckIndx(i_1795164025, 0, (b_1795164024).length - 1)]).length - 1)].rotate = true; + if (!(i_1795165900 < 8)) break Label7; + j_1795165899 = i_1795165900; + i_1795164022 = i_1795165895; + j_1795164023 = j_1795165899; + if (isColor_1476396138(b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)][chckIndx(j_1795164023, 0, (b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)]).length - 1)], side_1795164018)) { + b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)][chckIndx(j_1795164023, 0, (b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795163925);; + b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)][chckIndx(j_1795164023, 0, (b_1795164020[chckIndx(i_1795164022, 0, (b_1795164020).length - 1)]).length - 1)].rotate = true; } - i_1795165695 = addInt(i_1795165695, 1); + i_1795165900 = addInt(i_1795165900, 1); } }; }; - i_1795165691 = addInt(i_1795165691, 1); + i_1795165896 = addInt(i_1795165896, 1); } }; }; @@ -7048,51 +7628,51 @@ function HEX3Aanonymous_1795164021(side_1795164022, __1795164023, b_1795164024) } -function HEX3Aanonymous_1811939512(board_1811939513, p_1811939514) { - var result_1811939515 = [[]]; +function HEX3Aanonymous_1811939489(board_1811939490, p_1811939491) { + var result_1811939492 = [[]]; - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777(1, 2), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777((-1), 2), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777(2, 1), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777(2, (-1)), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777(1, (-2)), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777((-1), (-2)), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777((-2), 1), false, true); - var _ = addIfTake_1509949547(result_1811939515, 0, board_1811939513, p_1811939514, p_1811939514.tile, shooterFactory_1526726777((-2), (-1)), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208(1, 2), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208((-1), 2), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208(2, 1), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208(2, (-1)), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208(1, (-2)), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208((-1), (-2)), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208((-2), 1), false, true); + var _ = addIfTake_1543503979(result_1811939492, 0, board_1811939490, p_1811939491, p_1811939491.tile, shooterFactory_1560281208((-2), (-1)), false, true); - return result_1811939515[0]; + return result_1811939492[0]; } -function HEX3Aanonymous_1795162844(side_1795162845, viewSide_1795162846, b_1795162847) { +function HEX3Aanonymous_1795162796(side_1795162797, viewSide_1795162798, b_1795162799, __1795162800) { Label1: { - var i_1795162848 = 0; - var j_1795162849 = 0; + var i_1795162801 = 0; + var j_1795162802 = 0; Label2: { - var i_1795165707 = 0; - var i_1795165708 = 0; + var i_1795165912 = 0; + var i_1795165913 = 0; Label3: { Label4: while (true) { - if (!(i_1795165708 < 8)) break Label4; - i_1795165707 = i_1795165708; + if (!(i_1795165913 < 8)) break Label4; + i_1795165912 = i_1795165913; Label5: { - var j_1795165711 = 0; - var i_1795165712 = 0; + var j_1795165916 = 0; + var i_1795165917 = 0; Label6: { Label7: while (true) { - if (!(i_1795165712 < 8)) break Label7; - j_1795165711 = i_1795165712; - i_1795162848 = i_1795165707; - j_1795162849 = j_1795165711; - if (((b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)][chckIndx(j_1795162849, 0, (b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)][chckIndx(j_1795162849, 0, (b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)]).length - 1)], side_1795162845))) { - b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)][chckIndx(j_1795162849, 0, (b_1795162847[chckIndx(i_1795162848, 0, (b_1795162847).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939512);; + if (!(i_1795165917 < 8)) break Label7; + j_1795165916 = i_1795165917; + i_1795162801 = i_1795165912; + j_1795162802 = j_1795165916; + if (((b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)][chckIndx(j_1795162802, 0, (b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)][chckIndx(j_1795162802, 0, (b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)]).length - 1)], side_1795162797))) { + b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)][chckIndx(j_1795162802, 0, (b_1795162799[chckIndx(i_1795162801, 0, (b_1795162799).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939489);; } - i_1795165712 = addInt(i_1795165712, 1); + i_1795165917 = addInt(i_1795165917, 1); } }; }; - i_1795165708 = addInt(i_1795165708, 1); + i_1795165913 = addInt(i_1795165913, 1); } }; }; @@ -7101,51 +7681,51 @@ function HEX3Aanonymous_1795162844(side_1795162845, viewSide_1795162846, b_17951 } -function HEX3Aanonymous_1811939517(board_1811939518, p_1811939519) { - var result_1811939520 = [[]]; +function HEX3Aanonymous_1811939494(board_1811939495, p_1811939496) { + var result_1811939497 = [[]]; - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777(1, 3), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777((-1), 3), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777(3, 1), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777(3, (-1)), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777(1, (-3)), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777((-1), (-3)), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777((-3), 1), false, true); - var _ = addIfTake_1509949547(result_1811939520, 0, board_1811939518, p_1811939519, p_1811939519.tile, shooterFactory_1526726777((-3), (-1)), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208(1, 3), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208((-1), 3), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208(3, 1), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208(3, (-1)), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208(1, (-3)), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208((-1), (-3)), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208((-3), 1), false, true); + var _ = addIfTake_1543503979(result_1811939497, 0, board_1811939495, p_1811939496, p_1811939496.tile, shooterFactory_1560281208((-3), (-1)), false, true); - return result_1811939520[0]; + return result_1811939497[0]; } -function HEX3Aanonymous_1795162873(side_1795162874, viewSide_1795162875, b_1795162876) { +function HEX3Aanonymous_1795162826(side_1795162827, viewSide_1795162828, b_1795162829, __1795162830) { Label1: { - var i_1795162877 = 0; - var j_1795162878 = 0; + var i_1795162831 = 0; + var j_1795162832 = 0; Label2: { - var i_1795165716 = 0; - var i_1795165717 = 0; + var i_1795165921 = 0; + var i_1795165922 = 0; Label3: { Label4: while (true) { - if (!(i_1795165717 < 8)) break Label4; - i_1795165716 = i_1795165717; + if (!(i_1795165922 < 8)) break Label4; + i_1795165921 = i_1795165922; Label5: { - var j_1795165720 = 0; - var i_1795165721 = 0; + var j_1795165925 = 0; + var i_1795165926 = 0; Label6: { Label7: while (true) { - if (!(i_1795165721 < 8)) break Label7; - j_1795165720 = i_1795165721; - i_1795162877 = i_1795165716; - j_1795162878 = j_1795165720; - if (((b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)][chckIndx(j_1795162878, 0, (b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)]).length - 1)].item == 1) && isColor_1476395605(b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)][chckIndx(j_1795162878, 0, (b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)]).length - 1)], side_1795162874))) { - b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)][chckIndx(j_1795162878, 0, (b_1795162876[chckIndx(i_1795162877, 0, (b_1795162876).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939517);; + if (!(i_1795165926 < 8)) break Label7; + j_1795165925 = i_1795165926; + i_1795162831 = i_1795165921; + j_1795162832 = j_1795165925; + if (((b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)][chckIndx(j_1795162832, 0, (b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)]).length - 1)].item == 1) && isColor_1476396138(b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)][chckIndx(j_1795162832, 0, (b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)]).length - 1)], side_1795162827))) { + b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)][chckIndx(j_1795162832, 0, (b_1795162829[chckIndx(i_1795162831, 0, (b_1795162829).length - 1)]).length - 1)].takes.push(HEX3Aanonymous_1811939494);; } - i_1795165721 = addInt(i_1795165721, 1); + i_1795165926 = addInt(i_1795165926, 1); } }; }; - i_1795165717 = addInt(i_1795165717, 1); + i_1795165922 = addInt(i_1795165922, 1); } }; }; @@ -7153,246 +7733,117 @@ function HEX3Aanonymous_1795162873(side_1795162874, viewSide_1795162875, b_17951 } -registerPower_1728053889(altEmpress_1795162231); -registerPower_1728053889(mysteriousSwordsmanLeft_1795162411); -registerPower_1728053889(mysteriousSwordsmanRight_1795162462); -registerPower_1728053889(developed_1795162471); -registerPower_1728053889(stepOnMe_1795162490); -registerPower_1728053889(illegalFormationBL_1795162520); -registerPower_1728053889(illegalFormationBR_1795162530); -registerPower_1728053889(illegalFormationRL_1795162500); -registerPower_1728053889(illegalFormationRR_1795162510); -registerPower_1728053889(putInTheWork_1795162571); -registerPower_1728053889(wanderingRoninLeft_1795162618); -registerPower_1728053889(wanderingRoninRight_1795162665); -registerPower_1728053889(archBishops_1795162765); -registerPower_1728053889(werewolves_1795162746); -registerPower_1728053889(giraffe_1795162793); -registerPower_1728053889(sacrifice_1795162933); -registerPower_1728053889(calvary_1795162816); -registerPower_1728053889(backStep_1795163068); -registerPower_1728053889(headStart_1795163095); -registerPower_1728053889(queenTrade_1795163106); -registerPower_1728053889(lesbianPride_1795163168); -registerPower_1728053889(knightChargePower_1795163297); -registerPower_1728053889(nightRider_1795163421); -registerPower_1728053889(desegregation_1795163440); -registerPower_1728053889(concubine_1795163535); -registerPower_1728053889(reinforcements_1795163574); -registerPower_1728053889(shotgunKing_1795163619); -registerPower_1728053889(coward_1795163674); -registerPower_1728053889(lanceLeft_1795163876); -registerPower_1728053889(lanceRight_1795163825); -registerPower_1728053889(drunkKnights_1795164009); -registerPower_1728053889(alcoholism_1795164020); -registerPower_1728053889(civilians_1795164230); -registerPower_1728053889(slumdogMillionaire_1795164333); -registerPower_1728053889(stupidPower_1795164359); -registerPower_1728053889(americanDream_1795164452); -registerPower_1728053889(sleeperAgent_1795164504); -registerPower_1728053889(capitalism_1795164632); -registerSynergy_1728053325({Field0: {name: [65,110,105,109,101,32,66,97,116,116,108,101], technicalName: [], synergy: true, tier: 2, rarity: 0, description: makeNimstrLit("Your board is imbued with the power of anime. You feel a odd sense of regret. Or is it guilt?"), icon: [103,111,108,100,103,101,110,101,114,97,108,46,115,118,103], rotatable: true, noColor: true, onStart: HEX3Aanonymous_1795162817, index: (-1), priority: 5}, Field1: 32, Field2: [[77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110]], Field3: [[77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [65,110,105,109,101,32,66,97,116,116,108,101]], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], technicalName: [], synergy: true, tier: 2, rarity: 4, description: [67,72,65,82,71,69,33,32,89,111,117,114,32,107,110,105,103,104,116,115,32,115,116,97,114,116,32,51,32,116,105,108,101,115,32,97,104,101,97,100,46], icon: [107,110,105,103,104,116,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163277, index: (-1), priority: 20}, Field1: 16, Field2: [[67,97,108,118,97,114,121]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,114,105,109,105,110,97,108,32,70,111,114,109,97,116,105,111,110], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("I guess the rules didn\'t get to you. Your pawns above both knights and both rooks swap places with those pieces."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163335, index: (-1), priority: 20}, Field1: 12, Field2: [[73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field3: [[73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [76,105,110,101,98,97,99,107,101,114,115], technicalName: [], synergy: true, tier: 2, rarity: 0, description: makeNimstrLit("Your pawns learn to fight like men. They can take one spaces ahead too."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163362, index: (-1), priority: 15}, Field1: 0, Field2: [[80,117,116,32,105,110,32,116,104,101,32,119,111,114,107,33], [72,101,97,100,115,116,97,114,116]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [72,111,108,121,32,66,105,115,104,111,112,115], technicalName: [], synergy: true, tier: 2, rarity: 8, description: [71,111,100,32,104,97,115,32,98,108,101,115,115,101,100,32,121,111,117,114,32,98,105,115,104,111,112,115,46,32], icon: [99,114,111,115,115,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795163441, index: (-1), priority: 15}, Field1: 8, Field2: [[65,114,99,104,98,105,115,104,111,112,115], [72,111,108,121]], Field3: [[65,114,99,104,98,105,115,104,111,112,115]], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [66,111,117,110,116,121,32,72,117,110,116,101,114], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("It\'s hard to make a living these days. If your king takes 3 pieces, you automatically win."), icon: [107,105,110,103,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163630, index: (-1), priority: 15}, Field1: 16, Field2: [[83,104,111,116,103,117,110,32,75,105,110,103]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [71,111,100,39,115,32,68,105,115,99,105,112,108,101], technicalName: [], synergy: true, tier: 1, rarity: 8, description: makeNimstrLit("Your bishop has now seen god. When it takes, it has a 30% chance to convert it to your color. \x0A When this happens, your bishop swaps places with it instead of taking it."), icon: [98,105,115,104,111,112,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164407, index: (-1), priority: 15}, Field1: 16, Field2: [[67,111,110,118,101,114,115,105,111,110], [72,111,108,121]], Field3: [[67,111,110,118,101,114,115,105,111,110]], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [69,120,111,100,105,97], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,100,32,121,111,117,114,32,102,117,110,44,32,98,117,116,32,116,104,101,32,103,97,109,101,32,105,115,32,111,118,101,114,46,32,84,111,111,32,98,97,100,32,114,105,103,104,116,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162959, index: (-1), priority: 25}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [69,120,111,100,105,97], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,100,32,121,111,117,114,32,102,117,110,44,32,98,117,116,32,116,104,101,32,103,97,109,101,32,105,115,32,111,118,101,114,46,32,84,111,111,32,98,97,100,32,114,105,103,104,116,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163013, index: (-1), priority: 25}, Field1: 0, Field2: [[65,108,116,101,114,110,97,116,105,118,101,32,69,109,112,114,101,115,115], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [83,117,112,101,114,32,80,97,119,110], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,118,101,32,105,110,115,97,110,101,32,112,97,119,110,115,46,32,80,108,101,97,115,101,32,100,111,110,39,116,32,115,97,99,114,105,102,105,99,101,32,116,104,101,109,46], icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163107, index: (-1), priority: 15}, Field1: 0, Field2: [[66,97,99,107,115,116,101,112], [72,101,97,100,115,116,97,114,116]], Field3: [[66,97,99,107,115,116,101,112], [72,101,97,100,115,116,97,114,116]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [87,104,121,32,109,117,115,116,32,115,104,101,32,100,105,101,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163169, index: (-1), priority: 1}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [81,117,101,101,110,32,84,114,97,100,101]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [87,104,121,32,109,117,115,116,32,115,104,101,32,100,105,101,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163169, index: (-1), priority: 1}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [66,97,116,116,108,101,32,70,111,114,109,97,116,105,111,110,33], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [82,101,97,108,32,69,115,116,97,116,101,32,105,115,32,103,111,105,110,103,32,99,114,97,122,121,32,119,105,116,104,32,104,111,119,32,100,101,118,101,108,111,112,101,100,32,116,104,101,32,98,111,97,114,100,32,105,115,46], icon: [107,110,105,103,104,116,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163312, index: (-1), priority: 20}, Field1: 0, Field2: [[75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [68,101,118,101,108,111,112,101,100]], Field3: [[68,101,118,101,108,111,112,101,100]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [70,97,108,108,101,110,32,81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: makeNimstrLit("Why must she die? They will suffer. They will suffer. They will suffer. \x0A They will suffer. They will suffer. They will suffer. They will suffer. \x0A They will suffer. They will suffer. They will suffer. They will suffer.\x0A They will suffer. They will suffer. They will suffer. They will suffer."), icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163200, index: (-1), priority: 0}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [81,117,101,101,110,32,84,114,97,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [66,97,110,100,97,105,100], technicalName: [], synergy: true, tier: 3, rarity: 0, description: makeNimstrLit("It turns out that calvary plus giraffe is an automatic checkmate for white, \x0A so I\'m making the giraffes start one tile back. Sorry."), icon: [103,105,114,97,102,102,101,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164231, index: (-1), priority: 26}, Field1: 0, Field2: [[75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [71,105,114,97,102,102,101]], Field3: [], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [66,111,117,110,116,121,32,72,117,110,116,101,114,32,78,101,114,102], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Yeah, 3 pieces is way too easy for our lesbian queens, so now it\'s 7 pieces. You got this!"), icon: [107,105,110,103,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164276, index: (-1), priority: 15}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [66,111,117,110,116,121,32,72,117,110,116,101,114]], Field3: [[66,111,117,110,116,121,32,72,117,110,116,101,114]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,77,111,118,101,32,85,112], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Money is pretty neat right? You can spend 5 dollars to move a piece one tile forward. It cannot take with this action."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164669, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,77,111,118,101,32,66,97,99,107], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Money is pretty neat right? You can spend 4 dollars to move a piece one tile backwards. It cannot take with this action."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164714, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,73,110,99,111,109,101], synergy: true, tier: 0, rarity: 0, description: [72,101,114,101,44,32,104,97,118,101,32,49,48,32,100,111,108,108,97,114,115], icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164755, index: (-1), priority: 35}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,85,112,103,114,97,100,101,32,75,110,105,103,104,116], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Money can be used in exchange for goods and services. You can spend 7 dollars to give a piece the movement of a knight.\x0A It still cannot take like a knight."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164834, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,85,112,103,114,97,100,101,32,71,105,114,97,102,102,101], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Money can be used in exchange for goods and services. You can spend 7 dollars to give a piece the movement of a knight. \x0A This upgrade is 8 dollars more expensive for the king. It still cannot take like a giraffe."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164877, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,86], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,83,101,108,108], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Who needs these pieces? AFUERA! You can sell a piece for 3 dollars."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164929, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); -registerSynergy_1728053325({Field0: {name: [83,108,117,109,100,111,103,32,66,105,108,108,105,111,110,97,105,114,101], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Have you seen the movie Slumdog Millionaire? It\'s kind of like that but more. \x0A Your pawns have a 2% chance of promoting whenever they move. When this happens, you get 10 dollars."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164986, index: (-1), priority: 15}, Field1: 8, Field2: [[67,97,112,105,116,97,108,105,115,109], [83,108,117,109,100,111,103,32,77,105,108,108,105,111,110,97,105,114,101]], Field3: [[83,108,117,109,100,111,103,32,77,105,108,108,105,111,110,97,105,114,101]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [75,97,109,105,107,97,122,101], [72,101,97,100,115,116,97,114,116], [77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [66,97,99,107,115,116,101,112], [75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [65,108,116,101,114,110,97,116,105,118,101,32,69,109,112,114,101,115,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [83,117,112,101,114,32,80,97,119,110], [69,109,112,114,101,115,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [83,116,101,112,32,111,110,32,109,101], [67,111,119,97,114,100], [83,104,111,116,103,117,110,32,75,105,110,103]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [82,101,105,110,102,111,114,99,101,109,101,110,116,115], [69,109,112,114,101,115,115], [71,105,114,97,102,102,101], [87,101,114,101,119,111,108,118,101,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [65,110,105,109,101,32,66,97,116,116,108,101], [68,101,118,101,108,111,112,101,100], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110], [73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164021, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [76,105,110,101,98,97,99,107,101,114,115], [78,105,103,104,116,114,105,100,101,114], [68,101,115,101,103,114,101,103,97,116,105,111,110,32,97,110,100,32,73,110,116,101,103,114,97,116,105,111,110], [72,111,108,121]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); -registerSynergy_1728053325({Field0: {name: [77,97,115,111,99,104,105,115,116,32,69,109,112,114,101,115,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [78,79,78,69], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162844, index: (-1), priority: 15}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,116,101,112,32,111,110,32,109,101]], Field3: [], Field4: (-1)}, true, true); -registerSynergy_1728053325({Field0: {name: [77,97,115,111,99,104,105,115,116,32,69,109,112,114,101,115,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [78,79,78,69], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162873, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,116,101,114,110,97,116,105,118,101,32,69,109,112,114,101,115,115], [83,116,101,112,32,111,110,32,109,101]], Field3: [], Field4: (-1)}, true, true); +registerPower_1728053874(empress_1795162191); +registerPower_1728053874(altEmpress_1795162219); +registerPower_1728053874(mysteriousSwordsmanLeft_1795162402); +registerPower_1728053874(mysteriousSwordsmanRight_1795162454); +registerPower_1728053874(developed_1795162464); +registerPower_1728053874(stepOnMe_1795162484); +registerPower_1728053874(illegalFormationBL_1795162517); +registerPower_1728053874(illegalFormationBR_1795162528); +registerPower_1728053874(illegalFormationRL_1795162495); +registerPower_1728053874(illegalFormationRR_1795162506); +registerPower_1728053874(putInTheWork_1795162556); +registerPower_1728053874(wanderingRoninLeft_1795162604); +registerPower_1728053874(wanderingRoninRight_1795162652); +registerPower_1728053874(archBishops_1795162714); +registerPower_1728053874(werewolves_1795162694); +registerPower_1728053874(giraffe_1795162743); +registerPower_1728053874(sacrifice_1795162889); +registerPower_1728053874(calvary_1795162767); +registerPower_1728053874(backStep_1795163029); +registerPower_1728053874(headStart_1795163057); +registerPower_1728053874(queenTrade_1795163069); +registerPower_1728053874(lesbianPride_1795163133); +registerPower_1728053874(knightChargePower_1795163281); +registerPower_1728053874(nightRider_1795163409); +registerPower_1728053874(desegregation_1795163429); +registerPower_1728053874(concubine_1795163528); +registerPower_1728053874(reinforcements_1795163569); +registerPower_1728053874(shotgunKing_1795163616); +registerPower_1728053874(coward_1795163674); +registerPower_1728053874(lanceLeft_1795163868); +registerPower_1728053874(lanceRight_1795163816); +registerPower_1728053874(drunkKnights_1795164004); +registerPower_1728053874(alcoholism_1795164016); +registerPower_1728053874(civilians_1795164230); +registerPower_1728053874(slumdogMillionaire_1795164338); +registerPower_1728053874(stupidPower_1795164366); +registerPower_1728053874(conversion_1795164397); +registerPower_1728053874(americanDream_1795164465); +registerPower_1728053874(sleeperAgent_1795164518); +registerPower_1728053874(capitalismPower_1795164628); +registerPower_1728053874(skyGlass_1795165113); +registerPower_1728053874(zeroGlass_1795165125); +registerPower_1728053874(steelGlass_1795165218); +registerSynergy_1728053330({Field0: {name: [65,110,105,109,101,32,66,97,116,116,108,101], technicalName: [], synergy: true, tier: 2, rarity: 0, description: makeNimstrLit("Your board is imbued with the power of anime. You feel a odd sense of regret. Or is it guilt?"), icon: [103,111,108,100,103,101,110,101,114,97,108,46,115,118,103], rotatable: true, noColor: true, onStart: HEX3Aanonymous_1795162768, index: (-1), priority: 5}, Field1: 32, Field2: [[77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110]], Field3: [[77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [65,110,105,109,101,32,66,97,116,116,108,101]], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], technicalName: [], synergy: true, tier: 2, rarity: 4, description: [67,72,65,82,71,69,33,32,89,111,117,114,32,107,110,105,103,104,116,115,32,115,116,97,114,116,32,51,32,116,105,108,101,115,32,97,104,101,97,100,46], icon: [107,110,105,103,104,116,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163260, index: (-1), priority: 20}, Field1: 16, Field2: [[67,97,108,118,97,114,121]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,114,105,109,105,110,97,108,32,70,111,114,109,97,116,105,111,110], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("I guess the rules didn\'t get to you. Your pawns above both knights and both rooks swap places with those pieces."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163320, index: (-1), priority: 20}, Field1: 12, Field2: [[73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field3: [[73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [76,105,110,101,98,97,99,107,101,114,115], technicalName: [], synergy: true, tier: 2, rarity: 0, description: makeNimstrLit("Your pawns learn to fight like men. They can take one spaces ahead too."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163348, index: (-1), priority: 15}, Field1: 0, Field2: [[80,117,116,32,105,110,32,116,104,101,32,119,111,114,107,33], [72,101,97,100,115,116,97,114,116]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [72,111,108,121,32,66,105,115,104,111,112,115], technicalName: [], synergy: true, tier: 2, rarity: 8, description: [71,111,100,32,104,97,115,32,98,108,101,115,115,101,100,32,121,111,117,114,32,98,105,115,104,111,112,115,46,32], icon: [99,114,111,115,115,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795163430, index: (-1), priority: 15}, Field1: 8, Field2: [[65,114,99,104,98,105,115,104,111,112,115], [72,111,108,121]], Field3: [[65,114,99,104,98,105,115,104,111,112,115]], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [66,111,117,110,116,121,32,72,117,110,116,101,114], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("It\'s hard to make a living these days. If your king takes 3 pieces, you automatically win."), icon: [107,105,110,103,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163628, index: (-1), priority: 15}, Field1: 16, Field2: [[83,104,111,116,103,117,110,32,75,105,110,103]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [71,111,100,39,115,32,68,105,115,99,105,112,108,101], technicalName: [], synergy: true, tier: 1, rarity: 8, description: makeNimstrLit("Your bishop has now seen god. When it takes, it has a 30% chance to convert it to your color. \x0A When this happens, your bishop swaps places with it instead of taking it."), icon: [98,105,115,104,111,112,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164417, index: (-1), priority: 15}, Field1: 16, Field2: [[67,111,110,118,101,114,115,105,111,110], [72,111,108,121]], Field3: [[67,111,110,118,101,114,115,105,111,110]], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [69,120,111,100,105,97], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,100,32,121,111,117,114,32,102,117,110,44,32,98,117,116,32,116,104,101,32,103,97,109,101,32,105,115,32,111,118,101,114,46,32,84,111,111,32,98,97,100,32,114,105,103,104,116,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162916, index: (-1), priority: 25}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [69,120,111,100,105,97], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,100,32,121,111,117,114,32,102,117,110,44,32,98,117,116,32,116,104,101,32,103,97,109,101,32,105,115,32,111,118,101,114,46,32,84,111,111,32,98,97,100,32,114,105,103,104,116,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162972, index: (-1), priority: 25}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [83,117,112,101,114,32,80,97,119,110], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [89,111,117,32,104,97,118,101,32,105,110,115,97,110,101,32,112,97,119,110,115,46,32,80,108,101,97,115,101,32,100,111,110,39,116,32,115,97,99,114,105,102,105,99,101,32,116,104,101,109,46], icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163070, index: (-1), priority: 15}, Field1: 0, Field2: [[66,97,99,107,115,116,101,112], [72,101,97,100,115,116,97,114,116]], Field3: [[66,97,99,107,115,116,101,112], [72,101,97,100,115,116,97,114,116]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [87,104,121,32,109,117,115,116,32,115,104,101,32,100,105,101,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163134, index: (-1), priority: 1}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [81,117,101,101,110,32,84,114,97,100,101]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [87,104,121,32,109,117,115,116,32,115,104,101,32,100,105,101,63], icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163134, index: (-1), priority: 1}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [66,97,116,116,108,101,32,70,111,114,109,97,116,105,111,110,33], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [82,101,97,108,32,69,115,116,97,116,101,32,105,115,32,103,111,105,110,103,32,99,114,97,122,121,32,119,105,116,104,32,104,111,119,32,100,101,118,101,108,111,112,101,100,32,116,104,101,32,98,111,97,114,100,32,105,115,46], icon: [107,110,105,103,104,116,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163296, index: (-1), priority: 20}, Field1: 0, Field2: [[75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [68,101,118,101,108,111,112,101,100]], Field3: [[68,101,118,101,108,111,112,101,100]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [70,97,108,108,101,110,32,81,117,101,101,110,39,115,32,87,114,97,116,104], technicalName: [], synergy: true, tier: 3, rarity: 0, description: makeNimstrLit("Why must she die? They will suffer. They will suffer. They will suffer. \x0A They will suffer. They will suffer. They will suffer. They will suffer. \x0A They will suffer. They will suffer. They will suffer. They will suffer.\x0A They will suffer. They will suffer. They will suffer. They will suffer."), icon: [113,117,101,101,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795163166, index: (-1), priority: 0}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [81,117,101,101,110,32,84,114,97,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field3: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [66,97,110,100,97,105,100], technicalName: [], synergy: true, tier: 3, rarity: 0, description: makeNimstrLit("It turns out that calvary plus giraffe is an automatic checkmate for white, \x0A so I\'m making the giraffes start one tile back. Sorry."), icon: [103,105,114,97,102,102,101,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164231, index: (-1), priority: 26}, Field1: 0, Field2: [[75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [71,105,114,97,102,102,101]], Field3: [], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [66,111,117,110,116,121,32,72,117,110,116,101,114,32,78,101,114,102], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Yeah, 3 pieces is way too easy for our lesbian queens, so now it\'s 7 pieces. You got this!"), icon: [107,105,110,103,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164278, index: (-1), priority: 15}, Field1: 0, Field2: [[76,101,115,98,105,97,110,32,80,114,105,100,101], [66,111,117,110,116,121,32,72,117,110,116,101,114]], Field3: [[66,111,117,110,116,121,32,72,117,110,116,101,114]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,77,111,118,101,32,85,112], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Money is pretty neat right? You can spend 8 dollars to move a piece one tile forward. It cannot take with this action."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164669, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,77,111,118,101,32,66,97,99,107], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Money is pretty neat right? You can spend 7 dollars to move a piece one tile backwards. It cannot take with this action."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164713, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,73,110,99,111,109,101], synergy: true, tier: 0, rarity: 0, description: [72,101,114,101,44,32,104,97,118,101,32,49,48,32,100,111,108,108,97,114,115], icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164753, index: (-1), priority: 35}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,85,112,103,114,97,100,101,32,75,110,105,103,104,116], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Money can be used in exchange for goods and services. You can spend 8 dollars to give a piece the movement of a knight.\x0A This upgrade is 30 dollars more expensive for the king. The upgraded piece still cannot take like a knight."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164773, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,73,73], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,85,112,103,114,97,100,101,32,71,105,114,97,102,102,101], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Money can be used in exchange for goods and services. You can spend 8 dollars to give a piece the movement of a knight. \x0A This upgrade is 30 dollars more expensive for the king. The upgraded piece still cannot take like a giraffe."), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164803, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,86], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,83,101,108,108], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Who needs these pieces? AFUERA! You can sell a piece for 3 dollars. Each subsequent piece sold gives one less. "), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164865, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109]], Field3: [], Field4: (-1)}, false, false); +registerSynergy_1728053330({Field0: {name: [67,97,112,105,116,97,108,105,115,109,32,73,86], technicalName: [67,97,112,105,116,97,108,105,115,109,58,32,83,101,108,108], synergy: true, tier: 1, rarity: 0, description: makeNimstrLit("Who needs these pieces? AFUERA! You can sell a piece for 3 dollars. Each subsequent piece sold gives one less. "), icon: [117,115,102,108,97,103,46,115,118,103], rotatable: false, noColor: true, onStart: HEX3Aanonymous_1795164865, index: (-1), priority: 15}, Field1: 16, Field2: [[67,97,112,105,116,97,108,105,115,109], [67,97,112,105,116,97,108,105,115,109,32,73,73], [67,97,112,105,116,97,108,105,115,109,32,73,73,73], [67,97,112,105,116,97,108,105,115,109,32,73,86]], Field3: [], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [83,108,117,109,100,111,103,32,66,105,108,108,105,111,110,97,105,114,101], technicalName: [], synergy: true, tier: 0, rarity: 0, description: makeNimstrLit("Have you seen the movie Slumdog Millionaire? It\'s kind of like that but more. \x0A Your pawns have a 2% chance of promoting whenever they move. When this happens, you get 10 dollars."), icon: [112,97,119,110,46,115,118,103], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164908, index: (-1), priority: 15}, Field1: 8, Field2: [[67,97,112,105,116,97,108,105,115,109], [83,108,117,109,100,111,103,32,77,105,108,108,105,111,110,97,105,114,101]], Field3: [[83,108,117,109,100,111,103,32,77,105,108,108,105,111,110,97,105,114,101]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [75,97,109,105,107,97,122,101], [72,101,97,100,115,116,97,114,116], [77,121,115,116,101,114,105,111,117,115,32,83,119,111,114,100,115,109,97,110]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [66,97,99,107,115,116,101,112], [75,110,105,103,104,116,39,115,32,67,104,97,114,103,101], [69,109,112,114,101,115,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [87,97,110,100,101,114,105,110,103,32,82,111,110,105,110], [83,117,112,101,114,32,80,97,119,110], [69,109,112,114,101,115,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [83,116,101,112,32,111,110,32,109,101], [67,111,119,97,114,100], [83,104,111,116,103,117,110,32,75,105,110,103]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [82,101,105,110,102,111,114,99,101,109,101,110,116,115], [69,109,112,114,101,115,115], [71,105,114,97,102,102,101], [87,101,114,101,119,111,108,118,101,115]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [65,110,105,109,101,32,66,97,116,116,108,101], [68,101,118,101,108,111,112,101,100], [83,97,99,114,105,102,105,99,105,97,108,32,77,97,105,100,101,110], [73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [118,105,114,117,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46,32,84,104,101,121,39,114,101,32,100,121,105,110,103,46], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795164017, index: (-1), priority: 15}, Field1: 0, Field2: [[65,108,99,111,104,111,108,105,115,109], [76,105,110,101,98,97,99,107,101,114,115], [78,105,103,104,116,114,105,100,101,114], [68,101,115,101,103,114,101,103,97,116,105,111,110,32,97,110,100,32,73,110,116,101,103,114,97,116,105,111,110], [72,111,108,121]], Field3: [[65,108,99,111,104,111,108,105,115,109]], Field4: (-1)}, true, false); +registerSynergy_1728053330({Field0: {name: [77,97,115,111,99,104,105,115,116,32,69,109,112,114,101,115,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [78,79,78,69], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162796, index: (-1), priority: 15}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,116,101,112,32,111,110,32,109,101]], Field3: [], Field4: (-1)}, true, true); +registerSynergy_1728053330({Field0: {name: [77,97,115,111,99,104,105,115,116,32,69,109,112,114,101,115,115], technicalName: [], synergy: true, tier: 3, rarity: 0, description: [78,79,78,69], icon: [], rotatable: false, noColor: false, onStart: HEX3Aanonymous_1795162826, index: (-1), priority: 15}, Field1: 0, Field2: [[69,109,112,114,101,115,115], [83,116,101,112,32,111,110,32,109,101]], Field3: [], Field4: (-1)}, true, true); function increment(item) { window.localStorage.setItem(item, parseInt(localStorage.getItem(item)) + 1); } -function HEX3Aanonymous_1493172227(taken_1493172228, taker_1493172229, board_1493172230) { - var result_1493172233 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; - - BeforeRet: { - if ((((((taker_1493172229.item == 0) && (taken_1493172228.item == 4)) && sameColor_1476395596(taken_1493172228, taker_1493172229)) && (taker_1493172229.timesMoved == 0)) && (taken_1493172228.timesMoved == 0))) { - var kingTile_1493172242 = nimCopy(null, taker_1493172229.tile, NTI1476395011); - if ((taken_1493172228.tile.Field0 == 0)) { - pieceMove_1476395295(taker_1493172229, kingTile_1493172242.Field1, subInt(kingTile_1493172242.Field0, 2), board_1493172230); - pieceMove_1476395295(taken_1493172228, kingTile_1493172242.Field1, subInt(kingTile_1493172242.Field0, 1), board_1493172230); - var colontmp__553649527 = {Field0: subInt(kingTile_1493172242.Field0, 1), Field1: kingTile_1493172242.Field1}; - var colontmp__553649528 = false; - result_1493172233 = nimCopy(result_1493172233, {Field0: nimCopy(null, colontmp__553649527, NTI1476395011), Field1: colontmp__553649528}, NTI1493172231); - break BeforeRet; - } - else { - pieceMove_1476395295(taker_1493172229, kingTile_1493172242.Field1, addInt(kingTile_1493172242.Field0, 2), board_1493172230); - pieceMove_1476395295(taken_1493172228, kingTile_1493172242.Field1, addInt(kingTile_1493172242.Field0, 1), board_1493172230); - var colontmp__553649529 = {Field0: addInt(kingTile_1493172242.Field0, 1), Field1: kingTile_1493172242.Field1}; - var colontmp__553649530 = false; - result_1493172233 = nimCopy(result_1493172233, {Field0: nimCopy(null, colontmp__553649529, NTI1476395011), Field1: colontmp__553649530}, NTI1493172231); - break BeforeRet; - } - - } - else { - result_1493172233 = nimCopy(result_1493172233, HEX3Aanonymous_1476395442(taken_1493172228, taker_1493172229, board_1493172230), NTI1493172231); - break BeforeRet; - } - - }; - - return result_1493172233; - -} - -function inCheck_1509949445(p_1509949446, b_1509949447) { - var result_1509949739 = false; - - BeforeRet: { - Label1: { - var i_1509949744 = 0; - var res_553649539 = 0; - Label2: { - Label3: while (true) { - if (!(res_553649539 <= 7)) break Label3; - i_1509949744 = res_553649539; - Label4: { - var j_1509949749 = 0; - var res_553649537 = 0; - Label5: { - Label6: while (true) { - if (!(res_553649537 <= 7)) break Label6; - j_1509949749 = res_553649537; - var piece_1509949750 = nimCopy(null, b_1509949447[chckIndx(i_1509949744, 0, (b_1509949447).length - 1)][chckIndx(j_1509949749, 0, (b_1509949447[chckIndx(i_1509949744, 0, (b_1509949447).length - 1)]).length - 1)], NTI1476395026); - if ((piece_1509949750.item == 0)) { - var resultHEX60gensym3_1509949779 = newSeq_1509949756(0); - Label7: { - var it_1509949783 = null; - var i_553649534 = 0; - var L_553649535 = (piece_1509949750.takes).length; - Label8: { - Label9: while (true) { - if (!(i_553649534 < L_553649535)) break Label9; - it_1509949783 = piece_1509949750.takes[chckIndx(i_553649534, 0, (piece_1509949750.takes).length - 1)]; - if (!((it_1509949783 == HEX3Aanonymous_1509949703))) { - resultHEX60gensym3_1509949779.push(it_1509949783);; - } - - i_553649534 += 1; - if (!(((piece_1509949750.takes).length == L_553649535))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - piece_1509949750.takes = nimCopy(null, resultHEX60gensym3_1509949779, NTI1509949682); - } - - if (((!(isAir_1476395588(piece_1509949750)) && !(sameColor_1476395596(p_1509949446, piece_1509949750))) && contains_1476395777(getTakesOn_1476395283(piece_1509949750, b_1509949447), p_1509949446.tile))) { - result_1509949739 = true; - break BeforeRet; - } - - res_553649537 = addInt(res_553649537, 1); - } - }; - }; - res_553649539 = addInt(res_553649539, 1); - } - }; - }; - result_1509949739 = false; - break BeforeRet; - }; - - return result_1509949739; - -} - -function HEX3Aanonymous_1509949703(board_1509949704, p_1509949705) { - var result_1509949706 = [[]]; - - BeforeRet: { - if ((!((p_1509949705.timesMoved == 0)) || !((p_1509949705.tile.Field0 == 4)))) { - result_1509949706[0] = nimCopy(null, [], NTI1509949645); - break BeforeRet; - } - - if (((((isAir_1476395588(board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(addInt(p_1509949705.tile.Field0, 1), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)]) && isAir_1476395588(board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(addInt(p_1509949705.tile.Field0, 2), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)])) && (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(addInt(p_1509949705.tile.Field0, 3), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)].item == 4)) && (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(addInt(p_1509949705.tile.Field0, 3), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)].timesMoved == 0)) && !(inCheck_1509949445(p_1509949705, board_1509949704)))) { - var _ = addIfTake_1509949547(result_1509949706, 0, board_1509949704, p_1509949705, p_1509949705.tile, shooterFactory_1526726777(3, 0), false, true); - } - - if ((((((isAir_1476395588(board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(subInt(p_1509949705.tile.Field0, 1), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)]) && isAir_1476395588(board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(subInt(p_1509949705.tile.Field0, 2), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)])) && isAir_1476395588(board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(subInt(p_1509949705.tile.Field0, 3), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)])) && (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(subInt(p_1509949705.tile.Field0, 4), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)].item == 4)) && (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)][chckIndx(subInt(p_1509949705.tile.Field0, 4), 0, (board_1509949704[chckIndx(p_1509949705.tile.Field1, 0, (board_1509949704).length - 1)]).length - 1)].timesMoved == 0)) && !(inCheck_1509949445(p_1509949705, board_1509949704)))) { - var _ = addIfTake_1509949547(result_1509949706, 0, board_1509949704, p_1509949705, p_1509949705.tile, shooterFactory_1526726777((-4), 0), false, true); - } - - }; +function none_553648285() { + var result_553648292 = ({val: 0, has: false}); - return result_1509949706[0]; + return result_553648292; } -function startingBoard_1493172483() { - var result_1493172484 = [[({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})], [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]]; - - result_1493172484 = nimCopy(result_1493172484, [[{item: 4, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949796], takes: [HEX3Aanonymous_1509949817], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1493172227, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 5, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949890], takes: [HEX3Aanonymous_1509949895], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 2, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838], takes: [HEX3Aanonymous_1509949859], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 1, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838, HEX3Aanonymous_1509949796, HEX3Aanonymous_1509949673], takes: [HEX3Aanonymous_1509949859, HEX3Aanonymous_1509949817, HEX3Aanonymous_1509949688], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [113,117,101,101,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949673], takes: [HEX3Aanonymous_1509949688, HEX3Aanonymous_1509949703], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,105,110,103,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 2, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838], takes: [HEX3Aanonymous_1509949859], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 5, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949890], takes: [HEX3Aanonymous_1509949895], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 4, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949796], takes: [HEX3Aanonymous_1509949817], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1493172227, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949662], takes: [HEX3Aanonymous_1509949668], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 6, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 3, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949635], takes: [HEX3Aanonymous_1509949657], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1493172403], onPromote: [HEX3Aanonymous_1493172399], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}], [{item: 4, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949796], takes: [HEX3Aanonymous_1509949817], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1493172227, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 5, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949890], takes: [HEX3Aanonymous_1509949895], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 2, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838], takes: [HEX3Aanonymous_1509949859], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 1, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838, HEX3Aanonymous_1509949796, HEX3Aanonymous_1509949673], takes: [HEX3Aanonymous_1509949859, HEX3Aanonymous_1509949817, HEX3Aanonymous_1509949688], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [113,117,101,101,110,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 0, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949673], takes: [HEX3Aanonymous_1509949688, HEX3Aanonymous_1509949703], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,105,110,103,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 2, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949838], takes: [HEX3Aanonymous_1509949859], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 5, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949890], takes: [HEX3Aanonymous_1509949895], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1476395442, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}, {item: 4, color: 1, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1509949796], takes: [HEX3Aanonymous_1509949817], onMove: HEX3Aanonymous_1476395468, onTake: HEX3Aanonymous_1476395478, whenTaken: HEX3Aanonymous_1493172227, onEndTurn: [HEX3Aanonymous_1476395438], onPromote: [HEX3Aanonymous_1476395438], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: (-1), Field1: []}}]], NTI1476395015); +function initStorage_1879048201() { Label1: { - var j_1493172491 = 0; - var r_1493172492 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553649525 = 0; + var power_1879048205 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652394 = 0; + var L_553652395 = (powers_1728053322[0]).length; Label2: { Label3: while (true) { - if (!true) break Label3; - j_1493172491 = i_553649525; - r_1493172492 = nimCopy(r_1493172492, result_1493172484[chckIndx(i_553649525, 0, (result_1493172484).length - 1)], NTI1476395014); - Label4: { - var i_1493172499 = 0; - var x_1493172500 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649522 = 0; - Label5: { - Label6: while (true) { - if (!true) break Label6; - i_1493172499 = i_553649522; - x_1493172500 = nimCopy(x_1493172500, r_1493172492[chckIndx(i_553649522, 0, (r_1493172492).length - 1)], NTI1476395026); - result_1493172484[chckIndx(j_1493172491, 0, (result_1493172484).length - 1)][chckIndx(i_1493172499, 0, (result_1493172484[chckIndx(j_1493172491, 0, (result_1493172484).length - 1)]).length - 1)] = nimCopy(result_1493172484[chckIndx(j_1493172491, 0, (result_1493172484).length - 1)][chckIndx(i_1493172499, 0, (result_1493172484[chckIndx(j_1493172491, 0, (result_1493172484).length - 1)]).length - 1)], pieceCopy_1476395495(x_1493172500, x_1493172500.item, x_1493172500.color, x_1493172500.timesMoved, x_1493172500.piecesTaken, {Field0: nimCopy(null, i_1493172499, NTI1476395027), Field1: nimCopy(null, j_1493172491, NTI1476395033)}, x_1493172500.moves, x_1493172500.takes, x_1493172500.onMove, x_1493172500.onTake, x_1493172500.whenTaken, x_1493172500.onEndTurn, x_1493172500.onPromote, x_1493172500.promoted, x_1493172500.filePath, x_1493172500.colorable, x_1493172500.rotate, x_1493172500.rand, x_1493172500.wallet), NTI1476395026); - if ((7 <= i_553649522)) { - break Label5; - } - - i_553649522 += 1; - } - }; - }; - if ((7 <= i_553649525)) { - break Label2; + if (!(i_553652394 < L_553652395)) break Label3; + power_1879048205 = powers_1728053322[0][chckIndx(i_553652394, 0, (powers_1728053322[0]).length - 1)]; + if (!(window.localStorage.getItem(toJSStr(power_1879048205.technicalName)) !== null)) { + window.localStorage.setItem(toJSStr(power_1879048205.technicalName), 0); + } + + i_553652394 += 1; + if (!(((powers_1728053322[0]).length == L_553652395))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } - i_553649525 += 1; } }; }; - return result_1493172484; - + } function HEX5BHEX5D_721421729(s_721421733, x_721421734) { @@ -7402,13 +7853,13 @@ function HEX5BHEX5D_721421729(s_721421733, x_721421734) { var L_721421743 = addInt(subInt(subInt((s_721421733).length, x_721421734.b), a_721421737), 1); result_721421735 = new Array(chckRange(L_721421743, 0, 2147483647)); for (var i = 0 ; i < chckRange(L_721421743, 0, 2147483647) ; ++i) { result_721421735[i] = null; } Label1: { var i_721421752 = 0; - var i_553649542 = 0; + var i_553652398 = 0; Label2: { Label3: while (true) { - if (!(i_553649542 < L_721421743)) break Label3; - i_721421752 = i_553649542; + if (!(i_553652398 < L_721421743)) break Label3; + i_721421752 = i_553652398; result_721421735[chckIndx(i_721421752, 0, (result_721421735).length - 1)] = s_721421733[chckIndx(addInt(i_721421752, a_721421737), 0, (s_721421733).length - 1)]; - i_553649542 = addInt(i_553649542, 1); + i_553652398 = addInt(i_553652398, 1); } }; }; @@ -7584,15 +8035,15 @@ function applyEvents_721420581(n_721420582) { var dest_721420583 = n_721420582.dom; Label1: { var i_721420591 = 0; - var colontmp__553649565 = 0; - colontmp__553649565 = (n_721420582.events).length; - var i_553649566 = 0; + var colontmp__553652421 = 0; + colontmp__553652421 = (n_721420582.events).length; + var i_553652422 = 0; Label2: { Label3: while (true) { - if (!(i_553649566 < colontmp__553649565)) break Label3; - i_721420591 = i_553649566; + if (!(i_553652422 < colontmp__553652421)) break Label3; + i_721420591 = i_553652422; n_721420582.events[chckIndx(i_721420591, 0, (n_721420582.events).length - 1)]["Field2"] = wrapEvent_721420454(dest_721420583, n_721420582, n_721420582.events[chckIndx(i_721420591, 0, (n_721420582.events).length - 1)]["Field0"], n_721420582.events[chckIndx(i_721420591, 0, (n_721420582.events).length - 1)]["Field1"]); - i_553649566 = addInt(i_553649566, 1); + i_553652422 = addInt(i_553652422, 1); } }; }; @@ -7604,15 +8055,15 @@ function applyStyle_822084094(n_822084095, s_822084096) { n_822084095.style = {}; Label1: { var i_822084109 = 0; - var colontmp__553649569 = 0; - colontmp__553649569 = subInt(s_822084096.length, 1); - var res_553649570 = 0; + var colontmp__553652425 = 0; + colontmp__553652425 = subInt(s_822084096.length, 1); + var res_553652426 = 0; Label2: { Label3: while (true) { - if (!(res_553649570 <= colontmp__553649569)) break Label3; - i_822084109 = res_553649570; + if (!(res_553652426 <= colontmp__553652425)) break Label3; + i_822084109 = res_553652426; n_822084095.style[s_822084096[i_822084109]] = s_822084096[addInt(i_822084109, 1)]; - res_553649570 = addInt(res_553649570, 2); + res_553652426 = addInt(res_553652426, 2); } }; }; @@ -7730,17 +8181,17 @@ function toDom_721420610(n_721420611, useAttachedNode_721420612, kxi_721420613) Label2: { var k_721420731 = null; Label3: { - var i_553649550 = 0; - var colontmp__553649551 = 0; - colontmp__553649551 = (n_721420611.kids).length; - var i_553649552 = 0; + var i_553652406 = 0; + var colontmp__553652407 = 0; + colontmp__553652407 = (n_721420611.kids).length; + var i_553652408 = 0; Label4: { Label5: while (true) { - if (!(i_553649552 < colontmp__553649551)) break Label5; - i_553649550 = i_553649552; - k_721420731 = n_721420611.kids[chckIndx(i_553649550, 0, (n_721420611.kids).length - 1)]; + if (!(i_553652408 < colontmp__553652407)) break Label5; + i_553652406 = i_553652408; + k_721420731 = n_721420611.kids[chckIndx(i_553652406, 0, (n_721420611.kids).length - 1)]; result_721420614.appendChild(toDom_721420610(k_721420731, useAttachedNode_721420612, kxi_721420613)); - i_553649552 = addInt(i_553649552, 1); + i_553652408 = addInt(i_553652408, 1); } }; }; @@ -7769,21 +8220,21 @@ function toDom_721420610(n_721420611, useAttachedNode_721420612, kxi_721420613) var k_721420736 = null; var v_721420737 = null; Label7: { - var i_553649560 = 0; - var colontmp__553649561 = 0; - colontmp__553649561 = subInt((n_721420611.attrs).length, 2); - var res_553649562 = 0; + var i_553652416 = 0; + var colontmp__553652417 = 0; + colontmp__553652417 = subInt((n_721420611.attrs).length, 2); + var res_553652418 = 0; Label8: { Label9: while (true) { - if (!(res_553649562 <= colontmp__553649561)) break Label9; - i_553649560 = res_553649562; - k_721420736 = n_721420611.attrs[chckIndx(i_553649560, 0, (n_721420611.attrs).length - 1)]; - v_721420737 = n_721420611.attrs[chckIndx(addInt(i_553649560, 1), 0, (n_721420611.attrs).length - 1)]; + if (!(res_553652418 <= colontmp__553652417)) break Label9; + i_553652416 = res_553652418; + k_721420736 = n_721420611.attrs[chckIndx(i_553652416, 0, (n_721420611.attrs).length - 1)]; + v_721420737 = n_721420611.attrs[chckIndx(addInt(i_553652416, 1), 0, (n_721420611.attrs).length - 1)]; if (!((v_721420737 == null))) { result_721420614.setAttribute(k_721420736, v_721420737); } - res_553649562 = addInt(res_553649562, 2); + res_553652418 = addInt(res_553652418, 2); } }; }; @@ -7858,19 +8309,19 @@ function eq_822083842(a_822083843, b_822083844) { Label1: { var i_822083880 = 0; - var colontmp__553649596 = 0; - colontmp__553649596 = a_822083843.length; - var i_553649597 = 0; + var colontmp__553652452 = 0; + colontmp__553652452 = a_822083843.length; + var i_553652453 = 0; Label2: { Label3: while (true) { - if (!(i_553649597 < colontmp__553649596)) break Label3; - i_822083880 = i_553649597; + if (!(i_553652453 < colontmp__553652452)) break Label3; + i_822083880 = i_553652453; if (!((a_822083843[i_822083880] == b_822083844[i_822083880]))) { result_822083845 = false; break BeforeRet; } - i_553649597 = addInt(i_553649597, 1); + i_553652453 = addInt(i_553652453, 1); } }; }; @@ -7899,19 +8350,19 @@ function sameAttrs_754975717(a_754975718, b_754975719) { result_754975720 = true; Label1: { var i_754975734 = 0; - var colontmp__553649600 = 0; - colontmp__553649600 = (a_754975718.attrs).length; - var i_553649601 = 0; + var colontmp__553652456 = 0; + colontmp__553652456 = (a_754975718.attrs).length; + var i_553652457 = 0; Label2: { Label3: while (true) { - if (!(i_553649601 < colontmp__553649600)) break Label3; - i_754975734 = i_553649601; + if (!(i_553652457 < colontmp__553652456)) break Label3; + i_754975734 = i_553652457; if (!((a_754975718.attrs[chckIndx(i_754975734, 0, (a_754975718.attrs).length - 1)] == b_754975719.attrs[chckIndx(i_754975734, 0, (b_754975719.attrs).length - 1)]))) { result_754975720 = false; break BeforeRet; } - i_553649601 = addInt(i_553649601, 1); + i_553652457 = addInt(i_553652457, 1); } }; }; @@ -7964,19 +8415,19 @@ function eq_721420843(a_721420844, b_721420845, recursive_721420846) { Label1: { var i_721420864 = 0; - var colontmp__553649588 = 0; - colontmp__553649588 = len_754975537(a_721420844); - var i_553649589 = 0; + var colontmp__553652444 = 0; + colontmp__553652444 = len_754975537(a_721420844); + var i_553652445 = 0; Label2: { Label3: while (true) { - if (!(i_553649589 < colontmp__553649588)) break Label3; - i_721420864 = i_553649589; + if (!(i_553652445 < colontmp__553652444)) break Label3; + i_721420864 = i_553652445; if ((eq_721420843(HEX5BHEX5D_754975544(a_721420844, i_721420864), HEX5BHEX5D_754975544(b_721420845, i_721420864), recursive_721420846) == 1)) { result_721420847 = 1; break BeforeRet; } - i_553649589 = addInt(i_553649589, 1); + i_553652445 = addInt(i_553652445, 1); } }; }; @@ -8030,19 +8481,19 @@ function eq_721420843(a_721420844, b_721420845, recursive_721420846) { Label4: { var i_721420890 = 0; - var colontmp__553649592 = 0; - colontmp__553649592 = len_754975537(a_721420844); - var i_553649593 = 0; + var colontmp__553652448 = 0; + colontmp__553652448 = len_754975537(a_721420844); + var i_553652449 = 0; Label5: { Label6: while (true) { - if (!(i_553649593 < colontmp__553649592)) break Label6; - i_721420890 = i_553649593; + if (!(i_553652449 < colontmp__553652448)) break Label6; + i_721420890 = i_553652449; if (!((eq_721420843(HEX5BHEX5D_754975544(a_721420844, i_721420890), HEX5BHEX5D_754975544(b_721420845, i_721420890), true) == 3))) { result_721420847 = 1; break BeforeRet; } - i_553649593 = addInt(i_553649593, 1); + i_553652449 = addInt(i_553652449, 1); } }; }; @@ -8092,18 +8543,18 @@ function updateAttributes_721421325(newNode_721421326, oldNode_721421327) { var k_721421332 = null; var __721421333 = null; Label2: { - var i_553649605 = 0; - var colontmp__553649606 = 0; - colontmp__553649606 = subInt((oldNode_721421327.attrs).length, 2); - var res_553649607 = 0; + var i_553652461 = 0; + var colontmp__553652462 = 0; + colontmp__553652462 = subInt((oldNode_721421327.attrs).length, 2); + var res_553652463 = 0; Label3: { Label4: while (true) { - if (!(res_553649607 <= colontmp__553649606)) break Label4; - i_553649605 = res_553649607; - k_721421332 = oldNode_721421327.attrs[chckIndx(i_553649605, 0, (oldNode_721421327.attrs).length - 1)]; - __721421333 = oldNode_721421327.attrs[chckIndx(addInt(i_553649605, 1), 0, (oldNode_721421327.attrs).length - 1)]; + if (!(res_553652463 <= colontmp__553652462)) break Label4; + i_553652461 = res_553652463; + k_721421332 = oldNode_721421327.attrs[chckIndx(i_553652461, 0, (oldNode_721421327.attrs).length - 1)]; + __721421333 = oldNode_721421327.attrs[chckIndx(addInt(i_553652461, 1), 0, (oldNode_721421327.attrs).length - 1)]; oldNode_721421327.dom.removeAttribute(k_721421332); - res_553649607 = addInt(res_553649607, 2); + res_553652463 = addInt(res_553652463, 2); } }; }; @@ -8112,21 +8563,21 @@ function updateAttributes_721421325(newNode_721421326, oldNode_721421327) { var k_721421334 = null; var v_721421335 = null; Label6: { - var i_553649611 = 0; - var colontmp__553649612 = 0; - colontmp__553649612 = subInt((newNode_721421326.attrs).length, 2); - var res_553649613 = 0; + var i_553652467 = 0; + var colontmp__553652468 = 0; + colontmp__553652468 = subInt((newNode_721421326.attrs).length, 2); + var res_553652469 = 0; Label7: { Label8: while (true) { - if (!(res_553649613 <= colontmp__553649612)) break Label8; - i_553649611 = res_553649613; - k_721421334 = newNode_721421326.attrs[chckIndx(i_553649611, 0, (newNode_721421326.attrs).length - 1)]; - v_721421335 = newNode_721421326.attrs[chckIndx(addInt(i_553649611, 1), 0, (newNode_721421326.attrs).length - 1)]; + if (!(res_553652469 <= colontmp__553652468)) break Label8; + i_553652467 = res_553652469; + k_721421334 = newNode_721421326.attrs[chckIndx(i_553652467, 0, (newNode_721421326.attrs).length - 1)]; + v_721421335 = newNode_721421326.attrs[chckIndx(addInt(i_553652467, 1), 0, (newNode_721421326.attrs).length - 1)]; if (!((v_721421335 == null))) { oldNode_721421327.dom.setAttribute(k_721421334, v_721421335); } - res_553649613 = addInt(res_553649613, 2); + res_553652469 = addInt(res_553652469, 2); } }; }; @@ -8144,19 +8595,19 @@ function getAttr_754975516(n_754975517, key_754975518) { BeforeRet: { Label1: { var i_754975528 = 0; - var colontmp__553649616 = 0; - colontmp__553649616 = subInt((n_754975517.attrs).length, 2); - var res_553649617 = 0; + var colontmp__553652472 = 0; + colontmp__553652472 = subInt((n_754975517.attrs).length, 2); + var res_553652473 = 0; Label2: { Label3: while (true) { - if (!(res_553649617 <= colontmp__553649616)) break Label3; - i_754975528 = res_553649617; + if (!(res_553652473 <= colontmp__553652472)) break Label3; + i_754975528 = res_553652473; if ((n_754975517.attrs[chckIndx(i_754975528, 0, (n_754975517.attrs).length - 1)] == key_754975518)) { result_754975519 = n_754975517.attrs[chckIndx(addInt(i_754975528, 1), 0, (n_754975517.attrs).length - 1)]; break BeforeRet; } - res_553649617 = addInt(res_553649617, 2); + res_553652473 = addInt(res_553652473, 2); } }; }; @@ -8170,15 +8621,15 @@ function removeAllEventHandlers_721420412(d_721420413) { if (!((d_721420413.karaxEvents == null))) { Label1: { var i_721420429 = 0; - var colontmp__553649620 = 0; - colontmp__553649620 = d_721420413.karaxEvents.length; - var i_553649621 = 0; + var colontmp__553652476 = 0; + colontmp__553652476 = d_721420413.karaxEvents.length; + var i_553652477 = 0; Label2: { Label3: while (true) { - if (!(i_553649621 < colontmp__553649620)) break Label3; - i_721420429 = i_553649621; + if (!(i_553652477 < colontmp__553652476)) break Label3; + i_721420429 = i_553652477; d_721420413.removeEventListener(d_721420413.karaxEvents[i_721420429]["Field0"], d_721420413.karaxEvents[i_721420429]["Field1"]); - i_553649621 = addInt(i_553649621, 1); + i_553652477 = addInt(i_553652477, 1); } }; }; @@ -8301,28 +8752,28 @@ function diff_721421509(newNode_721421510, oldNode_721421511, parent_721421512, var pos_721421577 = addInt(nimMin(oldPos_721421561, newPos_721421562), 1); Label6: { var i_721421582 = 0; - var colontmp__553649575 = 0; - colontmp__553649575 = subInt(pos_721421577, 1); - var res_553649576 = commonPrefix_721421551; + var colontmp__553652431 = 0; + colontmp__553652431 = subInt(pos_721421577, 1); + var res_553652432 = commonPrefix_721421551; Label7: { Label8: while (true) { - if (!(res_553649576 <= colontmp__553649575)) break Label8; - i_721421582 = res_553649576; + if (!(res_553652432 <= colontmp__553652431)) break Label8; + i_721421582 = res_553652432; diff_721421509(HEX5BHEX5D_754975544(newNode_721421510, i_721421582), HEX5BHEX5D_754975544(oldNode_721421511, i_721421582), current_721421513, HEX5BHEX5D_754975544(oldNode_721421511, i_721421582).dom, kxi_721421514); - res_553649576 = addInt(res_553649576, 1); + res_553652432 = addInt(res_553652432, 1); } }; }; if ((addInt(oldPos_721421561, 1) == oldLength_721421540)) { Label9: { var i_721421587 = 0; - var res_553649579 = pos_721421577; + var res_553652435 = pos_721421577; Label10: { Label11: while (true) { - if (!(res_553649579 <= newPos_721421562)) break Label11; - i_721421587 = res_553649579; + if (!(res_553652435 <= newPos_721421562)) break Label11; + i_721421587 = res_553652435; addPatch_721421345(kxi_721421514, 2, current_721421513, null, HEX5BHEX5D_754975544(newNode_721421510, i_721421587), null); - res_553649579 = addInt(res_553649579, 1); + res_553652435 = addInt(res_553652435, 1); } }; }; @@ -8331,13 +8782,13 @@ function diff_721421509(newNode_721421510, oldNode_721421511, parent_721421512, var before_721421588 = current_721421513.childNodes[chckIndx(addInt(oldPos_721421561, 1), 0, (current_721421513.childNodes).length - 1)]; Label12: { var i_721421593 = 0; - var res_553649582 = pos_721421577; + var res_553652438 = pos_721421577; Label13: { Label14: while (true) { - if (!(res_553649582 <= newPos_721421562)) break Label14; - i_721421593 = res_553649582; + if (!(res_553652438 <= newPos_721421562)) break Label14; + i_721421593 = res_553652438; addPatch_721421345(kxi_721421514, 3, current_721421513, before_721421588, HEX5BHEX5D_754975544(newNode_721421510, i_721421593), null); - res_553649582 = addInt(res_553649582, 1); + res_553652438 = addInt(res_553652438, 1); } }; }; @@ -8345,14 +8796,14 @@ function diff_721421509(newNode_721421510, oldNode_721421511, parent_721421512, Label15: { var i_721421598 = 0; - var res_553649585 = pos_721421577; + var res_553652441 = pos_721421577; Label16: { Label17: while (true) { - if (!(res_553649585 <= oldPos_721421561)) break Label17; - i_721421598 = res_553649585; + if (!(res_553652441 <= oldPos_721421561)) break Label17; + i_721421598 = res_553652441; addPatch_721421345(kxi__, 4, null, null, null, HEX5BHEX5D_754975544(oldNode_721421511, i_721421598)); addPatch_721421345(kxi_721421514, 1, current_721421513, current_721421513.childNodes[chckIndx(i_721421598, 0, (current_721421513.childNodes).length - 1)], null, null); - res_553649585 = addInt(res_553649585, 1); + res_553652441 = addInt(res_553652441, 1); } }; }; @@ -8427,15 +8878,15 @@ function moveDom_721421439(dest_721421440, src_721421441) { Label1: { var i_721421457 = 0; - var colontmp__553649631 = 0; - colontmp__553649631 = len_754975537(dest_721421440); - var i_553649632 = 0; + var colontmp__553652487 = 0; + colontmp__553652487 = len_754975537(dest_721421440); + var i_553652488 = 0; Label2: { Label3: while (true) { - if (!(i_553649632 < colontmp__553649631)) break Label3; - i_721421457 = i_553649632; + if (!(i_553652488 < colontmp__553652487)) break Label3; + i_721421457 = i_553652488; moveDom_721421439(HEX5BHEX5D_754975544(dest_721421440, i_721421457), HEX5BHEX5D_754975544(src_721421441, i_721421457)); - i_553649632 = addInt(i_553649632, 1); + i_553652488 = addInt(i_553652488, 1); } }; }; @@ -8452,11 +8903,11 @@ function HEX5BHEX5DHEX3D_754975548(x_754975549, idx_754975550, y_754975551) { function applyPatch_721421458(kxi_721421459) { Label1: { var i_721421464 = 0; - var i_553649625 = 0; + var i_553652481 = 0; Label2: { Label3: while (true) { - if (!(i_553649625 < kxi_721421459.patchLen)) break Label3; - i_721421464 = i_553649625; + if (!(i_553652481 < kxi_721421459.patchLen)) break Label3; + i_721421464 = i_553652481; var p_721421465 = nimCopy(null, kxi_721421459.patches[chckIndx(i_721421464, 0, (kxi_721421459.patches).length - 1)], NTI721420296); switch (p_721421465.k) { case 0: @@ -8509,25 +8960,25 @@ function applyPatch_721421458(kxi_721421459) { break; } - i_553649625 = addInt(i_553649625, 1); + i_553652481 = addInt(i_553652481, 1); } }; }; kxi_721421459.patchLen = 0; Label4: { var i_721421496 = 0; - var i_553649628 = 0; + var i_553652484 = 0; Label5: { Label6: while (true) { - if (!(i_553649628 < kxi_721421459.patchLenV)) break Label6; - i_721421496 = i_553649628; + if (!(i_553652484 < kxi_721421459.patchLenV)) break Label6; + i_721421496 = i_553652484; var p_721421497 = nimCopy(null, kxi_721421459.patchesV[chckIndx(i_721421496, 0, (kxi_721421459.patchesV).length - 1)], NTI721420297); HEX5BHEX5DHEX3D_754975548(p_721421497.parent, p_721421497.pos, p_721421497.newChild); if (!(!((p_721421497.newChild.dom == null)))) { failedAssertImpl_268435541([107,97,114,97,120,46,110,105,109,40,52,53,56,44,32,53,41,32,96,112,46,110,101,119,67,104,105,108,100,46,100,111,109,32,33,61,32,110,105,108,96,32]); } - i_553649628 = addInt(i_553649628, 1); + i_553652484 = addInt(i_553652484, 1); } }; }; @@ -8613,111 +9064,284 @@ function HEX3Aanonymous_721421811() { } -function resize_553648247() { - screenWidth_553648185[0] = window.innerWidth; +function resize_553648335() { + screenWidth_553648279[0] = window.innerWidth; redraw_721421809(kxi__); } -function initStorage_1845493769() { - Label1: { - var power_1845493773 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649636 = 0; - var L_553649637 = (powers_1728053317[0]).length; - Label2: { - Label3: while (true) { - if (!(i_553649636 < L_553649637)) break Label3; - power_1845493773 = powers_1728053317[0][chckIndx(i_553649636, 0, (powers_1728053317[0]).length - 1)]; - if (!(window.localStorage.getItem(toJSStr(power_1845493773.technicalName)) !== null)) { - window.localStorage.setItem(toJSStr(power_1845493773.technicalName), 0); - } - - i_553649636 += 1; - if (!(((powers_1728053317[0]).length == L_553649637))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - - -} +function startingState_1476395254() { + var result_1476395255 = {Field0: ({nextIndex: 0, nextGroup: 0, randSeed: 0, turnNumber: 0}), Field1: [({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]}), ({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]})]}; -function add_553648605(x_553648607, x_553648607_Idx, y_553648608) { - var Temporary1; + result_1476395255.Field0 = nimCopy(result_1476395255.Field0, {nextIndex: 1, nextGroup: 1, randSeed: 0, turnNumber: 0}, NTI1476395034); + result_1476395255.Field1 = nimCopy(result_1476395255.Field1, [{abilityTakes: 0, wallet: {val: 0, has: false}, buys: [], piecesSold: 0, glass: [{val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}, {val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}, {val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}]}, {abilityTakes: 0, wallet: {val: 0, has: false}, buys: [], piecesSold: 0, glass: [{val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}, {val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}, {val: {Field0: 0, Field1: {Field0: null, Field1: null}, Field2: {Field0: null, Field1: null}}, has: false}]}], NTI1476395084); - var xl_553648612 = (x_553648607[x_553648607_Idx]).length; - if (x_553648607[x_553648607_Idx].length < (Temporary1 = chckRange(addInt(xl_553648612, (y_553648608).length), 0, 2147483647), Temporary1)) { for (var i = x_553648607[x_553648607_Idx].length ; i < Temporary1 ; ++i) x_553648607[x_553648607_Idx].push(({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0})); } - else { x_553648607[x_553648607_Idx].length = Temporary1; }; - Label2: { - var i_553648627 = 0; - var colontmp__553649640 = 0; - colontmp__553649640 = (y_553648608).length - 1; - var res_553649641 = 0; - Label3: { - Label4: while (true) { - if (!(res_553649641 <= colontmp__553649640)) break Label4; - i_553648627 = res_553649641; - x_553648607[x_553648607_Idx][chckIndx(addInt(xl_553648612, i_553648627), 0, (x_553648607[x_553648607_Idx]).length - 1)] = nimCopy(x_553648607[x_553648607_Idx][chckIndx(addInt(xl_553648612, i_553648627), 0, (x_553648607[x_553648607_Idx]).length - 1)], y_553648608[chckIndx(i_553648627, 0, (y_553648608).length - 1)], NTI1728053253); - res_553649641 = addInt(res_553649641, 1); - } - }; - }; + return result_1476395255; - } -function HEX3Aanonymous_1795164360(piece_1795164361, taking_1795164362, board_1795164363) { - randomize_1644167430(BigInt(addInt(addInt(mulInt(10, piece_1795164361.tile.Field1), mulInt(100, piece_1795164361.tile.Field0)), piece_1795164361.rand.Field1))); - var dice_1795164364 = rand_1644167304(20); - piece_1795164361.timesMoved = addInt(piece_1795164361.timesMoved, 1); - if ((dice_1795164364 <= 3)) { - board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)][chckIndx(taking_1795164362.Field0, 0, (board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)]).length - 1)].color = piece_1795164361.color; - pieceSwap_1476395429(piece_1795164361, board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)][chckIndx(taking_1795164362.Field0, 0, (board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)]).length - 1)], board_1795164363); +function HEX3Aanonymous_1526726659(taken_1526726660, taker_1526726661, board_1526726662, state_1526726663) { + var result_1526726666 = {Field0: {Field0: 0, Field1: 0}, Field1: false}; + + BeforeRet: { + if ((((((taker_1526726661.item == 0) && (taken_1526726660.item == 4)) && sameColor_1476396129(taken_1526726660, taker_1526726661)) && (taker_1526726661.timesMoved == 0)) && (taken_1526726660.timesMoved == 0))) { + var kingTile_1526726675 = nimCopy(null, taker_1526726661.tile, NTI1476395011); + if ((taken_1526726660.tile.Field0 == 0)) { + pieceMove_1476395941(taker_1526726661, kingTile_1526726675.Field1, subInt(kingTile_1526726675.Field0, 2), board_1526726662, state_1526726663); + pieceMove_1476395941(taken_1526726660, kingTile_1526726675.Field1, subInt(kingTile_1526726675.Field0, 1), board_1526726662, state_1526726663); + var colontmp__553652498 = {Field0: subInt(kingTile_1526726675.Field0, 1), Field1: kingTile_1526726675.Field1}; + var colontmp__553652499 = false; + result_1526726666 = nimCopy(result_1526726666, {Field0: nimCopy(null, colontmp__553652498, NTI1476395011), Field1: colontmp__553652499}, NTI1526726664); + break BeforeRet; } else { - var takeResult_1795164370 = board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)][chckIndx(taking_1795164362.Field0, 0, (board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)]).length - 1)].whenTaken(board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)][chckIndx(taking_1795164362.Field0, 0, (board_1795164363[chckIndx(taking_1795164362.Field1, 0, (board_1795164363).length - 1)]).length - 1)], piece_1795164361, board_1795164363); - if (takeResult_1795164370.Field1) { - board_1795164363[chckIndx(takeResult_1795164370.Field0.Field1, 0, (board_1795164363).length - 1)][chckIndx(takeResult_1795164370.Field0.Field0, 0, (board_1795164363[chckIndx(takeResult_1795164370.Field0.Field1, 0, (board_1795164363).length - 1)]).length - 1)].piecesTaken = addInt(board_1795164363[chckIndx(takeResult_1795164370.Field0.Field1, 0, (board_1795164363).length - 1)][chckIndx(takeResult_1795164370.Field0.Field0, 0, (board_1795164363[chckIndx(takeResult_1795164370.Field0.Field1, 0, (board_1795164363).length - 1)]).length - 1)].piecesTaken, 1); - } - + pieceMove_1476395941(taker_1526726661, kingTile_1526726675.Field1, addInt(kingTile_1526726675.Field0, 2), board_1526726662, state_1526726663); + pieceMove_1476395941(taken_1526726660, kingTile_1526726675.Field1, addInt(kingTile_1526726675.Field0, 1), board_1526726662, state_1526726663); + var colontmp__553652500 = {Field0: addInt(kingTile_1526726675.Field0, 1), Field1: kingTile_1526726675.Field1}; + var colontmp__553652501 = false; + result_1526726666 = nimCopy(result_1526726666, {Field0: nimCopy(null, colontmp__553652500, NTI1476395011), Field1: colontmp__553652501}, NTI1526726664); + break BeforeRet; + } + + } + else { + result_1526726666 = nimCopy(result_1526726666, HEX3Aanonymous_1476395989(taken_1526726660, taker_1526726661, board_1526726662, state_1526726663), NTI1526726664); + break BeforeRet; + } + + }; + + return result_1526726666; + +} + +function inCheck_1543503877(p_1543503878, b_1543503879) { + var result_1543504171 = false; + + BeforeRet: { + Label1: { + var i_1543504176 = 0; + var res_553652510 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652510 <= 7)) break Label3; + i_1543504176 = res_553652510; + Label4: { + var j_1543504181 = 0; + var res_553652508 = 0; + Label5: { + Label6: while (true) { + if (!(res_553652508 <= 7)) break Label6; + j_1543504181 = res_553652508; + var piece_1543504182 = nimCopy(null, b_1543503879[chckIndx(i_1543504176, 0, (b_1543503879).length - 1)][chckIndx(j_1543504181, 0, (b_1543503879[chckIndx(i_1543504176, 0, (b_1543503879).length - 1)]).length - 1)], NTI1476395032); + if ((piece_1543504182.item == 0)) { + var resultHEX60gensym3_1543504211 = newSeq_1543504188(0); + Label7: { + var it_1543504215 = null; + var i_553652505 = 0; + var L_553652506 = (piece_1543504182.takes).length; + Label8: { + Label9: while (true) { + if (!(i_553652505 < L_553652506)) break Label9; + it_1543504215 = piece_1543504182.takes[chckIndx(i_553652505, 0, (piece_1543504182.takes).length - 1)]; + if (!((it_1543504215 == HEX3Aanonymous_1543504135))) { + resultHEX60gensym3_1543504211.push(it_1543504215);; + } + + i_553652505 += 1; + if (!(((piece_1543504182.takes).length == L_553652506))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + piece_1543504182.takes = nimCopy(null, resultHEX60gensym3_1543504211, NTI1543504114); + } + + if (((!(isAir_1476396121(piece_1543504182)) && !(sameColor_1476396129(p_1543503878, piece_1543504182))) && contains_1476395806(getTakesOn_1476395656(piece_1543504182, b_1543503879), p_1543503878.tile))) { + result_1543504171 = true; + break BeforeRet; + } + + res_553652508 = addInt(res_553652508, 1); + } + }; + }; + res_553652510 = addInt(res_553652510, 1); + } + }; + }; + result_1543504171 = false; + break BeforeRet; + }; + + return result_1543504171; + +} + +function HEX3Aanonymous_1543504135(board_1543504136, p_1543504137) { + var result_1543504138 = [[]]; + + BeforeRet: { + if ((!((p_1543504137.timesMoved == 0)) || !((p_1543504137.tile.Field0 == 4)))) { + result_1543504138[0] = nimCopy(null, [], NTI1543504077); + break BeforeRet; + } + + if (((((isAir_1476396121(board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(addInt(p_1543504137.tile.Field0, 1), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)]) && isAir_1476396121(board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(addInt(p_1543504137.tile.Field0, 2), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)])) && (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(addInt(p_1543504137.tile.Field0, 3), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)].item == 4)) && (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(addInt(p_1543504137.tile.Field0, 3), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)].timesMoved == 0)) && !(inCheck_1543503877(p_1543504137, board_1543504136)))) { + var _ = addIfTake_1543503979(result_1543504138, 0, board_1543504136, p_1543504137, p_1543504137.tile, shooterFactory_1560281208(3, 0), false, true); + } + + if ((((((isAir_1476396121(board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(subInt(p_1543504137.tile.Field0, 1), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)]) && isAir_1476396121(board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(subInt(p_1543504137.tile.Field0, 2), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)])) && isAir_1476396121(board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(subInt(p_1543504137.tile.Field0, 3), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)])) && (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(subInt(p_1543504137.tile.Field0, 4), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)].item == 4)) && (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)][chckIndx(subInt(p_1543504137.tile.Field0, 4), 0, (board_1543504136[chckIndx(p_1543504137.tile.Field1, 0, (board_1543504136).length - 1)]).length - 1)].timesMoved == 0)) && !(inCheck_1543503877(p_1543504137, board_1543504136)))) { + var _ = addIfTake_1543503979(result_1543504138, 0, board_1543504136, p_1543504137, p_1543504137.tile, shooterFactory_1560281208((-4), 0), false, true); + } + + }; + + return result_1543504138[0]; + +} + +function startingBoard_1526726918(state_1526726919) { + var result_1526726920 = [[({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]]; + + result_1526726920 = nimCopy(result_1526726920, [[{item: 4, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504228], takes: [HEX3Aanonymous_1543504249], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1526726659, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 5, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504322], takes: [HEX3Aanonymous_1543504327], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 2, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270], takes: [HEX3Aanonymous_1543504291], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 1, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270, HEX3Aanonymous_1543504228, HEX3Aanonymous_1543504105], takes: [HEX3Aanonymous_1543504291, HEX3Aanonymous_1543504249, HEX3Aanonymous_1543504120], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [113,117,101,101,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504105], takes: [HEX3Aanonymous_1543504120, HEX3Aanonymous_1543504135], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,105,110,103,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 2, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270], takes: [HEX3Aanonymous_1543504291], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 5, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504322], takes: [HEX3Aanonymous_1543504327], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 4, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504228], takes: [HEX3Aanonymous_1543504249], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1526726659, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504094], takes: [HEX3Aanonymous_1543504100], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}, {item: 6, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [], takes: [], onMove: {Field0: null, Field1: null}, onTake: {Field0: null, Field1: null}, whenTaken: {Field0: null, Field1: null}, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 3, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504067], takes: [HEX3Aanonymous_1543504089], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1526726837], onPromote: [HEX3Aanonymous_1526726832], promoted: false, filePath: [112,97,119,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}], [{item: 4, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504228], takes: [HEX3Aanonymous_1543504249], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1526726659, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 5, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504322], takes: [HEX3Aanonymous_1543504327], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 2, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270], takes: [HEX3Aanonymous_1543504291], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 1, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270, HEX3Aanonymous_1543504228, HEX3Aanonymous_1543504105], takes: [HEX3Aanonymous_1543504291, HEX3Aanonymous_1543504249, HEX3Aanonymous_1543504120], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [113,117,101,101,110,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 0, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504105], takes: [HEX3Aanonymous_1543504120, HEX3Aanonymous_1543504135], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,105,110,103,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 2, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504270], takes: [HEX3Aanonymous_1543504291], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [98,105,115,104,111,112,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 5, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504322], takes: [HEX3Aanonymous_1543504327], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1476395989, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [107,110,105,103,104,116,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}, {item: 4, color: 1, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: (-1), Field1: (-1)}, moves: [HEX3Aanonymous_1543504228], takes: [HEX3Aanonymous_1543504249], onMove: HEX3Aanonymous_1476396016, onTake: HEX3Aanonymous_1476396027, whenTaken: HEX3Aanonymous_1526726659, onEndTurn: [HEX3Aanonymous_1476395595], onPromote: [HEX3Aanonymous_1476395595], promoted: false, filePath: [114,111,111,107,46,115,118,103], colorable: true, rotate: false, drunk: false, casts: []}]], NTI1476395013); + Label1: { + var i_1526726927 = 0; + var r_1526726928 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_553652496 = 0; + Label2: { + Label3: while (true) { + if (!true) break Label3; + i_1526726927 = i_553652496; + r_1526726928 = nimCopy(r_1526726928, result_1526726920[chckIndx(i_553652496, 0, (result_1526726920).length - 1)], NTI1476395012); + Label4: { + var j_1526726935 = 0; + var x_1526726936 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_553652493 = 0; + Label5: { + Label6: while (true) { + if (!true) break Label6; + j_1526726935 = i_553652493; + x_1526726936 = nimCopy(x_1526726936, r_1526726928[chckIndx(i_553652493, 0, (r_1526726928).length - 1)], NTI1476395032); + result_1526726920[chckIndx(i_1526726927, 0, (result_1526726920).length - 1)][chckIndx(j_1526726935, 0, (result_1526726920[chckIndx(i_1526726927, 0, (result_1526726920).length - 1)]).length - 1)] = nimCopy(result_1526726920[chckIndx(i_1526726927, 0, (result_1526726920).length - 1)][chckIndx(j_1526726935, 0, (result_1526726920[chckIndx(i_1526726927, 0, (result_1526726920).length - 1)]).length - 1)], pieceCopy_1476396045(x_1526726936, newIndex_1476395640(state_1526726919), x_1526726936.item, x_1526726936.color, x_1526726936.timesMoved, x_1526726936.piecesTaken, {Field0: nimCopy(null, j_1526726935, NTI1476395036), Field1: nimCopy(null, i_1526726927, NTI1476395042)}, x_1526726936.moves, x_1526726936.takes, x_1526726936.onMove, x_1526726936.onTake, x_1526726936.whenTaken, x_1526726936.onEndTurn, x_1526726936.onPromote, x_1526726936.promoted, x_1526726936.filePath, x_1526726936.colorable, x_1526726936.rotate, x_1526726936.drunk), NTI1476395032); + if ((7 <= i_553652493)) { + break Label5; + } + + i_553652493 += 1; + } + }; + }; + if ((7 <= i_553652496)) { + break Label2; + } + + i_553652496 += 1; + } + }; + }; + + return result_1526726920; + +} + +function initGame_553648349() { + theState_553648248[0] = nimCopy(theState_553648248[0], startingState_1476395254(), NTI1476395033); + theBoard_553648247[0] = nimCopy(theBoard_553648247[0], startingBoard_1526726918(theState_553648248[0]), NTI1476395013); + if (false) { + theState_553648248[0].Field0.randSeed = parseInt(roomId_553648222[0].Field1, 10); + } + + myDrafts_553648235[0] = nimCopy(null, [], NTI1728053692); + opponentDrafts_553648240[0] = nimCopy(null, [], NTI1728053692); + lastMove_553648266[0] = nimCopy(null, [], NTI1543504077); + piecesChecking_553648271[0] = nimCopy(null, [], NTI1543504077); + + +} + +function isNone_1660947766(self_1660947768) { + var result_1660947769 = false; + + result_1660947769 = !(self_1660947768.has); + + return result_1660947769; + +} + +function get_1660947783(self_1660947785) { + var result_1660947786 = 0; + + if (isNone_1660947766(self_1660947785)) { + raiseException({message: [67,97,110,39,116,32,111,98,116,97,105,110,32,97,32,118,97,108,117,101,32,102,114,111,109,32,97,32,96,110,111,110,101,96], parent: null, m_type: NTI1493172247, name: null, trace: [], up: null}, "UnpackDefect"); + } + + result_1660947786 = self_1660947785["val"]; + + return result_1660947786; + +} + +function getMoney_1828716559(side_1828716560, s_1828716561) { + var result_1828716562 = 0; + + BeforeRet: { + var wallet_1828716563 = nimCopy(null, s_1828716561.Field1[chckIndx(side_1828716560, 0, (s_1828716561.Field1).length - 1)].wallet, NTI1476395090); + if (isSome_1660947689(wallet_1828716563)) { + result_1828716562 = get_1660947783(wallet_1828716563); + break BeforeRet; + } + else { + result_1828716562 = (-1); + break BeforeRet; } + }; + + return result_1828716562; + +} + +function HEX3Aanonymous_1795164938(piece_1795164939, __1795164940, state_1795164941) { + var currentMoney_1795164942 = getMoney_1828716559(piece_1795164939.color, state_1795164941); + var next_1795164943 = subInt(mulInt(currentMoney_1795164942, 2), currentMoney_1795164942); + addMoney_1828716586(piece_1795164939.color, next_1795164943, state_1795164941); } -function HEX3Aanonymous_1795164378(side_1795164379, __1795164380, b_1795164381) { +function HEX3Aanonymous_1795164945(side_1795164946, __1795164947, b_1795164948, __1795164949) { Label1: { - var i_1795164382 = 0; - var j_1795164383 = 0; + var i_1795164950 = 0; + var j_1795164951 = 0; Label2: { - var i_553649645 = 0; - var i_553649646 = 0; + var i_553652514 = 0; + var i_553652515 = 0; Label3: { Label4: while (true) { - if (!(i_553649646 < 8)) break Label4; - i_553649645 = i_553649646; + if (!(i_553652515 < 8)) break Label4; + i_553652514 = i_553652515; Label5: { - var j_553649649 = 0; - var i_553649650 = 0; + var j_553652518 = 0; + var i_553652519 = 0; Label6: { Label7: while (true) { - if (!(i_553649650 < 8)) break Label7; - j_553649649 = i_553649650; - i_1795164382 = i_553649645; - j_1795164383 = j_553649649; - if (((b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)][chckIndx(j_1795164383, 0, (b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)]).length - 1)].item == 2) && isColor_1476395605(b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)][chckIndx(j_1795164383, 0, (b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)]).length - 1)], side_1795164379))) { - b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)][chckIndx(j_1795164383, 0, (b_1795164381[chckIndx(i_1795164382, 0, (b_1795164381).length - 1)]).length - 1)].onTake = HEX3Aanonymous_1795164360; + if (!(i_553652519 < 8)) break Label7; + j_553652518 = i_553652519; + i_1795164950 = i_553652514; + j_1795164951 = j_553652518; + if (((b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)][chckIndx(j_1795164951, 0, (b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)]).length - 1)].item == 0) && isColor_1476396138(b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)][chckIndx(j_1795164951, 0, (b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)]).length - 1)], side_1795164946))) { + b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)][chckIndx(j_1795164951, 0, (b_1795164948[chckIndx(i_1795164950, 0, (b_1795164948).length - 1)]).length - 1)].onEndTurn.push(HEX3Aanonymous_1795164938);; } - i_553649650 = addInt(i_553649650, 1); + i_553652519 = addInt(i_553652519, 1); } }; }; - i_553649646 = addInt(i_553649646, 1); + i_553652515 = addInt(i_553652515, 1); } }; }; @@ -8726,123 +9350,259 @@ function HEX3Aanonymous_1795164378(side_1795164379, __1795164380, b_1795164381) } -function HEX3DHEX3D_1728054168(x_1728054170, y_1728054171) { - var result_1728054172 = false; +function HEX3DHEX3D_1728054153(x_1728054155, y_1728054156) { + var result_1728054157 = false; BeforeRet: { - if (!(eqStrings(x_1728054170.name, y_1728054171.name))) { - result_1728054172 = false; + if (!(eqStrings(x_1728054155.name, y_1728054156.name))) { + result_1728054157 = false; break BeforeRet; } - if (!(eqStrings(x_1728054170.technicalName, y_1728054171.technicalName))) { - result_1728054172 = false; + if (!(eqStrings(x_1728054155.technicalName, y_1728054156.technicalName))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.synergy == y_1728054171.synergy))) { - result_1728054172 = false; + if (!((x_1728054155.synergy == y_1728054156.synergy))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.tier == y_1728054171.tier))) { - result_1728054172 = false; + if (!((x_1728054155.tier == y_1728054156.tier))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.rarity == y_1728054171.rarity))) { - result_1728054172 = false; + if (!((x_1728054155.rarity == y_1728054156.rarity))) { + result_1728054157 = false; break BeforeRet; } - if (!(eqStrings(x_1728054170.description, y_1728054171.description))) { - result_1728054172 = false; + if (!(eqStrings(x_1728054155.description, y_1728054156.description))) { + result_1728054157 = false; break BeforeRet; } - if (!(eqStrings(x_1728054170.icon, y_1728054171.icon))) { - result_1728054172 = false; + if (!(eqStrings(x_1728054155.icon, y_1728054156.icon))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.rotatable == y_1728054171.rotatable))) { - result_1728054172 = false; + if (!((x_1728054155.rotatable == y_1728054156.rotatable))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.noColor == y_1728054171.noColor))) { - result_1728054172 = false; + if (!((x_1728054155.noColor == y_1728054156.noColor))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.onStart == y_1728054171.onStart))) { - result_1728054172 = false; + if (!((x_1728054155.onStart == y_1728054156.onStart))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.index == y_1728054171.index))) { - result_1728054172 = false; + if (!((x_1728054155.index == y_1728054156.index))) { + result_1728054157 = false; break BeforeRet; } - if (!((x_1728054170.priority == y_1728054171.priority))) { - result_1728054172 = false; + if (!((x_1728054155.priority == y_1728054156.priority))) { + result_1728054157 = false; break BeforeRet; } - result_1728054172 = true; + result_1728054157 = true; break BeforeRet; }; - return result_1728054172; + return result_1728054157; } -function find_1728054148(a_1728054151, item_1728054152) { - var result_1728054153 = 0; +function find_1728054133(a_1728054136, item_1728054137) { + var result_1728054138 = 0; BeforeRet: { - result_1728054153 = 0; + result_1728054138 = 0; Label1: { - var i_1728054167 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649658 = 0; + var i_1728054152 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652532 = 0; Label2: { Label3: while (true) { - if (!(i_553649658 < (a_1728054151).length)) break Label3; - i_1728054167 = a_1728054151[chckIndx(i_553649658, 0, (a_1728054151).length - 1)]; - if (HEX3DHEX3D_1728054168(i_1728054167, item_1728054152)) { + if (!(i_553652532 < (a_1728054136).length)) break Label3; + i_1728054152 = a_1728054136[chckIndx(i_553652532, 0, (a_1728054136).length - 1)]; + if (HEX3DHEX3D_1728054153(i_1728054152, item_1728054137)) { break BeforeRet; } - result_1728054153 = addInt(result_1728054153, 1); - i_553649658 += 1; + result_1728054138 = addInt(result_1728054138, 1); + i_553652532 += 1; } }; }; - result_1728054153 = (-1); + result_1728054138 = (-1); + }; + + return result_1728054138; + +} + +function contains_1728054128(a_1728054130, item_1728054131) { + var result_1728054132 = false; + + BeforeRet: { + result_1728054132 = (0 <= find_1728054133(a_1728054130, item_1728054131)); + break BeforeRet; + }; + + return result_1728054132; + +} + +function newSeq_1728053664(len_1728053666) { + var result_1728053667 = []; + + result_1728053667 = new Array(len_1728053666); for (var i = 0 ; i < len_1728053666 ; ++i) { result_1728053667[i] = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; } + return result_1728053667; + +} + +function HEX2A_1073741832(x_1073741833, order_1073741834) { + var result_1073741835 = 0; + + var y_1073741840 = subInt(order_1073741834, 1); + result_1073741835 = subInt((x_1073741833 ^ y_1073741840), y_1073741840); + + return result_1073741835; + +} + +function mergeAlt_1728053697(a_1728053699, b_1728053700, lo_1728053701, m_1728053702, hi_1728053703, cmp_1728053706, order_1728053707) { + BeforeRet: { + if ((HEX2A_1073741832(cmp_1728053706(a_1728053699[chckIndx(m_1728053702, 0, (a_1728053699).length - 1)], a_1728053699[chckIndx(addInt(m_1728053702, 1), 0, (a_1728053699).length - 1)]), order_1728053707) <= 0)) { + break BeforeRet; + } + + var j_1728053708 = lo_1728053701; + if (!((j_1728053708 <= m_1728053702))) { + failedAssertImpl_268435541([97,108,103,111,114,105,116,104,109,46,110,105,109,40,51,51,56,44,32,51,41,32,96,106,32,60,61,32,109,96,32]); + } + + var bb_1728053714 = 0; + Label1: { + Label2: while (true) { + if (!(j_1728053708 <= m_1728053702)) break Label2; + b_1728053700[chckIndx(bb_1728053714, 0, (b_1728053700).length - 1)] = nimCopy(b_1728053700[chckIndx(bb_1728053714, 0, (b_1728053700).length - 1)], a_1728053699[chckIndx(j_1728053708, 0, (a_1728053699).length - 1)], NTI1728053255); + bb_1728053714 = addInt(bb_1728053714, 1); + j_1728053708 = addInt(j_1728053708, 1); + } + }; + var i_1728053725 = 0; + var k_1728053726 = lo_1728053701; + Label3: { + Label4: while (true) { + if (!((k_1728053726 < j_1728053708) && (j_1728053708 <= hi_1728053703))) break Label4; + if ((HEX2A_1073741832(cmp_1728053706(b_1728053700[chckIndx(i_1728053725, 0, (b_1728053700).length - 1)], a_1728053699[chckIndx(j_1728053708, 0, (a_1728053699).length - 1)]), order_1728053707) <= 0)) { + a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)] = nimCopy(a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)], b_1728053700[chckIndx(i_1728053725, 0, (b_1728053700).length - 1)], NTI1728053255); + i_1728053725 = addInt(i_1728053725, 1); + } + else { + a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)] = nimCopy(a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)], a_1728053699[chckIndx(j_1728053708, 0, (a_1728053699).length - 1)], NTI1728053255); + j_1728053708 = addInt(j_1728053708, 1); + } + + k_1728053726 = addInt(k_1728053726, 1); + } + }; + Label5: { + Label6: while (true) { + if (!(k_1728053726 < j_1728053708)) break Label6; + a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)] = nimCopy(a_1728053699[chckIndx(k_1728053726, 0, (a_1728053699).length - 1)], b_1728053700[chckIndx(i_1728053725, 0, (b_1728053700).length - 1)], NTI1728053255); + k_1728053726 = addInt(k_1728053726, 1); + i_1728053725 = addInt(i_1728053725, 1); + } + }; }; - return result_1728054153; + +} + +function sort_1728053680(a_1728053682, cmp_1728053685, order_1728053686) { + var n_1728053690 = (a_1728053682).length; + var b_1728053694 = newSeq_1728053664(chckRange(divInt(n_1728053690, 2), 0, 2147483647)); + var s_1728053695 = 1; + Label1: { + Label2: while (true) { + if (!(s_1728053695 < n_1728053690)) break Label2; + var m_1728053696 = subInt(subInt(n_1728053690, 1), s_1728053695); + Label3: { + Label4: while (true) { + if (!(0 <= m_1728053696)) break Label4; + mergeAlt_1728053697(a_1728053682, b_1728053694, nimMax(addInt(subInt(m_1728053696, s_1728053695), 1), 0), m_1728053696, addInt(m_1728053696, s_1728053695), cmp_1728053685, order_1728053686); + m_1728053696 = subInt(m_1728053696, mulInt(s_1728053695, 2)); + } + }; + s_1728053695 = mulInt(s_1728053695, 2); + } + }; + + +} + +function sorted_1728053652(a_1728053654, cmp_1728053657, order_1728053658) { + var result_1728053659 = []; + + result_1728053659 = nimCopy(null, newSeq_1728053664(chckRange((a_1728053654).length, 0, 2147483647)), NTI1728053514); + Label1: { + var i_1728053679 = 0; + var colontmp__553652549 = 0; + colontmp__553652549 = (a_1728053654).length - 1; + var res_553652550 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652550 <= colontmp__553652549)) break Label3; + i_1728053679 = res_553652550; + result_1728053659[chckIndx(i_1728053679, 0, (result_1728053659).length - 1)] = nimCopy(result_1728053659[chckIndx(i_1728053679, 0, (result_1728053659).length - 1)], a_1728053654[chckIndx(i_1728053679, 0, (a_1728053654).length - 1)], NTI1728053255); + res_553652550 = addInt(res_553652550, 1); + } + }; + }; + sort_1728053680(result_1728053659, cmp_1728053657, order_1728053658); + + return result_1728053659; } -function contains_1728054143(a_1728054145, item_1728054146) { - var result_1728054147 = false; +function cmp_33557985(x_33557987, y_33557988) { + var result_33557989 = 0; BeforeRet: { - result_1728054147 = (0 <= find_1728054148(a_1728054145, item_1728054146)); + if ((x_33557987 == y_33557988)) { + result_33557989 = 0; + break BeforeRet; + } + + if ((x_33557987 < y_33557988)) { + result_33557989 = (-1); + break BeforeRet; + } + + result_33557989 = 1; break BeforeRet; }; - return result_1728054147; + return result_33557989; } -function newSeq_1728053464(len_1728053466) { - var result_1728053467 = []; +function newSeq_1728053469(len_1728053471) { + var result_1728053472 = []; - result_1728053467 = new Array(len_1728053466); for (var i = 0 ; i < len_1728053466 ; ++i) { result_1728053467[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } - return result_1728053467; + result_1728053472 = new Array(len_1728053471); for (var i = 0 ; i < len_1728053471 ; ++i) { result_1728053472[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } + return result_1728053472; } @@ -8853,17 +9613,17 @@ function find_1090519095(a_1090519098, item_1090519099) { result_1090519100 = 0; Label1: { var i_1090519104 = []; - var i_553648857 = 0; + var i_553650266 = 0; Label2: { Label3: while (true) { - if (!(i_553648857 < (a_1090519098).length)) break Label3; - i_1090519104 = a_1090519098[chckIndx(i_553648857, 0, (a_1090519098).length - 1)]; + if (!(i_553650266 < (a_1090519098).length)) break Label3; + i_1090519104 = a_1090519098[chckIndx(i_553650266, 0, (a_1090519098).length - 1)]; if (eqStrings(i_1090519104, item_1090519099)) { break BeforeRet; } result_1090519100 = addInt(result_1090519100, 1); - i_553648857 += 1; + i_553650266 += 1; } }; }; @@ -8886,98 +9646,115 @@ function contains_1090519090(a_1090519092, item_1090519093) { } -function HEX26_1728053549(x_1728053551, y_1728053552) { - var result_1728053553 = []; +function HEX26_1728053554(x_1728053556, y_1728053557) { + var result_1728053558 = []; - result_1728053553 = new Array(chckRange(addInt((x_1728053551).length, 1), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728053551).length, 1), 0, 2147483647) ; ++i) { result_1728053553[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } Label1: { - var i_1728053568 = 0; - var colontmp__553649697 = 0; - colontmp__553649697 = subInt((x_1728053551).length, 1); - var res_553649698 = 0; + result_1728053558 = new Array(chckRange(addInt((x_1728053556).length, 1), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728053556).length, 1), 0, 2147483647) ; ++i) { result_1728053558[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } Label1: { + var i_1728053573 = 0; + var colontmp__553652558 = 0; + colontmp__553652558 = subInt((x_1728053556).length, 1); + var res_553652559 = 0; Label2: { Label3: while (true) { - if (!(res_553649698 <= colontmp__553649697)) break Label3; - i_1728053568 = res_553649698; - result_1728053553[chckIndx(i_1728053568, 0, (result_1728053553).length - 1)] = nimCopy(result_1728053553[chckIndx(i_1728053568, 0, (result_1728053553).length - 1)], x_1728053551[chckIndx(i_1728053568, 0, (x_1728053551).length - 1)], NTI1728053253); - res_553649698 = addInt(res_553649698, 1); + if (!(res_553652559 <= colontmp__553652558)) break Label3; + i_1728053573 = res_553652559; + result_1728053558[chckIndx(i_1728053573, 0, (result_1728053558).length - 1)] = nimCopy(result_1728053558[chckIndx(i_1728053573, 0, (result_1728053558).length - 1)], x_1728053556[chckIndx(i_1728053573, 0, (x_1728053556).length - 1)], NTI1728053254); + res_553652559 = addInt(res_553652559, 1); } }; }; - result_1728053553[chckIndx((x_1728053551).length, 0, (result_1728053553).length - 1)] = nimCopy(result_1728053553[chckIndx((x_1728053551).length, 0, (result_1728053553).length - 1)], y_1728053552, NTI1728053253); + result_1728053558[chckIndx((x_1728053556).length, 0, (result_1728053558).length - 1)] = nimCopy(result_1728053558[chckIndx((x_1728053556).length, 0, (result_1728053558).length - 1)], y_1728053557, NTI1728053254); - return result_1728053553; + return result_1728053558; } -function synergize_1728053435(pool_1728053436, currentPowers_1728053437, t_1728053438) { - var result_1728053439 = []; +function secretSynergize_1728053625(currentPowers_1728053626, synergies_1728053627) { + +function HEX3Aanonymous_1728053634(xHEX60gensym15_1728053638, yHEX60gensym15_1728053639) { + var result_1728053640 = 0; + + var it_1728053641 = nimCopy(null, xHEX60gensym15_1728053638, NTI1728053255); + var aHEX60gensym15_1728053642 = it_1728053641.Field0.priority; + it_1728053641 = nimCopy(it_1728053641, yHEX60gensym15_1728053639, NTI1728053255); + var bHEX60gensym15_1728053643 = it_1728053641.Field0.priority; + result_1728053640 = cmp_33557985(aHEX60gensym15_1728053642, bHEX60gensym15_1728053643); - result_1728053439 = nimCopy(null, pool_1728053436, NTI1728053355); + return result_1728053640; + + } + + var result_1728053628 = []; + + result_1728053628 = nimCopy(null, currentPowers_1728053626, NTI1728053492); Label1: { - var s_1728053462 = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; - var i_553649693 = 0; - var L_553649694 = (draftSynergies_1728053318[0]).length; + var s_1728053776 = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; + var colontmp__553652543 = []; + var resultHEX60gensym15_1728053772 = sorted_1728053652(synergies_1728053627, HEX3Aanonymous_1728053634, 1); + colontmp__553652543 = resultHEX60gensym15_1728053772; + var i_553652545 = 0; + var L_553652546 = (colontmp__553652543).length; Label2: { Label3: while (true) { - if (!(i_553649693 < L_553649694)) break Label3; - s_1728053462 = draftSynergies_1728053318[0][chckIndx(i_553649693, 0, (draftSynergies_1728053318[0]).length - 1)]; - var resultHEX60gensym8_1728053488 = newSeq_1728053464(0); + if (!(i_553652545 < L_553652546)) break Label3; + s_1728053776 = colontmp__553652543[chckIndx(i_553652545, 0, (colontmp__553652543).length - 1)]; + var resultHEX60gensym18_1728053781 = newSeq_1728053469(0); Label4: { - var it_1728053510 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649685 = 0; - var L_553649686 = (currentPowers_1728053437).length; + var it_1728053785 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652536 = 0; + var L_553652537 = (result_1728053628).length; Label5: { Label6: while (true) { - if (!(i_553649685 < L_553649686)) break Label6; - it_1728053510 = currentPowers_1728053437[chckIndx(i_553649685, 0, (currentPowers_1728053437).length - 1)]; - if (contains_1090519090(s_1728053462.Field2, it_1728053510.name)) { - var Temporary7 = nimCopy(null, it_1728053510, NTI1728053253); - resultHEX60gensym8_1728053488.push(Temporary7);; + if (!(i_553652536 < L_553652537)) break Label6; + it_1728053785 = result_1728053628[chckIndx(i_553652536, 0, (result_1728053628).length - 1)]; + if (contains_1090519090(s_1728053776.Field2, it_1728053785.name)) { + var Temporary7 = nimCopy(null, it_1728053785, NTI1728053254); + resultHEX60gensym18_1728053781.push(Temporary7);; } - i_553649685 += 1; - if (!(((currentPowers_1728053437).length == L_553649686))) { + i_553652536 += 1; + if (!(((result_1728053628).length == L_553652537))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - if (((resultHEX60gensym8_1728053488).length == (s_1728053462.Field2).length)) { - if (((s_1728053462.Field3).length == 0)) { - var Temporary8 = nimCopy(null, powers_1728053317[0][chckIndx(s_1728053462.Field4, 0, (powers_1728053317[0]).length - 1)], NTI1728053253); - result_1728053439.push(Temporary8);; + if (((resultHEX60gensym18_1728053781).length == (s_1728053776.Field2).length)) { + if (((s_1728053776.Field3).length == 0)) { + var Temporary8 = nimCopy(null, powers_1728053322[0][chckIndx(s_1728053776.Field4, 0, (powers_1728053322[0]).length - 1)], NTI1728053254); + result_1728053628.push(Temporary8);; } else { - var resultHEX60gensym13_1728053536 = newSeq_1728053464(0); + var resultHEX60gensym21_1728053811 = newSeq_1728053469(0); Label9: { - var it_1728053540 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649689 = 0; - var L_553649690 = (result_1728053439).length; + var it_1728053815 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652540 = 0; + var L_553652541 = (result_1728053628).length; Label10: { Label11: while (true) { - if (!(i_553649689 < L_553649690)) break Label11; - it_1728053540 = result_1728053439[chckIndx(i_553649689, 0, (result_1728053439).length - 1)]; - if (!(contains_1090519090(s_1728053462.Field3, it_1728053540.name))) { - var Temporary12 = nimCopy(null, it_1728053540, NTI1728053253); - resultHEX60gensym13_1728053536.push(Temporary12);; + if (!(i_553652540 < L_553652541)) break Label11; + it_1728053815 = result_1728053628[chckIndx(i_553652540, 0, (result_1728053628).length - 1)]; + if (!(eqStrings(it_1728053815.name, [73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]))) { + var Temporary12 = nimCopy(null, it_1728053815, NTI1728053254); + resultHEX60gensym21_1728053811.push(Temporary12);; } - i_553649689 += 1; - if (!(((result_1728053439).length == L_553649690))) { + i_553652540 += 1; + if (!(((result_1728053628).length == L_553652541))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - result_1728053439 = nimCopy(null, HEX26_1728053549(resultHEX60gensym13_1728053536, powers_1728053317[0][chckIndx(s_1728053462.Field4, 0, (powers_1728053317[0]).length - 1)]), NTI1728053444); + result_1728053628 = nimCopy(null, HEX26_1728053554(resultHEX60gensym21_1728053811, powers_1728053322[0][chckIndx(s_1728053776.Field4, 0, (powers_1728053322[0]).length - 1)]), NTI1728053450); } } - i_553649693 += 1; - if (!(((draftSynergies_1728053318[0]).length == L_553649694))) { + i_553652545 += 1; + if (!(((colontmp__553652543).length == L_553652546))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -8985,99 +9762,453 @@ function synergize_1728053435(pool_1728053436, currentPowers_1728053437, t_17280 }; }; - return result_1728053439; + return result_1728053628; } -function newSeq_536871458(len_536871460) { - var result_536871461 = []; - - result_536871461 = new Array(len_536871460); for (var i = 0 ; i < len_536871460 ; ++i) { result_536871461[i] = []; } - return result_536871461; - -} +function HEX26_1728054244(x_1728054246, y_1728054247) { + var result_1728054248 = []; -function newSeq_1728053997(len_1728053999) { - var result_1728054000 = []; + result_1728054248 = new Array(chckRange(addInt((x_1728054246).length, (y_1728054247).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728054246).length, (y_1728054247).length), 0, 2147483647) ; ++i) { result_1728054248[i] = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; } Label1: { + var i_1728054266 = 0; + var colontmp__553652562 = 0; + colontmp__553652562 = subInt((x_1728054246).length, 1); + var res_553652563 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652563 <= colontmp__553652562)) break Label3; + i_1728054266 = res_553652563; + result_1728054248[chckIndx(i_1728054266, 0, (result_1728054248).length - 1)] = nimCopy(result_1728054248[chckIndx(i_1728054266, 0, (result_1728054248).length - 1)], x_1728054246[chckIndx(i_1728054266, 0, (x_1728054246).length - 1)], NTI1728053255); + res_553652563 = addInt(res_553652563, 1); + } + }; + }; + Label4: { + var i_1728054274 = 0; + var colontmp__553652566 = 0; + colontmp__553652566 = subInt((y_1728054247).length, 1); + var res_553652567 = 0; + Label5: { + Label6: while (true) { + if (!(res_553652567 <= colontmp__553652566)) break Label6; + i_1728054274 = res_553652567; + result_1728054248[chckIndx(addInt(i_1728054274, (x_1728054246).length), 0, (result_1728054248).length - 1)] = nimCopy(result_1728054248[chckIndx(addInt(i_1728054274, (x_1728054246).length), 0, (result_1728054248).length - 1)], y_1728054247[chckIndx(i_1728054274, 0, (y_1728054247).length - 1)], NTI1728053255); + res_553652567 = addInt(res_553652567, 1); + } + }; + }; - result_1728054000 = new Array(len_1728053999); for (var i = 0 ; i < len_1728053999 ; ++i) { result_1728054000[i] = 0; } - return result_1728054000; + return result_1728054248; } -function randomPower_1728053903(t_1728053904, currentPowers_1728053905, alreadySelected_1728053910) { - var Temporary2; - - var result_1728053911 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - +function mergeAlt_1728054407(a_1728054409, b_1728054410, lo_1728054411, m_1728054412, hi_1728054413, cmp_1728054416, order_1728054417) { BeforeRet: { - var resultHEX60gensym25_1728053916 = newSeq_1728053464(0); - Label1: { - var it_1728053920 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649666 = []; - colontmp__553649666 = synergize_1728053435((Temporary2 = seqOf_1728053870(t_1728053904), Temporary2)[0][Temporary2[1]], currentPowers_1728053905, t_1728053904); - var i_553649667 = 0; - var L_553649668 = (colontmp__553649666).length; - Label3: { - Label4: while (true) { - if (!(i_553649667 < L_553649668)) break Label4; - it_1728053920 = colontmp__553649666[chckIndx(i_553649667, 0, (colontmp__553649666).length - 1)]; - Label5: { - var iHEX60gensym27_1728053941 = 0; - var resultHEX60gensym27_1728053948 = newSeq_536871458(chckRange((alreadySelected_1728053910).length, 0, 2147483647)); - Label6: { - var it_1728053952 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649663 = 0; - var L_553649664 = (alreadySelected_1728053910).length; - Label7: { - Label8: while (true) { - if (!(i_553649663 < L_553649664)) break Label8; - it_1728053952 = alreadySelected_1728053910[chckIndx(i_553649663, 0, (alreadySelected_1728053910).length - 1)]; - resultHEX60gensym27_1728053948[chckIndx(iHEX60gensym27_1728053941, 0, (resultHEX60gensym27_1728053948).length - 1)] = nimCopy(null, it_1728053952.name, NTI33554449); - iHEX60gensym27_1728053941 = addInt(iHEX60gensym27_1728053941, 1); - i_553649663 += 1; - if (!(((alreadySelected_1728053910).length == L_553649664))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - }; - if (!(contains_1090519090(resultHEX60gensym27_1728053948, it_1728053920.name))) { - var Temporary9 = nimCopy(null, it_1728053920, NTI1728053253); - resultHEX60gensym25_1728053916.push(Temporary9);; - } - - i_553649667 += 1; - if (!(((colontmp__553649666).length == L_553649668))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - var search_1728053965 = nimCopy(null, resultHEX60gensym25_1728053916, NTI1728053379); - if (((search_1728053965).length == 0)) { - result_1728053911 = nimCopy(result_1728053911, emptyPower_1728053307, NTI1728053253); + if ((HEX2A_1073741832(cmp_1728054416(a_1728054409[chckIndx(m_1728054412, 0, (a_1728054409).length - 1)], a_1728054409[chckIndx(addInt(m_1728054412, 1), 0, (a_1728054409).length - 1)]), order_1728054417) <= 0)) { break BeforeRet; } - Label10: { - var iHEX60gensym31_1728053993 = 0; - var resultHEX60gensym31_1728054021 = newSeq_1728053997(chckRange((search_1728053965).length, 0, 2147483647)); + var j_1728054418 = lo_1728054411; + if (!((j_1728054418 <= m_1728054412))) { + failedAssertImpl_268435541([97,108,103,111,114,105,116,104,109,46,110,105,109,40,51,51,56,44,32,51,41,32,96,106,32,60,61,32,109,96,32]); + } + + var bb_1728054424 = 0; + Label1: { + Label2: while (true) { + if (!(j_1728054418 <= m_1728054412)) break Label2; + b_1728054410[chckIndx(bb_1728054424, 0, (b_1728054410).length - 1)] = nimCopy(b_1728054410[chckIndx(bb_1728054424, 0, (b_1728054410).length - 1)], a_1728054409[chckIndx(j_1728054418, 0, (a_1728054409).length - 1)], NTI1728053254); + bb_1728054424 = addInt(bb_1728054424, 1); + j_1728054418 = addInt(j_1728054418, 1); + } + }; + var i_1728054435 = 0; + var k_1728054436 = lo_1728054411; + Label3: { + Label4: while (true) { + if (!((k_1728054436 < j_1728054418) && (j_1728054418 <= hi_1728054413))) break Label4; + if ((HEX2A_1073741832(cmp_1728054416(b_1728054410[chckIndx(i_1728054435, 0, (b_1728054410).length - 1)], a_1728054409[chckIndx(j_1728054418, 0, (a_1728054409).length - 1)]), order_1728054417) <= 0)) { + a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)] = nimCopy(a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)], b_1728054410[chckIndx(i_1728054435, 0, (b_1728054410).length - 1)], NTI1728053254); + i_1728054435 = addInt(i_1728054435, 1); + } + else { + a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)] = nimCopy(a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)], a_1728054409[chckIndx(j_1728054418, 0, (a_1728054409).length - 1)], NTI1728053254); + j_1728054418 = addInt(j_1728054418, 1); + } + + k_1728054436 = addInt(k_1728054436, 1); + } + }; + Label5: { + Label6: while (true) { + if (!(k_1728054436 < j_1728054418)) break Label6; + a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)] = nimCopy(a_1728054409[chckIndx(k_1728054436, 0, (a_1728054409).length - 1)], b_1728054410[chckIndx(i_1728054435, 0, (b_1728054410).length - 1)], NTI1728053254); + k_1728054436 = addInt(k_1728054436, 1); + i_1728054435 = addInt(i_1728054435, 1); + } + }; + }; + + +} + +function sort_1728054390(a_1728054392, cmp_1728054395, order_1728054396) { + var n_1728054400 = (a_1728054392).length; + var b_1728054404 = newSeq_1728053469(chckRange(divInt(n_1728054400, 2), 0, 2147483647)); + var s_1728054405 = 1; + Label1: { + Label2: while (true) { + if (!(s_1728054405 < n_1728054400)) break Label2; + var m_1728054406 = subInt(subInt(n_1728054400, 1), s_1728054405); + Label3: { + Label4: while (true) { + if (!(0 <= m_1728054406)) break Label4; + mergeAlt_1728054407(a_1728054392, b_1728054404, nimMax(addInt(subInt(m_1728054406, s_1728054405), 1), 0), m_1728054406, addInt(m_1728054406, s_1728054405), cmp_1728054395, order_1728054396); + m_1728054406 = subInt(m_1728054406, mulInt(s_1728054405, 2)); + } + }; + s_1728054405 = mulInt(s_1728054405, 2); + } + }; + + +} + +function sorted_1728054368(a_1728054370, cmp_1728054373, order_1728054374) { + var result_1728054375 = []; + + result_1728054375 = nimCopy(null, newSeq_1728053469(chckRange((a_1728054370).length, 0, 2147483647)), NTI1728053385); + Label1: { + var i_1728054389 = 0; + var colontmp__553652570 = 0; + colontmp__553652570 = (a_1728054370).length - 1; + var res_553652571 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652571 <= colontmp__553652570)) break Label3; + i_1728054389 = res_553652571; + result_1728054375[chckIndx(i_1728054389, 0, (result_1728054375).length - 1)] = nimCopy(result_1728054375[chckIndx(i_1728054389, 0, (result_1728054375).length - 1)], a_1728054370[chckIndx(i_1728054389, 0, (a_1728054370).length - 1)], NTI1728053254); + res_553652571 = addInt(res_553652571, 1); + } + }; + }; + sort_1728054390(result_1728054375, cmp_1728054373, order_1728054374); + + return result_1728054375; + +} + +function concat_1728054284(seqs_1728054286) { + var result_1728054287 = []; + + var L_1728054288 = 0; + Label1: { + var seqitm_1728054302 = []; + var i_553652580 = 0; + Label2: { + Label3: while (true) { + if (!(i_553652580 < (seqs_1728054286).length)) break Label3; + seqitm_1728054302 = seqs_1728054286[chckIndx(i_553652580, 0, (seqs_1728054286).length - 1)]; + L_1728054288 = addInt(L_1728054288, (seqitm_1728054302).length); + i_553652580 += 1; + } + }; + }; + result_1728054287 = new Array(chckRange(L_1728054288, 0, 2147483647)); for (var i = 0 ; i < chckRange(L_1728054288, 0, 2147483647) ; ++i) { result_1728054287[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } var i_1728054315 = 0; + Label4: { + var s_1728054319 = []; + var i_553652587 = 0; + Label5: { + Label6: while (true) { + if (!(i_553652587 < (seqs_1728054286).length)) break Label6; + s_1728054319 = seqs_1728054286[chckIndx(i_553652587, 0, (seqs_1728054286).length - 1)]; + Label7: { + var itm_1728054323 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652584 = 0; + var L_553652585 = (s_1728054319).length; + Label8: { + Label9: while (true) { + if (!(i_553652584 < L_553652585)) break Label9; + itm_1728054323 = s_1728054319[chckIndx(i_553652584, 0, (s_1728054319).length - 1)]; + result_1728054287[chckIndx(i_1728054315, 0, (result_1728054287).length - 1)] = nimCopy(result_1728054287[chckIndx(i_1728054315, 0, (result_1728054287).length - 1)], itm_1728054323, NTI1728053254); + i_1728054315 = addInt(i_1728054315, 1); + i_553652584 += 1; + if (!(((s_1728054319).length == L_553652585))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + i_553652587 += 1; + } + }; + }; + + return result_1728054287; + +} + +function execute_1728054225(myDrafts_1728054226, opponentDrafts_1728054227, mySide_1728054228, board_1728054229, state_1728054230) { + +function HEX3Aanonymous_1728054350(xHEX60gensym41_1728054354, yHEX60gensym41_1728054355) { + var result_1728054356 = 0; + + var it_1728054357 = nimCopy(null, xHEX60gensym41_1728054354, NTI1728053254); + var aHEX60gensym41_1728054358 = it_1728054357.priority; + it_1728054357 = nimCopy(it_1728054357, yHEX60gensym41_1728054355, NTI1728053254); + var bHEX60gensym41_1728054359 = it_1728054357.priority; + result_1728054356 = cmp_33557985(aHEX60gensym41_1728054358, bHEX60gensym41_1728054359); + + return result_1728054356; + + } + + Label1: { + var x_1728054234 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652522 = 0; + var L_553652523 = (myDrafts_1728054226).length; + Label2: { + Label3: while (true) { + if (!(i_553652522 < L_553652523)) break Label3; + x_1728054234 = myDrafts_1728054226[chckIndx(i_553652522, 0, (myDrafts_1728054226).length - 1)]; + if (!(!(contains_1728054128(opponentDrafts_1728054227, x_1728054234)))) { + failedAssertImpl_268435541(([112,111,119,101,114,46,110,105,109,40,49,56,52,44,32,57,41,32,96,120,32,110,111,116,105,110,32,111,112,112,111,110,101,110,116,68,114,97,102,116,115,96,32] || []).concat(x_1728054234.name || [],[32,105,115,32,115,111,109,101,104,111,119,32,105,110,32,98,111,116,104,32,112,111,111,108,115] || [])); + } + + i_553652522 += 1; + if (!(((myDrafts_1728054226).length == L_553652523))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + var mySynergizedDrafts_1728054278 = secretSynergize_1728053625(myDrafts_1728054226, HEX26_1728054244(secretSynergies_1728053324[0], secretSecretSynergies_1728053325[0])); + var opponentSynergizedDrafts_1728054283 = secretSynergize_1728053625(opponentDrafts_1728054227, HEX26_1728054244(secretSynergies_1728053324[0], secretSecretSynergies_1728053325[0])); + Label4: { + var d_1728054471 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var colontmp__553652526 = []; + var resultHEX60gensym41_1728054467 = sorted_1728054368(concat_1728054284([nimCopy(null, mySynergizedDrafts_1728054278, NTI1728053963), nimCopy(null, opponentSynergizedDrafts_1728054283, NTI1728053968)]), HEX3Aanonymous_1728054350, 1); + colontmp__553652526 = resultHEX60gensym41_1728054467; + var i_553652527 = 0; + var L_553652528 = (colontmp__553652526).length; + Label5: { + Label6: while (true) { + if (!(i_553652527 < L_553652528)) break Label6; + d_1728054471 = colontmp__553652526[chckIndx(i_553652527, 0, (colontmp__553652526).length - 1)]; + if (contains_1728054128(mySynergizedDrafts_1728054278, d_1728054471)) { + d_1728054471.onStart(mySide_1728054228, mySide_1728054228, board_1728054229, state_1728054230); + } + else { + d_1728054471.onStart(otherSide_1476396146(mySide_1728054228), mySide_1728054228, board_1728054229, state_1728054230); + } + + i_553652527 += 1; + if (!(((colontmp__553652526).length == L_553652528))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + + +} + +function add_553649992(x_553649994, x_553649994_Idx, y_553649995) { + var Temporary1; + + var xl_553649999 = (x_553649994[x_553649994_Idx]).length; + if (x_553649994[x_553649994_Idx].length < (Temporary1 = chckRange(addInt(xl_553649999, (y_553649995).length), 0, 2147483647), Temporary1)) { for (var i = x_553649994[x_553649994_Idx].length ; i < Temporary1 ; ++i) x_553649994[x_553649994_Idx].push(({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0})); } + else { x_553649994[x_553649994_Idx].length = Temporary1; }; + Label2: { + var i_553650014 = 0; + var colontmp__553652590 = 0; + colontmp__553652590 = (y_553649995).length - 1; + var res_553652591 = 0; + Label3: { + Label4: while (true) { + if (!(res_553652591 <= colontmp__553652590)) break Label4; + i_553650014 = res_553652591; + x_553649994[x_553649994_Idx][chckIndx(addInt(xl_553649999, i_553650014), 0, (x_553649994[x_553649994_Idx]).length - 1)] = nimCopy(x_553649994[x_553649994_Idx][chckIndx(addInt(xl_553649999, i_553650014), 0, (x_553649994[x_553649994_Idx]).length - 1)], y_553649995[chckIndx(i_553650014, 0, (y_553649995).length - 1)], NTI1728053254); + res_553652591 = addInt(res_553652591, 1); + } + }; + }; + + +} + +function synergize_1728053440(pool_1728053441, currentPowers_1728053442, t_1728053443) { + var result_1728053444 = []; + + result_1728053444 = nimCopy(null, pool_1728053441, NTI1728053361); + Label1: { + var s_1728053467 = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; + var i_553652629 = 0; + var L_553652630 = (draftSynergies_1728053323[0]).length; + Label2: { + Label3: while (true) { + if (!(i_553652629 < L_553652630)) break Label3; + s_1728053467 = draftSynergies_1728053323[0][chckIndx(i_553652629, 0, (draftSynergies_1728053323[0]).length - 1)]; + var resultHEX60gensym8_1728053493 = newSeq_1728053469(0); + Label4: { + var it_1728053515 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652622 = 0; + var L_553652623 = (currentPowers_1728053442).length; + Label5: { + Label6: while (true) { + if (!(i_553652622 < L_553652623)) break Label6; + it_1728053515 = currentPowers_1728053442[chckIndx(i_553652622, 0, (currentPowers_1728053442).length - 1)]; + if (contains_1090519090(s_1728053467.Field2, it_1728053515.name)) { + var Temporary7 = nimCopy(null, it_1728053515, NTI1728053254); + resultHEX60gensym8_1728053493.push(Temporary7);; + } + + i_553652622 += 1; + if (!(((currentPowers_1728053442).length == L_553652623))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + if (((resultHEX60gensym8_1728053493).length == (s_1728053467.Field2).length)) { + if (((s_1728053467.Field3).length == 0)) { + var Temporary8 = nimCopy(null, powers_1728053322[0][chckIndx(s_1728053467.Field4, 0, (powers_1728053322[0]).length - 1)], NTI1728053254); + result_1728053444.push(Temporary8);; + } + else { + var resultHEX60gensym13_1728053541 = newSeq_1728053469(0); + Label9: { + var it_1728053545 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652626 = 0; + var L_553652627 = (result_1728053444).length; + Label10: { + Label11: while (true) { + if (!(i_553652626 < L_553652627)) break Label11; + it_1728053545 = result_1728053444[chckIndx(i_553652626, 0, (result_1728053444).length - 1)]; + if (!(contains_1090519090(s_1728053467.Field3, it_1728053545.name))) { + var Temporary12 = nimCopy(null, it_1728053545, NTI1728053254); + resultHEX60gensym13_1728053541.push(Temporary12);; + } + + i_553652626 += 1; + if (!(((result_1728053444).length == L_553652627))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + result_1728053444 = nimCopy(null, HEX26_1728053554(resultHEX60gensym13_1728053541, powers_1728053322[0][chckIndx(s_1728053467.Field4, 0, (powers_1728053322[0]).length - 1)]), NTI1728053450); + } + + } + + i_553652629 += 1; + if (!(((draftSynergies_1728053323[0]).length == L_553652630))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + + return result_1728053444; + +} + +function newSeq_536871458(len_536871460) { + var result_536871461 = []; + + result_536871461 = new Array(len_536871460); for (var i = 0 ; i < len_536871460 ; ++i) { result_536871461[i] = []; } + return result_536871461; + +} + +function newSeq_1728053982(len_1728053984) { + var result_1728053985 = []; + + result_1728053985 = new Array(len_1728053984); for (var i = 0 ; i < len_1728053984 ; ++i) { result_1728053985[i] = 0; } + return result_1728053985; + +} + +function randomPower_1728053888(t_1728053889, currentPowers_1728053890, alreadySelected_1728053895) { + var Temporary2; + + var result_1728053896 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + + BeforeRet: { + var resultHEX60gensym23_1728053901 = newSeq_1728053469(0); + Label1: { + var it_1728053905 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var colontmp__553652603 = []; + colontmp__553652603 = synergize_1728053440((Temporary2 = seqOf_1728053855(t_1728053889), Temporary2)[0][Temporary2[1]], currentPowers_1728053890, t_1728053889); + var i_553652604 = 0; + var L_553652605 = (colontmp__553652603).length; + Label3: { + Label4: while (true) { + if (!(i_553652604 < L_553652605)) break Label4; + it_1728053905 = colontmp__553652603[chckIndx(i_553652604, 0, (colontmp__553652603).length - 1)]; + Label5: { + var iHEX60gensym25_1728053926 = 0; + var resultHEX60gensym25_1728053933 = newSeq_536871458(chckRange((alreadySelected_1728053895).length, 0, 2147483647)); + Label6: { + var it_1728053937 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652600 = 0; + var L_553652601 = (alreadySelected_1728053895).length; + Label7: { + Label8: while (true) { + if (!(i_553652600 < L_553652601)) break Label8; + it_1728053937 = alreadySelected_1728053895[chckIndx(i_553652600, 0, (alreadySelected_1728053895).length - 1)]; + resultHEX60gensym25_1728053933[chckIndx(iHEX60gensym25_1728053926, 0, (resultHEX60gensym25_1728053933).length - 1)] = nimCopy(null, it_1728053937.name, NTI33554449); + iHEX60gensym25_1728053926 = addInt(iHEX60gensym25_1728053926, 1); + i_553652600 += 1; + if (!(((alreadySelected_1728053895).length == L_553652601))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + }; + if (!(contains_1090519090(resultHEX60gensym25_1728053933, it_1728053905.name))) { + var Temporary9 = nimCopy(null, it_1728053905, NTI1728053254); + resultHEX60gensym23_1728053901.push(Temporary9);; + } + + i_553652604 += 1; + if (!(((colontmp__553652603).length == L_553652605))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + var search_1728053950 = nimCopy(null, resultHEX60gensym23_1728053901, NTI1728053385); + if (((search_1728053950).length == 0)) { + result_1728053896 = nimCopy(result_1728053896, emptyPower_1728053311, NTI1728053254); + break BeforeRet; + } + + Label10: { + var iHEX60gensym29_1728053978 = 0; + var resultHEX60gensym29_1728054006 = newSeq_1728053982(chckRange((search_1728053950).length, 0, 2147483647)); Label11: { - var it_1728054025 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649672 = 0; - var L_553649673 = (search_1728053965).length; + var it_1728054010 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652609 = 0; + var L_553652610 = (search_1728053950).length; Label12: { Label13: while (true) { - if (!(i_553649672 < L_553649673)) break Label13; - it_1728054025 = search_1728053965[chckIndx(i_553649672, 0, (search_1728053965).length - 1)]; - resultHEX60gensym31_1728054021[chckIndx(iHEX60gensym31_1728053993, 0, (resultHEX60gensym31_1728054021).length - 1)] = it_1728054025.rarity; - iHEX60gensym31_1728053993 = addInt(iHEX60gensym31_1728053993, 1); - i_553649672 += 1; - if (!(((search_1728053965).length == L_553649673))) { + if (!(i_553652609 < L_553652610)) break Label13; + it_1728054010 = search_1728053950[chckIndx(i_553652609, 0, (search_1728053950).length - 1)]; + resultHEX60gensym29_1728054006[chckIndx(iHEX60gensym29_1728053978, 0, (resultHEX60gensym29_1728054006).length - 1)] = it_1728054010.rarity; + iHEX60gensym29_1728053978 = addInt(iHEX60gensym29_1728053978, 1); + i_553652609 += 1; + if (!(((search_1728053950).length == L_553652610))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -9085,47 +10216,47 @@ function randomPower_1728053903(t_1728053904, currentPowers_1728053905, alreadyS }; }; }; - var sHEX60gensym30_1728054030 = nimCopy(null, resultHEX60gensym31_1728054021, NTI1728053797); - var nHEX60gensym30_1728054035 = (sHEX60gensym30_1728054030).length; - if (!((0 < nHEX60gensym30_1728054035))) { - failedAssertImpl_268435541([115,101,113,117,116,105,108,115,46,110,105,109,40,57,55,55,44,32,51,41,32,96,110,96,103,101,110,115,121,109,51,48,32,62,32,48,96,32,67,97,110,39,116,32,102,111,108,100,32,101,109,112,116,121,32,115,101,113,117,101,110,99,101,115]); + var sHEX60gensym28_1728054015 = nimCopy(null, resultHEX60gensym29_1728054006, NTI1728053770); + var nHEX60gensym28_1728054020 = (sHEX60gensym28_1728054015).length; + if (!((0 < nHEX60gensym28_1728054020))) { + failedAssertImpl_268435541([115,101,113,117,116,105,108,115,46,110,105,109,40,57,55,55,44,32,51,41,32,96,110,96,103,101,110,115,121,109,50,56,32,62,32,48,96,32,67,97,110,39,116,32,102,111,108,100,32,101,109,112,116,121,32,115,101,113,117,101,110,99,101,115]); } - var resultHEX60gensym30_1728054041 = sHEX60gensym30_1728054030[chckIndx(subInt(nHEX60gensym30_1728054035, 1), 0, (sHEX60gensym30_1728054030).length - 1)]; + var resultHEX60gensym28_1728054026 = sHEX60gensym28_1728054015[chckIndx(subInt(nHEX60gensym28_1728054020, 1), 0, (sHEX60gensym28_1728054015).length - 1)]; Label14: { - var iHEX60gensym30_1728054047 = 0; - var colontmp__553649676 = 0; - colontmp__553649676 = subInt(nHEX60gensym30_1728054035, 2); - var res_553649677 = colontmp__553649676; + var iHEX60gensym28_1728054032 = 0; + var colontmp__553652613 = 0; + colontmp__553652613 = subInt(nHEX60gensym28_1728054020, 2); + var res_553652614 = colontmp__553652613; Label15: { Label16: while (true) { - if (!(0 <= res_553649677)) break Label16; - iHEX60gensym30_1728054047 = res_553649677; - var a_1728054048 = sHEX60gensym30_1728054030[chckIndx(iHEX60gensym30_1728054047, 0, (sHEX60gensym30_1728054030).length - 1)]; - var b_1728054049 = resultHEX60gensym30_1728054041; - resultHEX60gensym30_1728054041 = addInt(a_1728054048, b_1728054049); - res_553649677 = subInt(res_553649677, 1); + if (!(0 <= res_553652614)) break Label16; + iHEX60gensym28_1728054032 = res_553652614; + var a_1728054033 = sHEX60gensym28_1728054015[chckIndx(iHEX60gensym28_1728054032, 0, (sHEX60gensym28_1728054015).length - 1)]; + var b_1728054034 = resultHEX60gensym28_1728054026; + resultHEX60gensym28_1728054026 = addInt(a_1728054033, b_1728054034); + res_553652614 = subInt(res_553652614, 1); } }; }; - var sum_1728054050 = resultHEX60gensym30_1728054041; - var x_1728054051 = rand_1644167304(sum_1728054050); + var sum_1728054035 = resultHEX60gensym28_1728054026; + var x_1728054036 = rand_1644167304(sum_1728054035); Label17: { - var p_1728054055 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649680 = 0; - var L_553649681 = (search_1728053965).length; + var p_1728054040 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652617 = 0; + var L_553652618 = (search_1728053950).length; Label18: { Label19: while (true) { - if (!(i_553649680 < L_553649681)) break Label19; - p_1728054055 = search_1728053965[chckIndx(i_553649680, 0, (search_1728053965).length - 1)]; - x_1728054051 = subInt(x_1728054051, p_1728054055.rarity); - if ((x_1728054051 <= 0)) { - result_1728053911 = nimCopy(result_1728053911, p_1728054055, NTI1728053253); + if (!(i_553652617 < L_553652618)) break Label19; + p_1728054040 = search_1728053950[chckIndx(i_553652617, 0, (search_1728053950).length - 1)]; + x_1728054036 = subInt(x_1728054036, p_1728054040.rarity); + if ((x_1728054036 <= 0)) { + result_1728053896 = nimCopy(result_1728053896, p_1728054040, NTI1728053254); break BeforeRet; } - i_553649680 += 1; - if (!(((search_1728053965).length == L_553649681))) { + i_553652617 += 1; + if (!(((search_1728053950).length == L_553652618))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -9134,613 +10265,185 @@ function randomPower_1728053903(t_1728053904, currentPowers_1728053905, alreadyS }; }; - return result_1728053911; + return result_1728053896; } -function randomTier_1728054060(w_1728054061) { - var result_1728054062 = 0; +function randomTier_1728054045(w_1728054046) { + var result_1728054047 = 0; BeforeRet: { - if (!((addInt(addInt(addInt(w_1728054061.Field0, w_1728054061.Field1), w_1728054061.Field2), w_1728054061.Field3) == 100))) { - failedAssertImpl_268435541(makeNimstrLit("power.nim(162, 5) `w.common + w.uncommon + w.rare + w.ultraRare == 100` ")); + if (!((addInt(addInt(addInt(w_1728054046.Field0, w_1728054046.Field1), w_1728054046.Field2), w_1728054046.Field3) == 100))) { + failedAssertImpl_268435541(makeNimstrLit("power.nim(160, 5) `w.common + w.uncommon + w.rare + w.ultraRare == 100` ")); } - var x_1728054068 = rand_1644167304(100); - if ((x_1728054068 <= w_1728054061.Field0)) { - result_1728054062 = 0; + var x_1728054053 = rand_1644167304(100); + if ((x_1728054053 <= w_1728054046.Field0)) { + result_1728054047 = 0; break BeforeRet; } else { - if ((x_1728054068 <= addInt(w_1728054061.Field0, w_1728054061.Field1))) { - result_1728054062 = 1; + if ((x_1728054053 <= addInt(w_1728054046.Field0, w_1728054046.Field1))) { + result_1728054047 = 1; break BeforeRet; } else { - if ((x_1728054068 <= addInt(addInt(w_1728054061.Field0, w_1728054061.Field1), w_1728054061.Field2))) { - result_1728054062 = 2; + if ((x_1728054053 <= addInt(addInt(w_1728054046.Field0, w_1728054046.Field1), w_1728054046.Field2))) { + result_1728054047 = 2; break BeforeRet; } else { - result_1728054062 = 3; + result_1728054047 = 3; break BeforeRet; } }} }; - return result_1728054062; + return result_1728054047; } -function HEX26_1728054098(x_1728054100, y_1728054101) { - var result_1728054102 = []; +function HEX26_1728054083(x_1728054085, y_1728054086) { + var result_1728054087 = []; - result_1728054102 = new Array(chckRange(addInt((x_1728054100).length, (y_1728054101).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728054100).length, (y_1728054101).length), 0, 2147483647) ; ++i) { result_1728054102[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } Label1: { - var i_1728054120 = 0; - var colontmp__553649701 = 0; - colontmp__553649701 = subInt((x_1728054100).length, 1); - var res_553649702 = 0; + result_1728054087 = new Array(chckRange(addInt((x_1728054085).length, (y_1728054086).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728054085).length, (y_1728054086).length), 0, 2147483647) ; ++i) { result_1728054087[i] = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); } Label1: { + var i_1728054105 = 0; + var colontmp__553652633 = 0; + colontmp__553652633 = subInt((x_1728054085).length, 1); + var res_553652634 = 0; Label2: { Label3: while (true) { - if (!(res_553649702 <= colontmp__553649701)) break Label3; - i_1728054120 = res_553649702; - result_1728054102[chckIndx(i_1728054120, 0, (result_1728054102).length - 1)] = nimCopy(result_1728054102[chckIndx(i_1728054120, 0, (result_1728054102).length - 1)], x_1728054100[chckIndx(i_1728054120, 0, (x_1728054100).length - 1)], NTI1728053253); - res_553649702 = addInt(res_553649702, 1); + if (!(res_553652634 <= colontmp__553652633)) break Label3; + i_1728054105 = res_553652634; + result_1728054087[chckIndx(i_1728054105, 0, (result_1728054087).length - 1)] = nimCopy(result_1728054087[chckIndx(i_1728054105, 0, (result_1728054087).length - 1)], x_1728054085[chckIndx(i_1728054105, 0, (x_1728054085).length - 1)], NTI1728053254); + res_553652634 = addInt(res_553652634, 1); } }; }; Label4: { - var i_1728054128 = 0; - var colontmp__553649705 = 0; - colontmp__553649705 = subInt((y_1728054101).length, 1); - var res_553649706 = 0; + var i_1728054113 = 0; + var colontmp__553652637 = 0; + colontmp__553652637 = subInt((y_1728054086).length, 1); + var res_553652638 = 0; Label5: { Label6: while (true) { - if (!(res_553649706 <= colontmp__553649705)) break Label6; - i_1728054128 = res_553649706; - result_1728054102[chckIndx(addInt(i_1728054128, (x_1728054100).length), 0, (result_1728054102).length - 1)] = nimCopy(result_1728054102[chckIndx(addInt(i_1728054128, (x_1728054100).length), 0, (result_1728054102).length - 1)], y_1728054101[chckIndx(i_1728054128, 0, (y_1728054101).length - 1)], NTI1728053253); - res_553649706 = addInt(res_553649706, 1); + if (!(res_553652638 <= colontmp__553652637)) break Label6; + i_1728054113 = res_553652638; + result_1728054087[chckIndx(addInt(i_1728054113, (x_1728054085).length), 0, (result_1728054087).length - 1)] = nimCopy(result_1728054087[chckIndx(addInt(i_1728054113, (x_1728054085).length), 0, (result_1728054087).length - 1)], y_1728054086[chckIndx(i_1728054113, 0, (y_1728054086).length - 1)], NTI1728053254); + res_553652638 = addInt(res_553652638, 1); } }; }; - return result_1728054102; + return result_1728054087; } -function draftRandomPower_1728054136(allSelected_1728054137, drafterSelected_1728054138, options_1728054139, normalWeights_1728054140, buffedWeights_1728054141) { +function draftRandomPower_1728054121(allSelected_1728054122, drafterSelected_1728054123, options_1728054124, normalWeights_1728054125, buffedWeights_1728054126) { var Temporary1; - var result_1728054142 = []; + var result_1728054127 = []; - if (contains_1728054143(drafterSelected_1728054138, holy_1728053312)) { - Temporary1 = buffedWeights_1728054141; + if (contains_1728054128(drafterSelected_1728054123, holy_1728053317)) { + Temporary1 = buffedWeights_1728054126; } else { - Temporary1 = normalWeights_1728054140; + Temporary1 = normalWeights_1728054125; } - var weights_1728054192 = nimCopy(null, Temporary1, NTI1728053255); + var weights_1728054177 = nimCopy(null, Temporary1, NTI1728053256); Label2: { - var x_1728054197 = 0; - var colontmp__553649653 = 0; - colontmp__553649653 = subInt(options_1728054139, 1); - var res_553649654 = 0; + var x_1728054182 = 0; + var colontmp__553652594 = 0; + colontmp__553652594 = subInt(options_1728054124, 1); + var res_553652595 = 0; Label3: { Label4: while (true) { - if (!(res_553649654 <= colontmp__553649653)) break Label4; - x_1728054197 = res_553649654; - result_1728054142.push(randomPower_1728053903(randomTier_1728054060(weights_1728054192), drafterSelected_1728054138, HEX26_1728054098(allSelected_1728054137, result_1728054142)));; - res_553649654 = addInt(res_553649654, 1); + if (!(res_553652595 <= colontmp__553652594)) break Label4; + x_1728054182 = res_553652595; + result_1728054127.push(randomPower_1728053888(randomTier_1728054045(weights_1728054177), drafterSelected_1728054123, HEX26_1728054083(allSelected_1728054122, result_1728054127)));; + res_553652595 = addInt(res_553652595, 1); } }; }; - return result_1728054142; + return result_1728054127; } -function draftRandomPowerTier_1728054085(t_1728054086, allSelected_1728054087, drafterSelected_1728054088, options_1728054089, normalWeights_1728054090, buffedWeights_1728054091) { - var result_1728054092 = []; +function draftRandomPowerTier_1728054070(t_1728054071, allSelected_1728054072, drafterSelected_1728054073, options_1728054074, normalWeights_1728054075, buffedWeights_1728054076) { + var result_1728054077 = []; Label1: { - var x_1728054097 = 0; - var colontmp__553649709 = 0; - colontmp__553649709 = subInt(options_1728054089, 1); - var res_553649710 = 0; + var x_1728054082 = 0; + var colontmp__553652641 = 0; + colontmp__553652641 = subInt(options_1728054074, 1); + var res_553652642 = 0; Label2: { Label3: while (true) { - if (!(res_553649710 <= colontmp__553649709)) break Label3; - x_1728054097 = res_553649710; - result_1728054092.push(randomPower_1728053903(t_1728054086, drafterSelected_1728054088, HEX26_1728054098(allSelected_1728054087, result_1728054092)));; - res_553649710 = addInt(res_553649710, 1); + if (!(res_553652642 <= colontmp__553652641)) break Label3; + x_1728054082 = res_553652642; + result_1728054077.push(randomPower_1728053888(t_1728054071, drafterSelected_1728054073, HEX26_1728054083(allSelected_1728054072, result_1728054077)));; + res_553652642 = addInt(res_553652642, 1); } }; }; - return result_1728054092; + return result_1728054077; } -function draft_553648589(allDrafts_553648594, drafter_553648599) { - var disabled_553648604 = [[]]; - if (disableRNGPowers_553648239[0]) { - add_553648605(disabled_553648604, 0, rngPowers_1795165019); +function draft_553649976(allDrafts_553649981, drafter_553649986) { + var disabled_553649991 = [[]]; + if (disableRNGPowers_553648273[0]) { + add_553649992(disabled_553649991, 0, rngPowers_1795165223); + } + + if (!(enableExperimental_553648275[0])) { + add_553649992(disabled_553649991, 0, experimentalPowers_1795165228); } - if ((gameMode_553648241[0] == 2)) { - draftOptions_553648208[0] = nimCopy(null, draftRandomPower_1728054136(HEX26_1728054098(allDrafts_553648594, disabled_553648604[0]), drafter_553648599, draftChoices_553648209[0], {Field0: 60, Field1: 30, Field2: 9, Field3: 1}, {Field0: 50, Field1: 36, Field2: 12, Field3: 2}), NTI1728053889); + if ((gameMode_553648278[0] == 2)) { + draftOptions_553648242[0] = nimCopy(null, draftRandomPower_1728054121(HEX26_1728054083(allDrafts_553649981, disabled_553649991[0]), drafter_553649986, draftChoices_553648243[0], {Field0: 60, Field1: 30, Field2: 9, Field3: 1}, {Field0: 50, Field1: 36, Field2: 12, Field3: 2}), NTI1728053862); } else { - if ((gameMode_553648241[0] == 1)) { - draftOptions_553648208[0] = nimCopy(null, draftRandomPowerTier_1728054085(draftTier_553648211[0], HEX26_1728054098(HEX26_1728053549(allDrafts_553648594, holy_1728053312), disabled_553648604[0]), drafter_553648599, draftChoices_553648209[0], {Field0: 60, Field1: 30, Field2: 9, Field3: 1}, {Field0: 50, Field1: 36, Field2: 12, Field3: 2}), NTI1728053852); + if ((gameMode_553648278[0] == 1)) { + draftOptions_553648242[0] = nimCopy(null, draftRandomPowerTier_1728054070(draftTier_553648245[0], HEX26_1728054083(HEX26_1728053554(allDrafts_553649981, holy_1728053317), disabled_553649991[0]), drafter_553649986, draftChoices_553648243[0], {Field0: 60, Field1: 30, Field2: 9, Field3: 1}, {Field0: 50, Field1: 36, Field2: 12, Field3: 2}), NTI1728053825); } else { - if ((gameMode_553648241[0] == 3)) { - draftOptions_553648208[0] = nimCopy(null, draftRandomPower_1728054136(HEX26_1728054098(allDrafts_553648594, disabled_553648604[0]), drafter_553648599, draftChoices_553648209[0], {Field0: 25, Field1: 35, Field2: 30, Field3: 10}, {Field0: 15, Field1: 38, Field2: 35, Field3: 12}), NTI1728053889); + if ((gameMode_553648278[0] == 3)) { + draftOptions_553648242[0] = nimCopy(null, draftRandomPower_1728054121(HEX26_1728054083(allDrafts_553649981, disabled_553649991[0]), drafter_553649986, draftChoices_553648243[0], {Field0: 25, Field1: 35, Field2: 30, Field3: 10}, {Field0: 15, Field1: 38, Field2: 35, Field3: 12}), NTI1728053862); } }} } -function HEX2A_1073741832(x_1073741833, order_1073741834) { - var result_1073741835 = 0; +function newSeq_721421866(len_721421868) { + var result_721421869 = []; - var y_1073741840 = subInt(order_1073741834, 1); - result_1073741835 = subInt((x_1073741833 ^ y_1073741840), y_1073741840); + result_721421869 = new Array(len_721421868); for (var i = 0 ; i < len_721421868 ; ++i) { result_721421869[i] = ({k: 0, parent: null, current: null, newNode: null, oldNode: null}); } + return result_721421869; - return result_1073741835; +} + +function newSeq_721421894(len_721421896) { + var result_721421897 = []; + + result_721421897 = new Array(len_721421896); for (var i = 0 ; i < len_721421896 ; ++i) { result_721421897[i] = ({parent: null, newChild: null, pos: 0}); } + return result_721421897; } -function mergeAlt_1728054341(a_1728054343, b_1728054344, lo_1728054345, m_1728054346, hi_1728054347, cmp_1728054350, order_1728054351) { - BeforeRet: { - if ((HEX2A_1073741832(cmp_1728054350(a_1728054343[chckIndx(m_1728054346, 0, (a_1728054343).length - 1)], a_1728054343[chckIndx(addInt(m_1728054346, 1), 0, (a_1728054343).length - 1)]), order_1728054351) <= 0)) { - break BeforeRet; - } +function init_721421814(ev_721421815) { - var j_1728054352 = lo_1728054345; - if (!((j_1728054352 <= m_1728054346))) { - failedAssertImpl_268435541([97,108,103,111,114,105,116,104,109,46,110,105,109,40,51,51,56,44,32,51,41,32,96,106,32,60,61,32,109,96,32]); +function HEX3Aanonymous_721421816() { + dodraw_721421712(kxi__); + + } - - var bb_1728054358 = 0; - Label1: { - Label2: while (true) { - if (!(j_1728054352 <= m_1728054346)) break Label2; - b_1728054344[chckIndx(bb_1728054358, 0, (b_1728054344).length - 1)] = nimCopy(b_1728054344[chckIndx(bb_1728054358, 0, (b_1728054344).length - 1)], a_1728054343[chckIndx(j_1728054352, 0, (a_1728054343).length - 1)], NTI1728053253); - bb_1728054358 = addInt(bb_1728054358, 1); - j_1728054352 = addInt(j_1728054352, 1); - } - }; - var i_1728054369 = 0; - var k_1728054370 = lo_1728054345; - Label3: { - Label4: while (true) { - if (!((k_1728054370 < j_1728054352) && (j_1728054352 <= hi_1728054347))) break Label4; - if ((HEX2A_1073741832(cmp_1728054350(b_1728054344[chckIndx(i_1728054369, 0, (b_1728054344).length - 1)], a_1728054343[chckIndx(j_1728054352, 0, (a_1728054343).length - 1)]), order_1728054351) <= 0)) { - a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)] = nimCopy(a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)], b_1728054344[chckIndx(i_1728054369, 0, (b_1728054344).length - 1)], NTI1728053253); - i_1728054369 = addInt(i_1728054369, 1); - } - else { - a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)] = nimCopy(a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)], a_1728054343[chckIndx(j_1728054352, 0, (a_1728054343).length - 1)], NTI1728053253); - j_1728054352 = addInt(j_1728054352, 1); - } - - k_1728054370 = addInt(k_1728054370, 1); - } - }; - Label5: { - Label6: while (true) { - if (!(k_1728054370 < j_1728054352)) break Label6; - a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)] = nimCopy(a_1728054343[chckIndx(k_1728054370, 0, (a_1728054343).length - 1)], b_1728054344[chckIndx(i_1728054369, 0, (b_1728054344).length - 1)], NTI1728053253); - k_1728054370 = addInt(k_1728054370, 1); - i_1728054369 = addInt(i_1728054369, 1); - } - }; - }; - - -} - -function sort_1728054324(a_1728054326, cmp_1728054329, order_1728054330) { - var n_1728054334 = (a_1728054326).length; - var b_1728054338 = newSeq_1728053464(chckRange(divInt(n_1728054334, 2), 0, 2147483647)); - var s_1728054339 = 1; - Label1: { - Label2: while (true) { - if (!(s_1728054339 < n_1728054334)) break Label2; - var m_1728054340 = subInt(subInt(n_1728054334, 1), s_1728054339); - Label3: { - Label4: while (true) { - if (!(0 <= m_1728054340)) break Label4; - mergeAlt_1728054341(a_1728054326, b_1728054338, nimMax(addInt(subInt(m_1728054340, s_1728054339), 1), 0), m_1728054340, addInt(m_1728054340, s_1728054339), cmp_1728054329, order_1728054330); - m_1728054340 = subInt(m_1728054340, mulInt(s_1728054339, 2)); - } - }; - s_1728054339 = mulInt(s_1728054339, 2); - } - }; - - -} - -function sorted_1728054302(a_1728054304, cmp_1728054307, order_1728054308) { - var result_1728054309 = []; - - result_1728054309 = nimCopy(null, newSeq_1728053464(chckRange((a_1728054304).length, 0, 2147483647)), NTI1728053379); - Label1: { - var i_1728054323 = 0; - var colontmp__553649718 = 0; - colontmp__553649718 = (a_1728054304).length - 1; - var res_553649719 = 0; - Label2: { - Label3: while (true) { - if (!(res_553649719 <= colontmp__553649718)) break Label3; - i_1728054323 = res_553649719; - result_1728054309[chckIndx(i_1728054323, 0, (result_1728054309).length - 1)] = nimCopy(result_1728054309[chckIndx(i_1728054323, 0, (result_1728054309).length - 1)], a_1728054304[chckIndx(i_1728054323, 0, (a_1728054304).length - 1)], NTI1728053253); - res_553649719 = addInt(res_553649719, 1); - } - }; - }; - sort_1728054324(result_1728054309, cmp_1728054307, order_1728054308); - - return result_1728054309; - -} - -function newSeq_1728053659(len_1728053661) { - var result_1728053662 = []; - - result_1728053662 = new Array(len_1728053661); for (var i = 0 ; i < len_1728053661 ; ++i) { result_1728053662[i] = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; } - return result_1728053662; - -} - -function mergeAlt_1728053692(a_1728053694, b_1728053695, lo_1728053696, m_1728053697, hi_1728053698, cmp_1728053701, order_1728053702) { - BeforeRet: { - if ((HEX2A_1073741832(cmp_1728053701(a_1728053694[chckIndx(m_1728053697, 0, (a_1728053694).length - 1)], a_1728053694[chckIndx(addInt(m_1728053697, 1), 0, (a_1728053694).length - 1)]), order_1728053702) <= 0)) { - break BeforeRet; - } - - var j_1728053703 = lo_1728053696; - if (!((j_1728053703 <= m_1728053697))) { - failedAssertImpl_268435541([97,108,103,111,114,105,116,104,109,46,110,105,109,40,51,51,56,44,32,51,41,32,96,106,32,60,61,32,109,96,32]); - } - - var bb_1728053709 = 0; - Label1: { - Label2: while (true) { - if (!(j_1728053703 <= m_1728053697)) break Label2; - b_1728053695[chckIndx(bb_1728053709, 0, (b_1728053695).length - 1)] = nimCopy(b_1728053695[chckIndx(bb_1728053709, 0, (b_1728053695).length - 1)], a_1728053694[chckIndx(j_1728053703, 0, (a_1728053694).length - 1)], NTI1728053254); - bb_1728053709 = addInt(bb_1728053709, 1); - j_1728053703 = addInt(j_1728053703, 1); - } - }; - var i_1728053720 = 0; - var k_1728053721 = lo_1728053696; - Label3: { - Label4: while (true) { - if (!((k_1728053721 < j_1728053703) && (j_1728053703 <= hi_1728053698))) break Label4; - if ((HEX2A_1073741832(cmp_1728053701(b_1728053695[chckIndx(i_1728053720, 0, (b_1728053695).length - 1)], a_1728053694[chckIndx(j_1728053703, 0, (a_1728053694).length - 1)]), order_1728053702) <= 0)) { - a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)] = nimCopy(a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)], b_1728053695[chckIndx(i_1728053720, 0, (b_1728053695).length - 1)], NTI1728053254); - i_1728053720 = addInt(i_1728053720, 1); - } - else { - a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)] = nimCopy(a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)], a_1728053694[chckIndx(j_1728053703, 0, (a_1728053694).length - 1)], NTI1728053254); - j_1728053703 = addInt(j_1728053703, 1); - } - - k_1728053721 = addInt(k_1728053721, 1); - } - }; - Label5: { - Label6: while (true) { - if (!(k_1728053721 < j_1728053703)) break Label6; - a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)] = nimCopy(a_1728053694[chckIndx(k_1728053721, 0, (a_1728053694).length - 1)], b_1728053695[chckIndx(i_1728053720, 0, (b_1728053695).length - 1)], NTI1728053254); - k_1728053721 = addInt(k_1728053721, 1); - i_1728053720 = addInt(i_1728053720, 1); - } - }; - }; - - -} - -function sort_1728053675(a_1728053677, cmp_1728053680, order_1728053681) { - var n_1728053685 = (a_1728053677).length; - var b_1728053689 = newSeq_1728053659(chckRange(divInt(n_1728053685, 2), 0, 2147483647)); - var s_1728053690 = 1; - Label1: { - Label2: while (true) { - if (!(s_1728053690 < n_1728053685)) break Label2; - var m_1728053691 = subInt(subInt(n_1728053685, 1), s_1728053690); - Label3: { - Label4: while (true) { - if (!(0 <= m_1728053691)) break Label4; - mergeAlt_1728053692(a_1728053677, b_1728053689, nimMax(addInt(subInt(m_1728053691, s_1728053690), 1), 0), m_1728053691, addInt(m_1728053691, s_1728053690), cmp_1728053680, order_1728053681); - m_1728053691 = subInt(m_1728053691, mulInt(s_1728053690, 2)); - } - }; - s_1728053690 = mulInt(s_1728053690, 2); - } - }; - - -} - -function sorted_1728053647(a_1728053649, cmp_1728053652, order_1728053653) { - var result_1728053654 = []; - - result_1728053654 = nimCopy(null, newSeq_1728053659(chckRange((a_1728053649).length, 0, 2147483647)), NTI1728053508); - Label1: { - var i_1728053674 = 0; - var colontmp__553649744 = 0; - colontmp__553649744 = (a_1728053649).length - 1; - var res_553649745 = 0; - Label2: { - Label3: while (true) { - if (!(res_553649745 <= colontmp__553649744)) break Label3; - i_1728053674 = res_553649745; - result_1728053654[chckIndx(i_1728053674, 0, (result_1728053654).length - 1)] = nimCopy(result_1728053654[chckIndx(i_1728053674, 0, (result_1728053654).length - 1)], a_1728053649[chckIndx(i_1728053674, 0, (a_1728053649).length - 1)], NTI1728053254); - res_553649745 = addInt(res_553649745, 1); - } - }; - }; - sort_1728053675(result_1728053654, cmp_1728053652, order_1728053653); - - return result_1728053654; - -} - -function cmp_33557985(x_33557987, y_33557988) { - var result_33557989 = 0; - - BeforeRet: { - if ((x_33557987 == y_33557988)) { - result_33557989 = 0; - break BeforeRet; - } - - if ((x_33557987 < y_33557988)) { - result_33557989 = (-1); - break BeforeRet; - } - - result_33557989 = 1; - break BeforeRet; - }; - - return result_33557989; - -} - -function secretSynergize_1728053620(currentPowers_1728053621, synergies_1728053622) { - -function HEX3Aanonymous_1728053629(xHEX60gensym15_1728053633, yHEX60gensym15_1728053634) { - var result_1728053635 = 0; - - var it_1728053636 = nimCopy(null, xHEX60gensym15_1728053633, NTI1728053254); - var aHEX60gensym15_1728053637 = it_1728053636.Field0.priority; - it_1728053636 = nimCopy(it_1728053636, yHEX60gensym15_1728053634, NTI1728053254); - var bHEX60gensym15_1728053638 = it_1728053636.Field0.priority; - result_1728053635 = cmp_33557985(aHEX60gensym15_1728053637, bHEX60gensym15_1728053638); - - return result_1728053635; - - } - - var result_1728053623 = []; - - result_1728053623 = nimCopy(null, currentPowers_1728053621, NTI1728053486); - Label1: { - var s_1728053771 = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; - var colontmp__553649739 = []; - var resultHEX60gensym15_1728053767 = sorted_1728053647(synergies_1728053622, HEX3Aanonymous_1728053629, 1); - colontmp__553649739 = resultHEX60gensym15_1728053767; - var i_553649740 = 0; - var L_553649741 = (colontmp__553649739).length; - Label2: { - Label3: while (true) { - if (!(i_553649740 < L_553649741)) break Label3; - s_1728053771 = colontmp__553649739[chckIndx(i_553649740, 0, (colontmp__553649739).length - 1)]; - var resultHEX60gensym18_1728053776 = newSeq_1728053464(0); - Label4: { - var it_1728053780 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649728 = 0; - var L_553649729 = (result_1728053623).length; - Label5: { - Label6: while (true) { - if (!(i_553649728 < L_553649729)) break Label6; - it_1728053780 = result_1728053623[chckIndx(i_553649728, 0, (result_1728053623).length - 1)]; - if (contains_1090519090(s_1728053771.Field2, it_1728053780.name)) { - var Temporary7 = nimCopy(null, it_1728053780, NTI1728053253); - resultHEX60gensym18_1728053776.push(Temporary7);; - } - - i_553649728 += 1; - if (!(((result_1728053623).length == L_553649729))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - if (((resultHEX60gensym18_1728053776).length == 1)) { - rawEcho(s_1728053771.Field0.name); - } - - var resultHEX60gensym20_1728053796 = newSeq_1728053464(0); - Label8: { - var it_1728053800 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649732 = 0; - var L_553649733 = (result_1728053623).length; - Label9: { - Label10: while (true) { - if (!(i_553649732 < L_553649733)) break Label10; - it_1728053800 = result_1728053623[chckIndx(i_553649732, 0, (result_1728053623).length - 1)]; - if (contains_1090519090(s_1728053771.Field2, it_1728053800.name)) { - var Temporary11 = nimCopy(null, it_1728053800, NTI1728053253); - resultHEX60gensym20_1728053796.push(Temporary11);; - } - - i_553649732 += 1; - if (!(((result_1728053623).length == L_553649733))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - if (((resultHEX60gensym20_1728053796).length == (s_1728053771.Field2).length)) { - if (((s_1728053771.Field3).length == 0)) { - rawEcho([104,101,108,108,111,63]); - var Temporary12 = nimCopy(null, powers_1728053317[0][chckIndx(s_1728053771.Field4, 0, (powers_1728053317[0]).length - 1)], NTI1728053253); - result_1728053623.push(Temporary12);; - } - else { - rawEcho([104,101,108,108,111,63]); - var resultHEX60gensym23_1728053826 = newSeq_1728053464(0); - Label13: { - var it_1728053830 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649736 = 0; - var L_553649737 = (result_1728053623).length; - Label14: { - Label15: while (true) { - if (!(i_553649736 < L_553649737)) break Label15; - it_1728053830 = result_1728053623[chckIndx(i_553649736, 0, (result_1728053623).length - 1)]; - if (!(eqStrings(it_1728053830.name, [73,108,108,101,103,97,108,32,70,111,114,109,97,116,105,111,110]))) { - var Temporary16 = nimCopy(null, it_1728053830, NTI1728053253); - resultHEX60gensym23_1728053826.push(Temporary16);; - } - - i_553649736 += 1; - if (!(((result_1728053623).length == L_553649737))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - result_1728053623 = nimCopy(null, HEX26_1728053549(resultHEX60gensym23_1728053826, powers_1728053317[0][chckIndx(s_1728053771.Field4, 0, (powers_1728053317[0]).length - 1)]), NTI1728053444); - } - - } - - i_553649740 += 1; - if (!(((colontmp__553649739).length == L_553649741))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - - return result_1728053623; - -} - -function HEX26_1728054245(x_1728054247, y_1728054248) { - var result_1728054249 = []; - - result_1728054249 = new Array(chckRange(addInt((x_1728054247).length, (y_1728054248).length), 0, 2147483647)); for (var i = 0 ; i < chckRange(addInt((x_1728054247).length, (y_1728054248).length), 0, 2147483647) ; ++i) { result_1728054249[i] = {Field0: ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}), Field1: 0, Field2: [], Field3: [], Field4: 0}; } Label1: { - var i_1728054267 = 0; - var colontmp__553649753 = 0; - colontmp__553649753 = subInt((x_1728054247).length, 1); - var res_553649754 = 0; - Label2: { - Label3: while (true) { - if (!(res_553649754 <= colontmp__553649753)) break Label3; - i_1728054267 = res_553649754; - result_1728054249[chckIndx(i_1728054267, 0, (result_1728054249).length - 1)] = nimCopy(result_1728054249[chckIndx(i_1728054267, 0, (result_1728054249).length - 1)], x_1728054247[chckIndx(i_1728054267, 0, (x_1728054247).length - 1)], NTI1728053254); - res_553649754 = addInt(res_553649754, 1); - } - }; - }; - Label4: { - var i_1728054275 = 0; - var colontmp__553649757 = 0; - colontmp__553649757 = subInt((y_1728054248).length, 1); - var res_553649758 = 0; - Label5: { - Label6: while (true) { - if (!(res_553649758 <= colontmp__553649757)) break Label6; - i_1728054275 = res_553649758; - result_1728054249[chckIndx(addInt(i_1728054275, (x_1728054247).length), 0, (result_1728054249).length - 1)] = nimCopy(result_1728054249[chckIndx(addInt(i_1728054275, (x_1728054247).length), 0, (result_1728054249).length - 1)], y_1728054248[chckIndx(i_1728054275, 0, (y_1728054248).length - 1)], NTI1728053254); - res_553649758 = addInt(res_553649758, 1); - } - }; - }; - - return result_1728054249; - -} - -function executeOn_1728054240(drafts_1728054241, draftSide_1728054242, mySide_1728054243, board_1728054244) { - -function HEX3Aanonymous_1728054284(xHEX60gensym40_1728054288, yHEX60gensym40_1728054289) { - var result_1728054290 = 0; - - var it_1728054291 = nimCopy(null, xHEX60gensym40_1728054288, NTI1728053253); - var aHEX60gensym40_1728054292 = it_1728054291.priority; - it_1728054291 = nimCopy(it_1728054291, yHEX60gensym40_1728054289, NTI1728053253); - var bHEX60gensym40_1728054293 = it_1728054291.priority; - result_1728054290 = cmp_33557985(aHEX60gensym40_1728054292, bHEX60gensym40_1728054293); - - return result_1728054290; - - } - - Label1: { - var d_1728054405 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649713 = []; - var resultHEX60gensym40_1728054401 = sorted_1728054302(secretSynergize_1728053620(drafts_1728054241, HEX26_1728054245(secretSynergies_1728053319[0], secretSecretSynergies_1728053320[0])), HEX3Aanonymous_1728054284, 1); - colontmp__553649713 = resultHEX60gensym40_1728054401; - var i_553649714 = 0; - var L_553649715 = (colontmp__553649713).length; - Label2: { - Label3: while (true) { - if (!(i_553649714 < L_553649715)) break Label3; - d_1728054405 = colontmp__553649713[chckIndx(i_553649714, 0, (colontmp__553649713).length - 1)]; - d_1728054405.onStart(draftSide_1728054242, mySide_1728054243, board_1728054244); - i_553649714 += 1; - if (!(((colontmp__553649713).length == L_553649715))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - - -} - -function newSeq_721421866(len_721421868) { - var result_721421869 = []; - - result_721421869 = new Array(len_721421868); for (var i = 0 ; i < len_721421868 ; ++i) { result_721421869[i] = ({k: 0, parent: null, current: null, newNode: null, oldNode: null}); } - return result_721421869; - -} - -function newSeq_721421894(len_721421896) { - var result_721421897 = []; - - result_721421897 = new Array(len_721421896); for (var i = 0 ; i < len_721421896 ; ++i) { result_721421897[i] = ({parent: null, newChild: null, pos: 0}); } - return result_721421897; - -} - -function init_721421814(ev_721421815) { - -function HEX3Aanonymous_721421816() { - dodraw_721421712(kxi__); - - - } - - kxi__.renderId = window.requestAnimationFrame(HEX3Aanonymous_721421816); + + kxi__.renderId = window.requestAnimationFrame(HEX3Aanonymous_721421816); } @@ -9818,13 +10521,13 @@ function tree_754975616(kind_754975617, kids_754975618) { result_754975619 = newVNode_754975613(kind_754975617); Label1: { var k_754975632 = null; - var i_553649762 = 0; + var i_553652646 = 0; Label2: { Label3: while (true) { - if (!(i_553649762 < (kids_754975618).length)) break Label3; - k_754975632 = kids_754975618[chckIndx(i_553649762, 0, (kids_754975618).length - 1)]; + if (!(i_553652646 < (kids_754975618).length)) break Label3; + k_754975632 = kids_754975618[chckIndx(i_553652646, 0, (kids_754975618).length - 1)]; add_754975552(result_754975619, k_754975632); - i_553649762 += 1; + i_553652646 += 1; } }; }; @@ -9883,19 +10586,19 @@ function HEX2F_33556020(x_33556021, y_33556022) { } -function epochTime_1660948688() { - var result_1660948689 = 0.0; +function epochTime_1660948666() { + var result_1660948667 = 0.0; - result_1660948689 = HEX2F_33556020(new Date().getTime(), 1000); + result_1660948667 = HEX2F_33556020(new Date().getTime(), 1000); - return result_1660948689; + return result_1660948667; } function initRand_1644167459() { var result_1644167460 = ({a0: 0, a1: 0}); - var time_1644167461 = (BigInt(Math.trunc((epochTime_1660948688() * 1000.0))) & 2147483647n); + var time_1644167461 = (BigInt(Math.trunc((epochTime_1660948666() * 1000.0))) & 2147483647n); result_1644167460 = nimCopy(result_1644167460, initRand_1644167417(time_1644167461), NTI1644167172); return result_1644167460; @@ -9916,15 +10619,15 @@ function substr_33558084(s_33558085, first_33558086, last_33558087) { result_33558088 = nimCopy(null, mnewString(chckRange(L_33558090, 0, 2147483647)), NTI33554449); Label1: { var i_33558095 = 0; - var colontmp__553649773 = 0; - colontmp__553649773 = subInt(L_33558090, 1); - var res_553649774 = 0; + var colontmp__553652657 = 0; + colontmp__553652657 = subInt(L_33558090, 1); + var res_553652658 = 0; Label2: { Label3: while (true) { - if (!(res_553649774 <= colontmp__553649773)) break Label3; - i_33558095 = res_553649774; + if (!(res_553652658 <= colontmp__553652657)) break Label3; + i_33558095 = res_553652658; result_33558088[chckIndx(i_33558095, 0, (result_33558088).length - 1)] = s_33558085[chckIndx(addInt(i_33558095, first_33558089), 0, (s_33558085).length - 1)]; - res_553649774 = addInt(res_553649774, 1); + res_553652658 = addInt(res_553652658, 1); } }; }; @@ -9939,31 +10642,31 @@ function nsuSplitChar(s_889192993, sep_889192994, maxsplit_889192995) { result_889192996 = nimCopy(null, [], NTI889192821); Label1: { var xHEX60gensym67_889193002 = []; - var lastHEX60gensym34_553649767 = 0; - var splitsHEX60gensym34_553649768 = maxsplit_889192995; + var lastHEX60gensym34_553652651 = 0; + var splitsHEX60gensym34_553652652 = maxsplit_889192995; Label2: { Label3: while (true) { - if (!(lastHEX60gensym34_553649767 <= (s_889192993).length)) break Label3; - var firstHEX60gensym34_553649770 = lastHEX60gensym34_553649767; + if (!(lastHEX60gensym34_553652651 <= (s_889192993).length)) break Label3; + var firstHEX60gensym34_553652654 = lastHEX60gensym34_553652651; Label4: { Label5: while (true) { - if (!((lastHEX60gensym34_553649767 < (s_889192993).length) && !((s_889192993[chckIndx(lastHEX60gensym34_553649767, 0, (s_889192993).length - 1)] == sep_889192994)))) break Label5; - lastHEX60gensym34_553649767 = addInt(lastHEX60gensym34_553649767, 1); + if (!((lastHEX60gensym34_553652651 < (s_889192993).length) && !((s_889192993[chckIndx(lastHEX60gensym34_553652651, 0, (s_889192993).length - 1)] == sep_889192994)))) break Label5; + lastHEX60gensym34_553652651 = addInt(lastHEX60gensym34_553652651, 1); } }; - if ((splitsHEX60gensym34_553649768 == 0)) { - lastHEX60gensym34_553649767 = (s_889192993).length; + if ((splitsHEX60gensym34_553652652 == 0)) { + lastHEX60gensym34_553652651 = (s_889192993).length; } - xHEX60gensym67_889193002 = substr_33558084(s_889192993, firstHEX60gensym34_553649770, subInt(lastHEX60gensym34_553649767, 1)); + xHEX60gensym67_889193002 = substr_33558084(s_889192993, firstHEX60gensym34_553652654, subInt(lastHEX60gensym34_553652651, 1)); var Temporary6 = nimCopy(null, xHEX60gensym67_889193002, NTI33554449); result_889192996.push(Temporary6);; - if ((splitsHEX60gensym34_553649768 == 0)) { + if ((splitsHEX60gensym34_553652652 == 0)) { break Label2; } - splitsHEX60gensym34_553649768 = subInt(splitsHEX60gensym34_553649768, 1); - lastHEX60gensym34_553649767 = addInt(lastHEX60gensym34_553649767, 1); + splitsHEX60gensym34_553652652 = subInt(splitsHEX60gensym34_553652652, 1); + lastHEX60gensym34_553652651 = addInt(lastHEX60gensym34_553652651, 1); } }; }; @@ -9972,17 +10675,17 @@ function nsuSplitChar(s_889192993, sep_889192994, maxsplit_889192995) { } -function cutMessage_1577058348(data_1577058349) { +function cutMessage_1577058347(data_1577058348) { var Temporary1; - var result_1577058350 = []; + var result_1577058349 = []; BeforeRet: { - result_1577058350 = nimCopy(null, (Temporary1 = nsuSplitChar(cstrToNimstr(data_1577058349), 58, (-1)), Temporary1)[chckIndx(1, 0, (Temporary1).length - 1)], NTI33554449); + result_1577058349 = nimCopy(null, (Temporary1 = nsuSplitChar(cstrToNimstr(data_1577058348), 58, (-1)), Temporary1)[chckIndx(1, 0, (Temporary1).length - 1)], NTI33554449); break BeforeRet; }; - return result_1577058350; + return result_1577058349; } @@ -10003,19 +10706,19 @@ function nsuFindChar(s_889194147, sub_889194148, start_889194149, last_889194150 var last_889194152 = Temporary1; Label2: { var iHEX60gensym176_889194166 = 0; - var colontmp__553649781 = 0; - colontmp__553649781 = start_889194149; - var res_553649782 = colontmp__553649781; + var colontmp__553652665 = 0; + colontmp__553652665 = start_889194149; + var res_553652666 = colontmp__553652665; Label3: { Label4: while (true) { - if (!(res_553649782 <= last_889194152)) break Label4; - iHEX60gensym176_889194166 = res_553649782; + if (!(res_553652666 <= last_889194152)) break Label4; + iHEX60gensym176_889194166 = res_553652666; if ((s_889194147[chckIndx(iHEX60gensym176_889194166, 0, (s_889194147).length - 1)] == sub_889194148)) { result_889194151 = iHEX60gensym176_889194166; break BeforeRet; } - res_553649782 = addInt(res_553649782, 1); + res_553652666 = addInt(res_553652666, 1); } }; }; @@ -10089,15 +10792,15 @@ function nsuInitSkipTable(a_889194067, sub_889194068) { fill_889194070(a_889194067, m_889194069); Label1: { var i_889194089 = 0; - var colontmp__553649787 = 0; - colontmp__553649787 = subInt(m_889194069, 1); - var i_553649788 = 0; + var colontmp__553652671 = 0; + colontmp__553652671 = subInt(m_889194069, 1); + var i_553652672 = 0; Label2: { Label3: while (true) { - if (!(i_553649788 < colontmp__553649787)) break Label3; - i_889194089 = i_553649788; + if (!(i_553652672 < colontmp__553652671)) break Label3; + i_889194089 = i_553652672; a_889194067[chckIndx(sub_889194068[chckIndx(i_889194089, 0, (sub_889194068).length - 1)], 0, (a_889194067).length - 1)] = subInt(subInt(m_889194069, 1), i_889194089); - i_553649788 = addInt(i_553649788, 1); + i_553652672 = addInt(i_553652672, 1); } }; }; @@ -10147,104 +10850,99 @@ function contains_889194326(s_889194327, sub_889194328) { } -function messageType_1577058328(data_1577058329) { - var result_1577058330 = 0; +function messageType_1577058327(data_1577058328) { + var result_1577058329 = 0; BeforeRet: { - var str_1577058331 = cstrToNimstr(data_1577058329); - if (contains_889194326(str_1577058331, [105,100,58])) { - result_1577058330 = 0; - break BeforeRet; - } - else { - if (contains_889194326(str_1577058331, [104,97,110,100,115,104,97,107,101,58])) { - result_1577058330 = 1; + var str_1577058330 = cstrToNimstr(data_1577058328); + if (contains_889194326(str_1577058330, [105,100,58])) { + result_1577058329 = 0; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [109,111,118,101,58])) { - result_1577058330 = 2; + if (contains_889194326(str_1577058330, [104,97,110,100,115,104,97,107,101,58])) { + result_1577058329 = 1; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [111,112,116,105,111,110,115,58])) { - result_1577058330 = 3; + if (contains_889194326(str_1577058330, [111,112,116,105,111,110,115,58])) { + result_1577058329 = 2; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [100,114,97,102,116,58])) { - result_1577058330 = 4; + if (contains_889194326(str_1577058330, [100,114,97,102,116,58])) { + result_1577058329 = 3; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [114,101,109,97,116,99,104,58])) { - result_1577058330 = 6; + if (contains_889194326(str_1577058330, [114,101,109,97,116,99,104,58])) { + result_1577058329 = 5; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [101,110,100,58])) { - result_1577058330 = 5; + if (contains_889194326(str_1577058330, [101,110,100,58])) { + result_1577058329 = 4; break BeforeRet; } else { - if (contains_889194326(str_1577058331, [98,117,121,58])) { - result_1577058330 = 7; + if (contains_889194326(str_1577058330, [97,99,116,105,111,110,58])) { + result_1577058329 = 6; break BeforeRet; } - }}}}}}} + }}}}}} }; - return result_1577058330; + return result_1577058329; } -function newHost_1577058351(cb_1577058355) { +function newHost_1577058350(cb_1577058354) { -function HEX3Aanonymous_1577058415(id_1577058416) { - cb_1577058355(HEX24_385875976(roomId_1577058394), 0); +function HEX3Aanonymous_1577058414(id_1577058415) { + cb_1577058354(HEX24_385875976(roomId_1577058393), 0); } -function HEX3Aanonymous_1577058444(c_1577058445) { +function HEX3Aanonymous_1577058443(c_1577058444) { -function HEX3Aanonymous_1577058446(data_1577058447) { - cb_1577058355(cutMessage_1577058348(data_1577058447), messageType_1577058328(data_1577058447)); +function HEX3Aanonymous_1577058445(data_1577058446) { + cb_1577058354(cutMessage_1577058347(data_1577058446), messageType_1577058327(data_1577058446)); } - conn_1577058396 = c_1577058445; - conn_1577058396.on(("data"), (HEX3Aanonymous_1577058446)); + conn_1577058395 = c_1577058444; + conn_1577058395.on(("data"), (HEX3Aanonymous_1577058445)); } -function HEX3Aanonymous_1577058485() { +function HEX3Aanonymous_1577058484() { rawEcho([68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84]); - peer_1577058395.id = ("9e4ada91-c493-4fd4-881d-3e05db99e100" + toJSStr(HEX24_385875976(roomId_1577058394))); - peer_1577058395.reconnect(); + peer_1577058394.id = ("9e4ada91-c493-4fd4-881d-3e05db99e100" + toJSStr(HEX24_385875976(roomId_1577058393))); + peer_1577058394.reconnect(); } -function HEX3Aanonymous_1577058519() { - peer_1577058395.destroy(); +function HEX3Aanonymous_1577058518() { + peer_1577058394.destroy(); } -function HEX3Aanonymous_1577058524(data_1577058525) { - conn_1577058396.send((data_1577058525)); +function HEX3Aanonymous_1577058523(data_1577058524) { + conn_1577058395.send((data_1577058524)); } - var result_1577058361 = {Field0: null, Field1: null}; + var result_1577058360 = {Field0: null, Field1: null}; randomize_1644167466(); - var roomId_1577058394 = rand_1577058371(HEX2EHEX2E_1174405168(10000, 99999)); - var peer_1577058395 = new Peer(("9e4ada91-c493-4fd4-881d-3e05db99e100" + toJSStr(HEX24_385875976(roomId_1577058394))), {config: { + var roomId_1577058393 = rand_1577058370(HEX2EHEX2E_1174405168(10000, 99999)); + var peer_1577058394 = new Peer(("9e4ada91-c493-4fd4-881d-3e05db99e100" + toJSStr(HEX24_385875976(roomId_1577058393))), {config: { iceServers: [ { urls: "turn:standard.relay.metered.ca:80", @@ -10255,26 +10953,15 @@ function HEX3Aanonymous_1577058524(data_1577058525) { } }) ; - var conn_1577058396 = null; - peer_1577058395.on(("open"), (HEX3Aanonymous_1577058415)); - peer_1577058395.on(("connection"), (HEX3Aanonymous_1577058444)); - peer_1577058395.on(("disconnect"), (HEX3Aanonymous_1577058485)); - result_1577058361.Field1 = HEX3Aanonymous_1577058519; - result_1577058361.Field0 = HEX3Aanonymous_1577058524; - - return result_1577058361; - -} + var conn_1577058395 = null; + peer_1577058394.on(("open"), (HEX3Aanonymous_1577058414)); + peer_1577058394.on(("connection"), (HEX3Aanonymous_1577058443)); + peer_1577058394.on(("disconnect"), (HEX3Aanonymous_1577058484)); + result_1577058360.Field1 = HEX3Aanonymous_1577058518; + result_1577058360.Field0 = HEX3Aanonymous_1577058523; -function initGame_553648271() { - theBoard_553648213[0] = nimCopy(theBoard_553648213[0], startingBoard_1493172483(), NTI1476395015); - myDrafts_553648201[0] = nimCopy(null, [], NTI1728053719); - opponentDrafts_553648206[0] = nimCopy(null, [], NTI1728053719); - lastMove_553648231[0] = nimCopy(null, [], NTI1509949645); - piecesChecking_553648236[0] = nimCopy(null, [], NTI1509949645); - turnNumber_553648237[0] = 0; + return result_1577058360; - } function substrEq_889192703(s_889192704, pos_889192705, substr_889192706) { @@ -10318,32 +11005,32 @@ function nsuSplitString(s_889193023, sep_889193024, maxsplit_889193025) { Temporary2 = (sep_889193024).length; } - var sepLen_553649805 = Temporary2; - var lastHEX60gensym41_553649806 = 0; - var splitsHEX60gensym41_553649807 = maxsplit_889193025; + var sepLen_553652680 = Temporary2; + var lastHEX60gensym41_553652681 = 0; + var splitsHEX60gensym41_553652682 = maxsplit_889193025; Label3: { Label4: while (true) { - if (!(lastHEX60gensym41_553649806 <= (s_889193023).length)) break Label4; - var firstHEX60gensym41_553649809 = lastHEX60gensym41_553649806; + if (!(lastHEX60gensym41_553652681 <= (s_889193023).length)) break Label4; + var firstHEX60gensym41_553652684 = lastHEX60gensym41_553652681; Label5: { Label6: while (true) { - if (!((lastHEX60gensym41_553649806 < (s_889193023).length) && !(substrEq_889192703(s_889193023, lastHEX60gensym41_553649806, sep_889193024)))) break Label6; - lastHEX60gensym41_553649806 = addInt(lastHEX60gensym41_553649806, 1); + if (!((lastHEX60gensym41_553652681 < (s_889193023).length) && !(substrEq_889192703(s_889193023, lastHEX60gensym41_553652681, sep_889193024)))) break Label6; + lastHEX60gensym41_553652681 = addInt(lastHEX60gensym41_553652681, 1); } }; - if ((splitsHEX60gensym41_553649807 == 0)) { - lastHEX60gensym41_553649806 = (s_889193023).length; + if ((splitsHEX60gensym41_553652682 == 0)) { + lastHEX60gensym41_553652681 = (s_889193023).length; } - xHEX60gensym69_889193032 = substr_33558084(s_889193023, firstHEX60gensym41_553649809, subInt(lastHEX60gensym41_553649806, 1)); + xHEX60gensym69_889193032 = substr_33558084(s_889193023, firstHEX60gensym41_553652684, subInt(lastHEX60gensym41_553652681, 1)); var Temporary7 = nimCopy(null, xHEX60gensym69_889193032, NTI33554449); result_889193026.push(Temporary7);; - if ((splitsHEX60gensym41_553649807 == 0)) { + if ((splitsHEX60gensym41_553652682 == 0)) { break Label3; } - splitsHEX60gensym41_553649807 = subInt(splitsHEX60gensym41_553649807, 1); - lastHEX60gensym41_553649806 = addInt(lastHEX60gensym41_553649806, sepLen_553649805); + splitsHEX60gensym41_553652682 = subInt(splitsHEX60gensym41_553652682, 1); + lastHEX60gensym41_553652681 = addInt(lastHEX60gensym41_553652681, sepLen_553652680); } }; }; @@ -10470,238 +11157,194 @@ function nsuParseInt(s_889193305) { } -function addQuoted_889193861(s_889193863, s_889193863_Idx, x_889193864) { - addInt_301990129(s_889193863, s_889193863_Idx, x_889193864); +function hasWallet_1828716548(side_1828716549, s_1828716550) { + var result_1828716551 = false; + + BeforeRet: { + result_1828716551 = isSome_1660947689(s_1828716550.Field1[chckIndx(side_1828716549, 0, (s_1828716550.Field1).length - 1)].wallet); + break BeforeRet; + }; + + return result_1828716551; - } -function HEX24_553648396(x_553648398) { - var result_553648399 = [[]]; +function pieceOf_553648336(tile_553648337) { + var result_553648338 = null; + + result_553648338 = theBoard_553648247[0][chckIndx(tile_553648337.Field1, 0, (theBoard_553648247[0]).length - 1)][chckIndx(tile_553648337.Field0, 0, (theBoard_553648247[0][chckIndx(tile_553648337.Field1, 0, (theBoard_553648247[0]).length - 1)]).length - 1)]; + + return result_553648338; - result_553648399[0] = nimCopy(null, [40], NTI33554449); - var countHEX60gensym8_553648410 = 0; - if ((0 < countHEX60gensym8_553648410)) { - result_553648399[0].push.apply(result_553648399[0], [44,32]);; +} + +function buy_1828716652(piece_1828716653, option_1828716654, b_1828716655, s_1828716656) { + if (!(hasWallet_1828716548(piece_1828716653.color, s_1828716656))) { + failedAssertImpl_268435541([99,97,112,105,116,97,108,105,115,109,46,110,105,109,40,50,52,44,32,53,41,32,96,112,105,101,99,101,46,99,111,108,111,114,46,104,97,115,87,97,108,108,101,116,40,115,41,96,32]); } - result_553648399[0].push.apply(result_553648399[0], [102,105,108,101]);; - result_553648399[0].push.apply(result_553648399[0], [58,32]);; - countHEX60gensym8_553648410 += 1; - addQuoted_889193861(result_553648399, 0, x_553648398["Field0"]); - if ((0 < countHEX60gensym8_553648410)) { - result_553648399[0].push.apply(result_553648399[0], [44,32]);; + if (!(option_1828716654.Field3(piece_1828716653, b_1828716655, s_1828716656))) { + failedAssertImpl_268435541([99,97,112,105,116,97,108,105,115,109,46,110,105,109,40,50,53,44,32,53,41,32,96,111,112,116,105,111,110,46,99,111,110,100,105,116,105,111,110,40,112,105,101,99,101,44,32,98,44,32,115,41,96,32]); + } + + if ((option_1828716654.Field1(piece_1828716653, b_1828716655, s_1828716656) <= getMoney_1828716559(piece_1828716653.color, s_1828716656))) { + addMoney_1828716586(piece_1828716653.color, negInt(option_1828716654.Field1(piece_1828716653, b_1828716655, s_1828716656)), s_1828716656); + option_1828716654.Field2(piece_1828716653, b_1828716655, s_1828716656); } - result_553648399[0].push.apply(result_553648399[0], [114,97,110,107]);; - result_553648399[0].push.apply(result_553648399[0], [58,32]);; - countHEX60gensym8_553648410 += 1; - addQuoted_889193861(result_553648399, 0, x_553648398["Field1"]); - result_553648399[0].push.apply(result_553648399[0], [41]);; - - return result_553648399[0]; + } -function pieceOf_553648248(tile_553648249) { - var result_553648250 = null; - - result_553648250 = theBoard_553648213[0][chckIndx(tile_553648249.Field1, 0, (theBoard_553648213[0]).length - 1)][chckIndx(tile_553648249.Field0, 0, (theBoard_553648213[0][chckIndx(tile_553648249.Field1, 0, (theBoard_553648213[0]).length - 1)]).length - 1)]; - - return result_553648250; +function otherBuy_553649693(d_553649694) { + var data_553649695 = nsuSplitString(d_553649694, [44], (-1)); + if (!(eqStrings(data_553649695[chckIndx(0, 0, (data_553649695).length - 1)], [98,117,121]))) { + failedAssertImpl_268435541([109,97,105,110,46,110,105,109,40,50,50,57,44,32,53,41,32,96,100,97,116,97,91,48,93,32,61,61,32,34,98,117,121,34,96,32]); + } + + var piece_553649701 = {Field0: nsuParseInt(data_553649695[chckIndx(3, 0, (data_553649695).length - 1)]), Field1: nsuParseInt(data_553649695[chckIndx(2, 0, (data_553649695).length - 1)])}; + if (!(hasWallet_1828716548(pieceOf_553648336(piece_553649701).color, theState_553648248[0]))) { + failedAssertImpl_268435541([109,97,105,110,46,110,105,109,40,50,51,49,44,32,53,41,32,96,112,105,101,99,101,79,102,40,112,105,101,99,101,41,46,99,111,108,111,114,46,104,97,115,87,97,108,108,101,116,40,116,104,101,83,116,97,116,101,41,96,32]); + } + + Label1: { + var option_553649729 = {Field0: [], Field1: null, Field2: null, Field3: null}; + var colontmp__553652690 = []; + colontmp__553652690 = theState_553648248[0].Field1[chckIndx(otherSide_1476396146(side_553648229[0]), 0, (theState_553648248[0].Field1).length - 1)].buys; + var i_553652692 = 0; + var L_553652693 = (colontmp__553652690).length; + Label2: { + Label3: while (true) { + if (!(i_553652692 < L_553652693)) break Label3; + option_553649729 = colontmp__553652690[chckIndx(i_553652692, 0, (colontmp__553652690).length - 1)]; + if (eqStrings(option_553649729.Field0, data_553649695[chckIndx(1, 0, (data_553649695).length - 1)])) { + buy_1828716652(pieceOf_553648336(piece_553649701), option_553649729, theBoard_553648247[0], theState_553648248[0]); + } + + i_553652692 += 1; + if (!(((colontmp__553652690).length == L_553652693))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + } -function getPiecesChecking_1476395748(b_1476395749, c_1476395750) { - var result_1476395751 = []; - - var kingTile_1476395752 = nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011); - Label1: { - var row_1476395757 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553649843 = 0; - Label2: { - Label3: while (true) { - if (!true) break Label3; - row_1476395757 = nimCopy(row_1476395757, b_1476395749[chckIndx(i_553649843, 0, (b_1476395749).length - 1)], NTI1476395014); - Label4: { - var p_1476395762 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649840 = 0; - Label5: { - Label6: while (true) { - if (!true) break Label6; - p_1476395762 = nimCopy(p_1476395762, row_1476395757[chckIndx(i_553649840, 0, (row_1476395757).length - 1)], NTI1476395026); - if (((p_1476395762.item == 0) && isColor_1476395605(p_1476395762, c_1476395750))) { - kingTile_1476395752 = nimCopy(kingTile_1476395752, p_1476395762.tile, NTI1476395011); - } - - if ((7 <= i_553649840)) { - break Label5; - } - - i_553649840 += 1; - } - }; - }; - if ((7 <= i_553649843)) { - break Label2; - } - - i_553649843 += 1; - } - }; - }; - Label7: { - var row_1476395771 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553649849 = 0; - Label8: { - Label9: while (true) { - if (!true) break Label9; - row_1476395771 = nimCopy(row_1476395771, b_1476395749[chckIndx(i_553649849, 0, (b_1476395749).length - 1)], NTI1476395014); - Label10: { - var p_1476395776 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649847 = 0; - Label11: { - Label12: while (true) { - if (!true) break Label12; - p_1476395776 = nimCopy(p_1476395776, row_1476395771[chckIndx(i_553649847, 0, (row_1476395771).length - 1)], NTI1476395026); - if ((!(isColor_1476395605(p_1476395776, c_1476395750)) && contains_1476395777(getTakesOn_1476395283(p_1476395776, b_1476395749), kingTile_1476395752))) { - var Temporary13 = nimCopy(null, p_1476395776.tile, NTI1476395011); - result_1476395751.push(Temporary13);; - } - - if ((7 <= i_553649847)) { - break Label11; - } - - i_553649847 += 1; - } - }; - }; - if ((7 <= i_553649849)) { - break Label8; - } - - i_553649849 += 1; - } - }; - }; - - return result_1476395751; - -} - -function gameIsOver_1476395725(b_1476395726) { - var result_1476395727 = false; +function gameIsOver_1476396229(b_1476396230) { + var result_1476396231 = false; BeforeRet: { - var kings_1476395728 = 0; + var kings_1476396232 = 0; Label1: { - var row_1476395733 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553649855 = 0; + var row_1476396237 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_553652733 = 0; Label2: { Label3: while (true) { if (!true) break Label3; - row_1476395733 = nimCopy(row_1476395733, b_1476395726[chckIndx(i_553649855, 0, (b_1476395726).length - 1)], NTI1476395014); + row_1476396237 = nimCopy(row_1476396237, b_1476396230[chckIndx(i_553652733, 0, (b_1476396230).length - 1)], NTI1476395012); Label4: { - var p_1476395738 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649853 = 0; + var p_1476396242 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_553652731 = 0; Label5: { Label6: while (true) { if (!true) break Label6; - p_1476395738 = nimCopy(p_1476395738, row_1476395733[chckIndx(i_553649853, 0, (row_1476395733).length - 1)], NTI1476395026); - if ((p_1476395738.item == 0)) { - kings_1476395728 = addInt(kings_1476395728, 1); + p_1476396242 = nimCopy(p_1476396242, row_1476396237[chckIndx(i_553652731, 0, (row_1476396237).length - 1)], NTI1476395032); + if ((p_1476396242.item == 0)) { + kings_1476396232 = addInt(kings_1476396232, 1); } - if ((7 <= i_553649853)) { + if ((7 <= i_553652731)) { break Label5; } - i_553649853 += 1; + i_553652731 += 1; } }; }; - if ((7 <= i_553649855)) { + if ((7 <= i_553652733)) { break Label2; } - i_553649855 += 1; + i_553652733 += 1; } }; }; - result_1476395727 = !((kings_1476395728 == 2)); + result_1476396231 = !((kings_1476396232 == 2)); break BeforeRet; }; - return result_1476395727; + return result_1476396231; } -function alive_1476395633(c_1476395634, b_1476395635) { - var result_1476395636 = false; +function alive_1476396153(c_1476396154, b_1476396155) { + var result_1476396156 = false; BeforeRet: { Label1: { - var row_1476395662 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553649861 = 0; + var row_1476396182 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_553652739 = 0; Label2: { Label3: while (true) { if (!true) break Label3; - row_1476395662 = nimCopy(row_1476395662, b_1476395635[chckIndx(i_553649861, 0, (b_1476395635).length - 1)], NTI1476395014); + row_1476396182 = nimCopy(row_1476396182, b_1476396155[chckIndx(i_553652739, 0, (b_1476396155).length - 1)], NTI1476395012); Label4: { - var p_1476395688 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649859 = 0; + var p_1476396208 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_553652737 = 0; Label5: { Label6: while (true) { if (!true) break Label6; - p_1476395688 = nimCopy(p_1476395688, row_1476395662[chckIndx(i_553649859, 0, (row_1476395662).length - 1)], NTI1476395026); - if (((p_1476395688.item == 0) && isColor_1476395605(p_1476395688, c_1476395634))) { - result_1476395636 = true; + p_1476396208 = nimCopy(p_1476396208, row_1476396182[chckIndx(i_553652737, 0, (row_1476396182).length - 1)], NTI1476395032); + if (((p_1476396208.item == 0) && isColor_1476396138(p_1476396208, c_1476396154))) { + result_1476396156 = true; break BeforeRet; } - if ((7 <= i_553649859)) { + if ((7 <= i_553652737)) { break Label5; } - i_553649859 += 1; + i_553652737 += 1; } }; }; - if ((7 <= i_553649861)) { + if ((7 <= i_553652739)) { break Label2; } - i_553649861 += 1; + i_553652739 += 1; } }; }; - result_1476395636 = false; + result_1476396156 = false; break BeforeRet; }; - return result_1476395636; + return result_1476396156; } -function addWins_1845493774(with_1845493775) { +function addWins_1879048206(with_1879048207) { Label1: { - var power_1845493779 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649864 = 0; - var L_553649865 = (with_1845493775).length; + var power_1879048211 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652742 = 0; + var L_553652743 = (with_1879048207).length; Label2: { Label3: while (true) { - if (!(i_553649864 < L_553649865)) break Label3; - power_1845493779 = with_1845493775[chckIndx(i_553649864, 0, (with_1845493775).length - 1)]; - if (!(window.localStorage.getItem(toJSStr(power_1845493779.technicalName)) !== null)) { - window.localStorage.setItem(toJSStr(power_1845493779.technicalName), 0); + if (!(i_553652742 < L_553652743)) break Label3; + power_1879048211 = with_1879048207[chckIndx(i_553652742, 0, (with_1879048207).length - 1)]; + if (!(window.localStorage.getItem(toJSStr(power_1879048211.technicalName)) !== null)) { + window.localStorage.setItem(toJSStr(power_1879048211.technicalName), 0); } else { - increment(toJSStr(power_1845493779.technicalName)); + increment(toJSStr(power_1879048211.technicalName)); } - i_553649864 += 1; - if (!(((with_1845493775).length == L_553649865))) { + i_553652742 += 1; + if (!(((with_1879048207).length == L_553652743))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } @@ -10712,2473 +11355,4802 @@ function addWins_1845493774(with_1845493775) { } -function endRound_553648304() { - Label1: { - var i_553648305 = 0; - var j_553648306 = 0; - Label2: { - var i_553649821 = 0; - var i_553649822 = 0; - Label3: { - Label4: while (true) { - if (!(i_553649822 < 8)) break Label4; - i_553649821 = i_553649822; - Label5: { - var j_553649825 = 0; - var i_553649826 = 0; - Label6: { - Label7: while (true) { - if (!(i_553649826 < 8)) break Label7; - j_553649825 = i_553649826; - i_553648305 = i_553649821; - j_553648306 = j_553649825; - Label8: { - var pHEX60gensym0_553648311 = null; - var colontmp__553649816 = []; - colontmp__553649816 = theBoard_553648213[0][chckIndx(i_553648305, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648306, 0, (theBoard_553648213[0][chckIndx(i_553648305, 0, (theBoard_553648213[0]).length - 1)]).length - 1)].onEndTurn; - var i_553649817 = 0; - var L_553649818 = (colontmp__553649816).length; - Label9: { - Label10: while (true) { - if (!(i_553649817 < L_553649818)) break Label10; - pHEX60gensym0_553648311 = colontmp__553649816[chckIndx(i_553649817, 0, (colontmp__553649816).length - 1)]; - pHEX60gensym0_553648311(theBoard_553648213[0][chckIndx(i_553648305, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648306, 0, (theBoard_553648213[0][chckIndx(i_553648305, 0, (theBoard_553648213[0]).length - 1)]).length - 1)], theBoard_553648213[0]); - i_553649817 += 1; - if (!(((colontmp__553649816).length == L_553649818))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; - i_553649826 = addInt(i_553649826, 1); - } - }; - }; - i_553649822 = addInt(i_553649822, 1); - } - }; - }; - }; - Label11: { - var i_553648312 = 0; - var j_553648313 = 0; - Label12: { - var i_553649830 = 0; - var i_553649831 = 0; - Label13: { - Label14: while (true) { - if (!(i_553649831 < 8)) break Label14; - i_553649830 = i_553649831; - Label15: { - var j_553649834 = 0; - var i_553649835 = 0; - Label16: { - Label17: while (true) { - if (!(i_553649835 < 8)) break Label17; - j_553649834 = i_553649835; - i_553648312 = i_553649830; - j_553648313 = j_553649834; - theBoard_553648213[0][chckIndx(i_553648312, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648313, 0, (theBoard_553648213[0][chckIndx(i_553648312, 0, (theBoard_553648213[0]).length - 1)]).length - 1)].rand.Field0 = false; - i_553649835 = addInt(i_553649835, 1); - } - }; - }; - i_553649831 = addInt(i_553649831, 1); - } - }; - }; - }; - piecesChecking_553648236[0] = nimCopy(null, getPiecesChecking_1476395748(theBoard_553648213[0], side_553648195[0]), NTI1476395458); - if (gameIsOver_1476395725(theBoard_553648213[0])) { - if (alive_1476395633(side_553648195[0], theBoard_553648213[0])) { - addWins_1845493774(myDrafts_553648201[0]); - } - - currentScreen_553648240[0] = 6; - } - - - -} - -function otherMove_553648332(d_553648333) { - var data_553648334 = nsuSplitString(d_553648333, [44], (-1)); - var mover_553648335 = nimCopy(null, {Field0: nsuParseInt(data_553648334[chckIndx(2, 0, (data_553648334).length - 1)]), Field1: nsuParseInt(data_553648334[chckIndx(1, 0, (data_553648334).length - 1)])}, NTI1476395011); - var moveTo_553648336 = nimCopy(null, {Field0: nsuParseInt(data_553648334[chckIndx(4, 0, (data_553648334).length - 1)]), Field1: nsuParseInt(data_553648334[chckIndx(3, 0, (data_553648334).length - 1)])}, NTI1476395011); - lastMove_553648231[0] = nimCopy(null, [nimCopy(null, mover_553648335, NTI1476395011), nimCopy(null, moveTo_553648336, NTI1476395011)], NTI553648295); - possibleMoves_553648221[0] = nimCopy(null, [], NTI1509949645); - possibleTakes_553648226[0] = nimCopy(null, [], NTI1509949645); - turnNumber_553648237[0] = addInt(turnNumber_553648237[0], 1); - rawEcho(d_553648333, data_553648334[chckIndx(0, 0, (data_553648334).length - 1)], HEX24_553648396(mover_553648335), HEX24_553648396(moveTo_553648336)); - if (eqStrings(data_553648334[chckIndx(0, 0, (data_553648334).length - 1)], [109,111,118,101])) { - pieceOf_553648248(mover_553648335).onMove(pieceOf_553648248(mover_553648335), moveTo_553648336, theBoard_553648213[0]); - } - else { - if (eqStrings(data_553648334[chckIndx(0, 0, (data_553648334).length - 1)], [116,97,107,101])) { - pieceOf_553648248(mover_553648335).onTake(pieceOf_553648248(mover_553648335), moveTo_553648336, theBoard_553648213[0]); - } - } - turn_553648196[0] = !(turn_553648196[0]); - endRound_553648304(); - - -} - -function hasWallet_1476395847(side_1476395848, b_1476395849) { - var result_1476395850 = false; +function find_553649027(a_553649030, item_553649031) { + var result_553649032 = 0; BeforeRet: { + result_553649032 = 0; Label1: { - var i_1476395851 = 0; - var j_1476395852 = 0; + var i_553649036 = 0; + var i_553652746 = 0; Label2: { - var i_553649875 = 0; - var i_553649876 = 0; - Label3: { - Label4: while (true) { - if (!(i_553649876 < 8)) break Label4; - i_553649875 = i_553649876; - Label5: { - var j_553649879 = 0; - var i_553649880 = 0; - Label6: { - Label7: while (true) { - if (!(i_553649880 < 8)) break Label7; - j_553649879 = i_553649880; - i_1476395851 = i_553649875; - j_1476395852 = j_553649879; - if (((isColor_1476395605(b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)][chckIndx(j_1476395852, 0, (b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)]).length - 1)], side_1476395848) && (b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)][chckIndx(j_1476395852, 0, (b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)]).length - 1)].item == 0)) && !((b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)][chckIndx(j_1476395852, 0, (b_1476395849[chckIndx(i_1476395851, 0, (b_1476395849).length - 1)]).length - 1)].wallet.Field0 == (-1))))) { - result_1476395850 = true; - break BeforeRet; - } - - i_553649880 = addInt(i_553649880, 1); - } - }; - }; - i_553649876 = addInt(i_553649876, 1); + Label3: while (true) { + if (!(i_553652746 < (a_553649030).length)) break Label3; + i_553649036 = a_553649030[chckIndx(i_553652746, 0, (a_553649030).length - 1)]; + if ((i_553649036 == item_553649031)) { + break BeforeRet; } - }; + + result_553649032 = addInt(result_553649032, 1); + i_553652746 += 1; + } }; }; + result_553649032 = (-1); }; - return result_1476395850; + return result_553649032; } -function HEX24_1476395620(p_1476395621) { - var result_1476395622 = []; +function contains_553649022(a_553649024, item_553649025) { + var result_553649026 = false; BeforeRet: { - if ((p_1476395621.item == 6)) { - result_1476395622 = nimCopy(null, [], NTI33554449); + result_553649026 = (0 <= find_553649027(a_553649024, item_553649025)); break BeforeRet; - } - else { - result_1476395622 = nimCopy(null, (reprEnum(p_1476395621.color, NTI1476395017) || []).concat(reprEnum(p_1476395621.item, NTI1476395016) || []), NTI33554449); - break BeforeRet; - } - }; - return result_1476395622; + return result_553649026; } -function getWallet_1476395857(side_1476395858, b_1476395859) { - var result_1476395860 = 0; +function validateUtf8_1157628240(s_1157628241) { + var result_1157628242 = 0; BeforeRet: { + var i_1157628243 = 0; + var L_1157628247 = (s_1157628241).length; Label1: { - var i_1476395861 = 0; - var j_1476395862 = 0; - Label2: { - var i_553649893 = 0; - var i_553649894 = 0; - Label3: { - Label4: while (true) { - if (!(i_553649894 < 8)) break Label4; - i_553649893 = i_553649894; - Label5: { - var j_553649897 = 0; - var i_553649898 = 0; - Label6: { - Label7: while (true) { - if (!(i_553649898 < 8)) break Label7; - j_553649897 = i_553649898; - i_1476395861 = i_553649893; - j_1476395862 = j_553649897; - if ((isColor_1476395605(b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)][chckIndx(j_1476395862, 0, (b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)]).length - 1)], side_1476395858) && (b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)][chckIndx(j_1476395862, 0, (b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)]).length - 1)].item == 0))) { - result_1476395860 = b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)][chckIndx(j_1476395862, 0, (b_1476395859[chckIndx(i_1476395861, 0, (b_1476395859).length - 1)]).length - 1)].wallet.Field0; - break BeforeRet; - } - - i_553649898 = addInt(i_553649898, 1); - } - }; - }; - i_553649894 = addInt(i_553649894, 1); - } - }; - }; + Label2: while (true) { + if (!(i_1157628243 < L_1157628247)) break Label2; + if ((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] <= 127)) { + i_1157628243 = addInt(i_1157628243, 1); + } + else { + if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 5) == 6)) { + if ((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] < 194)) { + result_1157628242 = i_1157628243; + break BeforeRet; + } + + if (((addInt(i_1157628243, 1) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { + i_1157628243 = addInt(i_1157628243, 2); + } + else { + result_1157628242 = i_1157628243; + break BeforeRet; + } + + } + else { + if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 4) == 14)) { + if ((((addInt(i_1157628243, 2) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 2), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { + i_1157628243 = addInt(i_1157628243, 3); + } + else { + result_1157628242 = i_1157628243; + break BeforeRet; + } + + } + else { + if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 3) == 30)) { + if (((((addInt(i_1157628243, 3) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 2), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 3), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { + i_1157628243 = addInt(i_1157628243, 4); + } + else { + result_1157628242 = i_1157628243; + break BeforeRet; + } + + } + else { + result_1157628242 = i_1157628243; + break BeforeRet; + } + }}} + } }; + result_1157628242 = (-1); + break BeforeRet; }; - return result_1476395860; + return result_1157628242; } -function buy_1476395867(piece_1476395868, option_1476395869, board_1476395870) { - rawEcho(HEX24_1476395620(piece_1476395868), option_1476395869.Field0, HEX24_385875976(getWallet_1476395857(piece_1476395868.color, board_1476395870))); - Label1: { - var i_1476395871 = 0; - var j_1476395872 = 0; - Label2: { - var i_553649884 = 0; - var i_553649885 = 0; - Label3: { - Label4: while (true) { - if (!(i_553649885 < 8)) break Label4; - i_553649884 = i_553649885; - Label5: { - var j_553649888 = 0; - var i_553649889 = 0; - Label6: { - Label7: while (true) { - if (!(i_553649889 < 8)) break Label7; - j_553649888 = i_553649889; - i_1476395871 = i_553649884; - j_1476395872 = j_553649888; - if (((board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)][chckIndx(j_1476395872, 0, (board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)]).length - 1)].item == 0) && sameColor_1476395596(board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)][chckIndx(j_1476395872, 0, (board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)]).length - 1)], piece_1476395868))) { - if ((option_1476395869.Field1 <= board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)][chckIndx(j_1476395872, 0, (board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)]).length - 1)].wallet.Field0)) { - board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)][chckIndx(j_1476395872, 0, (board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)]).length - 1)].wallet.Field0 = subInt(board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)][chckIndx(j_1476395872, 0, (board_1476395870[chckIndx(i_1476395871, 0, (board_1476395870).length - 1)]).length - 1)].wallet.Field0, option_1476395869.Field1); - option_1476395869.Field2(piece_1476395868, board_1476395870); - } - - } - - i_553649889 = addInt(i_553649889, 1); - } - }; - }; - i_553649885 = addInt(i_553649885, 1); - } - }; - }; - }; +function validateUtf8_1157635265(s_1157635266) { + var result_1157635267 = 0; - -} + result_1157635267 = validateUtf8_1157628240((s_1157635266.slice(0, (s_1157635266).length - 1 + 1))); -function otherBuy_553648496(d_553648497) { - var data_553648498 = nsuSplitString(d_553648497, [44], (-1)); - var piece_553648499 = {Field0: nsuParseInt(data_553648498[chckIndx(2, 0, (data_553648498).length - 1)]), Field1: nsuParseInt(data_553648498[chckIndx(1, 0, (data_553648498).length - 1)])}; - if (!(hasWallet_1476395847(pieceOf_553648248(piece_553648499).color, theBoard_553648213[0]))) { - failedAssertImpl_268435541([109,97,105,110,46,110,105,109,40,49,53,56,44,32,53,41,32,96,112,105,101,99,101,79,102,40,112,105,101,99,101,41,46,99,111,108,111,114,46,104,97,115,87,97,108,108,101,116,40,116,104,101,66,111,97,114,100,41,96,32]); - } - - Label1: { - var option_553648527 = {Field0: [], Field1: 0, Field2: null, Field3: null}; - var colontmp__553649868 = []; - colontmp__553649868 = pieceOf_553648248(piece_553648499).wallet.Field1; - var i_553649870 = 0; - var L_553649871 = (colontmp__553649868).length; - Label2: { - Label3: while (true) { - if (!(i_553649870 < L_553649871)) break Label3; - option_553648527 = colontmp__553649868[chckIndx(i_553649870, 0, (colontmp__553649868).length - 1)]; - if (eqStrings(option_553648527.Field0, data_553648498[chckIndx(0, 0, (data_553648498).length - 1)])) { - buy_1476395867(pieceOf_553648248(piece_553648499), option_553648527, theBoard_553648213[0]); - } - - i_553649870 += 1; - if (!(((colontmp__553649868).length == L_553649871))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; - }; + return result_1157635267; - } -function hostLogic_553648663(d_553648664, m_553648665) { - rawEcho(reprEnum(m_553648665, NTI1577058309), [32,111,102,32], d_553648664, [10]); - switch (m_553648665) { - case 0: - var colontmp__553649791 = true; - var colontmp__553649792 = toJSStr(d_553648664); - roomId_553648188[0] = nimCopy(roomId_553648188[0], {Field0: colontmp__553649791, Field1: colontmp__553649792}, NTI553648153); - side_553648195[0] = 1; - break; - case 1: - peer_553648194[0].Field0("options:deciding"); - currentScreen_553648240[0] = 4; - initGame_553648271(); - draftTier_553648211[0] = randomTier_1728054060({Field0: 50, Field1: 36, Field2: 12, Field3: 2}); - break; - case 4: - var x_553648669 = nsuSplitString(d_553648664, [44], (-1)); - if (eqStrings(x_553648669[chckIndx(0, 0, (x_553648669).length - 1)], [109,121])) { - turn_553648196[0] = true; - var Temporary1 = nimCopy(null, powers_1728053317[0][chckIndx(nsuParseInt(x_553648669[chckIndx(1, 0, (x_553648669).length - 1)]), 0, (powers_1728053317[0]).length - 1)], NTI1728053253); - opponentDrafts_553648206[0].push(Temporary1);; - if ((1 <= draftsLeft_553648210[0])) { - draftsLeft_553648210[0] = subInt(draftsLeft_553648210[0], 1); - draftTier_553648211[0] = randomTier_1728054060({Field0: 50, Field1: 36, Field2: 12, Field3: 2}); - draft_553648589(HEX26_1728054098(myDrafts_553648201[0], opponentDrafts_553648206[0]), myDrafts_553648201[0]); - } - else { - executeOn_1728054240(myDrafts_553648201[0], 1, side_553648195[0], theBoard_553648213[0]); - executeOn_1728054240(opponentDrafts_553648206[0], 0, side_553648195[0], theBoard_553648213[0]); - Label2: { - var i_553648683 = 0; - var j_553648684 = 0; - Label3: { - var i_553649795 = 0; - var i_553649796 = 0; - Label4: { - Label5: while (true) { - if (!(i_553649796 < 8)) break Label5; - i_553649795 = i_553649796; - Label6: { - var j_553649799 = 0; - var i_553649800 = 0; - Label7: { - Label8: while (true) { - if (!(i_553649800 < 8)) break Label8; - j_553649799 = i_553649800; - i_553648683 = i_553649795; - j_553648684 = j_553649799; - theBoard_553648213[0][chckIndx(i_553648683, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648684, 0, (theBoard_553648213[0][chckIndx(i_553648683, 0, (theBoard_553648213[0]).length - 1)]).length - 1)].rand.Field1 = parseInt(roomId_553648188[0].Field1, 10); - i_553649800 = addInt(i_553649800, 1); - } - }; - }; - i_553649796 = addInt(i_553649796, 1); - } - }; - }; - }; - peer_553648194[0].Field0("handshake:gamestart"); - currentScreen_553648240[0] = 3; - } - - } - - break; - case 2: - otherMove_553648332(d_553648664); - break; - case 7: - otherBuy_553648496(d_553648664); - break; - case 5: - if ((eqStrings(d_553648664, [100,105,115,99,111,110,110]) || eqStrings(d_553648664, [101,120,105,116]))) { - currentScreen_553648240[0] = 8; +function nucruneLen(s_1157627932) { + var result_1157627933 = 0; + + result_1157627933 = 0; + var i_1157627934 = 0; + Label1: { + Label2: while (true) { + if (!(i_1157627934 < (s_1157627932).length)) break Label2; + if ((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] <= 127)) { + i_1157627934 = addInt(i_1157627934, 1); + } + else { + if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 5) == 6)) { + i_1157627934 = addInt(i_1157627934, 2); + } + else { + if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 4) == 14)) { + i_1157627934 = addInt(i_1157627934, 3); + } + else { + if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 3) == 30)) { + i_1157627934 = addInt(i_1157627934, 4); + } + else { + if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 2) == 62)) { + i_1157627934 = addInt(i_1157627934, 5); + } + else { + if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 1) == 126)) { + i_1157627934 = addInt(i_1157627934, 6); + } + else { + i_1157627934 = addInt(i_1157627934, 1); + } + }}}}} + result_1157627933 = addInt(result_1157627933, 1); + } + }; + + return result_1157627933; + +} + +function runeLen_1157635093(s_1157635094) { + var result_1157635095 = 0; + + result_1157635095 = nucruneLen((s_1157635094.slice(0, (s_1157635094).length - 1 + 1))); + + return result_1157635095; + +} + +function nsuRepeatChar(c_889193569, count_889193570) { + var result_889193571 = []; + + result_889193571 = nimCopy(null, mnewString(count_889193570), NTI33554449); + Label1: { + var i_889193576 = 0; + var colontmp__553652751 = 0; + colontmp__553652751 = subInt(count_889193570, 1); + var res_553652752 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652752 <= colontmp__553652751)) break Label3; + i_889193576 = res_553652752; + result_889193571[chckIndx(i_889193576, 0, (result_889193571).length - 1)] = c_889193569; + res_553652752 = addInt(res_553652752, 1); + } + }; + }; + + return result_889193571; + +} + +function alignString_1912602644(s_1912602645, minimumWidth_1912602646, align_1912602647, fill_1912602648) { + var Temporary1; + + var result_1912602649 = []; + + if ((minimumWidth_1912602646 == 0)) { + result_1912602649 = nimCopy(null, s_1912602645, NTI33554449); + } + else { + if ((validateUtf8_1157635265(s_1912602645) == (-1))) { + Temporary1 = runeLen_1157635093(s_1912602645); } else { - peer_553648194[0].Field0("end:exit"); + Temporary1 = (s_1912602645).length; } - peer_553648194[0].Field1(); - roomId_553648188[0].Field0 = false; + var sRuneLen_1912602650 = Temporary1; + var toFill_1912602651 = subInt(minimumWidth_1912602646, sRuneLen_1912602650); + if ((toFill_1912602651 <= 0)) { + result_1912602649 = nimCopy(null, s_1912602645, NTI33554449); + } + else { + if (((align_1912602647 == 60) || (align_1912602647 == 0))) { + result_1912602649 = nimCopy(null, (s_1912602645 || []).concat(nsuRepeatChar(fill_1912602648, chckRange(toFill_1912602651, 0, 2147483647)) || []), NTI33554449); + } + else { + if ((align_1912602647 == 94)) { + var half_1912602652 = divInt(toFill_1912602651, 2); + result_1912602649 = nimCopy(null, (nsuRepeatChar(fill_1912602648, chckRange(half_1912602652, 0, 2147483647)) || []).concat(s_1912602645 || [],nsuRepeatChar(fill_1912602648, chckRange(subInt(toFill_1912602651, half_1912602652), 0, 2147483647)) || []), NTI33554449); + } + else { + result_1912602649 = nimCopy(null, (nsuRepeatChar(fill_1912602648, chckRange(toFill_1912602651, 0, 2147483647)) || []).concat(s_1912602645 || []), NTI33554449); + } + }} + } + + + return result_1912602649; + +} + +function formatValue_553649009(result_553649011, result_553649011_Idx, value_553649012) { + var value_553649021 = nimCopy(null, value_553649012, NTI33554449); + result_553649011[result_553649011_Idx].push.apply(result_553649011[result_553649011_Idx], alignString_1912602644(value_553649021, 0, 0, 32));; + + +} + +function addQuoted_553648456(s_553648458, s_553648458_Idx, x_553648459) { + s_553648458[s_553648458_Idx].push.apply(s_553648458[s_553648458_Idx], reprEnum(x_553648459, NTI1476395014));; + + +} + +function addQuoted_553648476(s_553648478, s_553648478_Idx, x_553648479) { + s_553648478[s_553648478_Idx].push.apply(s_553648478[s_553648478_Idx], reprEnum(x_553648479, NTI1476395015));; + + +} + +function addQuoted_553648532(s_553648534, s_553648534_Idx, x_553648535) { + s_553648534[s_553648534_Idx].push.apply(s_553648534[s_553648534_Idx], HEX24_1476395861(x_553648535));; + + +} + +function addQuoted_553648708(s_553648710, s_553648710_Idx, x_553648711) { + s_553648710[s_553648710_Idx].push.apply(s_553648710[s_553648710_Idx], nimBoolToStr(x_553648711));; + + +} + +function addEscapedChar_33558024(s_33558025, s_33558025_Idx, c_33558026) { + switch (c_33558026) { + case 7: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,97]);; + break; + case 8: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,98]);; + break; + case 9: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,116]);; + break; + case 10: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,110]);; + break; + case 11: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,118]);; + break; + case 12: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,102]);; + break; + case 13: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,114]);; + break; + case 27: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,101]);; + break; + case 92: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,92]);; + break; + case 39: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,39]);; + break; + case 34: + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,34]);; + break; + case 32: + case 33: + case 35: + case 36: + case 37: + case 38: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 91: + case 93: + case 94: + case 95: + case 96: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + addChar(s_33558025[s_33558025_Idx], c_33558026);; break; default: - rawEcho([117,110,105,109,112,108,101,109,101,110,116,101,100]); + s_33558025[s_33558025_Idx].push.apply(s_33558025[s_33558025_Idx], [92,120]);; + var n_33558036 = c_33558026; + addChar(s_33558025[s_33558025_Idx], [48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70][chckIndx(((n_33558036 & 240) >> 4), 0, ([48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70]).length - 1)]);; + addChar(s_33558025[s_33558025_Idx], [48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70][chckIndx((n_33558036 & 15), 0, ([48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70]).length - 1)]);; break; } - redraw_721421809(kxi__); } -function createLobby_553648959() { - -function HEX3Aanonymous_553648969(__553648970, __553648971) { - currentScreen_553648240[0] = 2; +function addQuoted_553648722(s_553648724, s_553648724_Idx, x_553648725) { + s_553648724[s_553648724_Idx].push.apply(s_553648724[s_553648724_Idx], [34]);; + Label1: { + var c_553648726 = 0; + var i_553652755 = 0; + var L_553652756 = (x_553648725).length; + Label2: { + Label3: while (true) { + if (!(i_553652755 < L_553652756)) break Label3; + c_553648726 = x_553648725[chckIndx(i_553652755, 0, (x_553648725).length - 1)]; + if ((c_553648726 <= 127)) { + addEscapedChar_33558024(s_553648724, s_553648724_Idx, c_553648726); + } + else { + addChar(s_553648724[s_553648724_Idx], c_553648726);; + } + + i_553652755 += 1; + if (!(((x_553648725).length == L_553652756))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(272, 11) `len(a) == L` the length of the string changed while iterating over it")); + } + + } + }; + }; + s_553648724[s_553648724_Idx].push.apply(s_553648724[s_553648724_Idx], [34]);; - + +} + +function addQuoted_553649000(s_553649002, s_553649002_Idx, x_553649003) { + s_553649002[s_553649002_Idx].push.apply(s_553649002[s_553649002_Idx], reprEnum(x_553649003, NTI1476395027));; + + +} + +function HEX24_553648944(x_553648946) { + var result_553648947 = [[]]; + + result_553648947[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym62_553648958 = 0; + if ((0 < countHEX60gensym62_553648958)) { + result_553648947[0].push.apply(result_553648947[0], [44,32]);; } -function HEX3Aanonymous_553648972(ev_553648973, __553648974) { - alert("Unimplemented"); + result_553648947[0].push.apply(result_553648947[0], [111,110]);; + result_553648947[0].push.apply(result_553648947[0], [58,32]);; + countHEX60gensym62_553648958 += 1; + addQuoted_553648532(result_553648947, 0, x_553648946["Field0"]); + if ((0 < countHEX60gensym62_553648958)) { + result_553648947[0].push.apply(result_553648947[0], [44,32]);; + } + + result_553648947[0].push.apply(result_553648947[0], [103,114,111,117,112]);; + result_553648947[0].push.apply(result_553648947[0], [58,32]);; + countHEX60gensym62_553648958 += 1; + addQuoted_889193861(result_553648947, 0, x_553648946["Field1"]); + if ((0 < countHEX60gensym62_553648958)) { + result_553648947[0].push.apply(result_553648947[0], [44,32]);; + } + + result_553648947[0].push.apply(result_553648947[0], [103,108,97,115,115]);; + result_553648947[0].push.apply(result_553648947[0], [58,32]);; + countHEX60gensym62_553648958 += 1; + addQuoted_553649000(result_553648947, 0, x_553648946["Field2"]); + result_553648947[0].push.apply(result_553648947[0], [41]);; - + return result_553648947[0]; + +} + +function addQuoted_553648938(s_553648940, s_553648940_Idx, x_553648941) { + s_553648940[s_553648940_Idx].push.apply(s_553648940[s_553648940_Idx], HEX24_553648944(x_553648941));; + + +} + +function collectionToString_553648905(x_553648907, prefix_553648908, separator_553648909, suffix_553648910) { + var result_553648911 = [[]]; + + result_553648911[0] = nimCopy(null, prefix_553648908, NTI33554449); + var firstElement_553648912 = true; + Label1: { + var value_553648934 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var i_553652760 = 0; + var L_553652761 = (x_553648907).length; + Label2: { + Label3: while (true) { + if (!(i_553652760 < L_553652761)) break Label3; + value_553648934 = x_553648907[i_553652760]; + if (firstElement_553648912) { + firstElement_553648912 = false; + } + else { + result_553648911[0].push.apply(result_553648911[0], separator_553648909);; + } + + addQuoted_553648938(result_553648911, 0, value_553648934); + i_553652760 += 1; + if (!(((x_553648907).length == L_553652761))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + result_553648911[0].push.apply(result_553648911[0], suffix_553648910);; + + return result_553648911[0]; + +} + +function HEX24_553648901(x_553648903) { + var result_553648904 = []; + + result_553648904 = nimCopy(null, collectionToString_553648905(x_553648903, [64,91], [44,32], [93]), NTI33554449); + + return result_553648904; + +} + +function addQuoted_553648895(s_553648897, s_553648897_Idx, x_553648898) { + s_553648897[s_553648897_Idx].push.apply(s_553648897[s_553648897_Idx], HEX24_553648901(x_553648898));; + + +} + +function HEX24_553648427(x_553648429) { + var result_553648430 = [[]]; + + result_553648430[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym4_553648441 = 0; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; } -function HEX3Aanonymous_553648975(ev_553648976, __553648977) { - if (!((peer_553648194[0].Field1 == null))) { - peer_553648194[0].Field1(); - } - - peer_553648194[0] = nimCopy(peer_553648194[0], newHost_1577058351(hostLogic_553648663), NTI553648155); - currentScreen_553648240[0] = 1; + result_553648430[0].push.apply(result_553648430[0], [105,116,101,109]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648456(result_553648430, 0, x_553648429.item); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [99,111,108,111,114]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648476(result_553648430, 0, x_553648429.color); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [105,110,100,101,120]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_889193861(result_553648430, 0, x_553648429.index); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [116,105,109,101,115,77,111,118,101,100]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_889193861(result_553648430, 0, x_553648429.timesMoved); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [112,105,101,99,101,115,84,97,107,101,110]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_889193861(result_553648430, 0, x_553648429.piecesTaken); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [116,105,108,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648532(result_553648430, 0, x_553648429.tile); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [109,111,118,101,115]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [116,97,107,101,115]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [111,110,77,111,118,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [111,110,84,97,107,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [119,104,101,110,84,97,107,101,110]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [111,110,69,110,100,84,117,114,110]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [111,110,80,114,111,109,111,116,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + result_553648430[0].push.apply(result_553648430[0], [46,46,46]);; + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [112,114,111,109,111,116,101,100]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648708(result_553648430, 0, x_553648429.promoted); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [102,105,108,101,80,97,116,104]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648722(result_553648430, 0, x_553648429.filePath); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [99,111,108,111,114,97,98,108,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648708(result_553648430, 0, x_553648429.colorable); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [114,111,116,97,116,101]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648708(result_553648430, 0, x_553648429.rotate); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [100,114,117,110,107]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648708(result_553648430, 0, x_553648429.drunk); + if ((0 < countHEX60gensym4_553648441)) { + result_553648430[0].push.apply(result_553648430[0], [44,32]);; + } + + result_553648430[0].push.apply(result_553648430[0], [99,97,115,116,115]);; + result_553648430[0].push.apply(result_553648430[0], [58,32]);; + countHEX60gensym4_553648441 += 1; + addQuoted_553648895(result_553648430, 0, x_553648429.casts); + result_553648430[0].push.apply(result_553648430[0], [41]);; + + return result_553648430[0]; + +} + +function formatValue_553648421(result_553648424, result_553648424_Idx, value_553648425) { + formatValue_553649009(result_553648424, result_553648424_Idx, HEX24_553648427(value_553648425)); + + +} + +function endRound_553648391() { + Label1: { + var i_553648392 = 0; + var j_553648393 = 0; + Label2: { + var i_553652702 = 0; + var i_553652703 = 0; + Label3: { + Label4: while (true) { + if (!(i_553652703 < 8)) break Label4; + i_553652702 = i_553652703; + Label5: { + var j_553652706 = 0; + var i_553652707 = 0; + Label6: { + Label7: while (true) { + if (!(i_553652707 < 8)) break Label7; + j_553652706 = i_553652707; + i_553648392 = i_553652702; + j_553648393 = j_553652706; + Label8: { + var xHEX60gensym2_553648398 = null; + var colontmp__553652697 = []; + colontmp__553652697 = theBoard_553648247[0][chckIndx(i_553648392, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648393, 0, (theBoard_553648247[0][chckIndx(i_553648392, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].onEndTurn; + var i_553652698 = 0; + var L_553652699 = (colontmp__553652697).length; + Label9: { + Label10: while (true) { + if (!(i_553652698 < L_553652699)) break Label10; + xHEX60gensym2_553648398 = colontmp__553652697[chckIndx(i_553652698, 0, (colontmp__553652697).length - 1)]; + xHEX60gensym2_553648398(theBoard_553648247[0][chckIndx(i_553648392, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648393, 0, (theBoard_553648247[0][chckIndx(i_553648392, 0, (theBoard_553648247[0]).length - 1)]).length - 1)], theBoard_553648247[0], theState_553648248[0]); + i_553652698 += 1; + if (!(((colontmp__553652697).length == L_553652699))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + i_553652707 = addInt(i_553652707, 1); + } + }; + }; + i_553652703 = addInt(i_553652703, 1); + } + }; + }; + }; + Label11: { + var i_553648399 = 0; + var j_553648400 = 0; + Label12: { + var i_553652711 = 0; + var i_553652712 = 0; + Label13: { + Label14: while (true) { + if (!(i_553652712 < 8)) break Label14; + i_553652711 = i_553652712; + Label15: { + var j_553652715 = 0; + var i_553652716 = 0; + Label16: { + Label17: while (true) { + if (!(i_553652716 < 8)) break Label17; + j_553652715 = i_553652716; + i_553648399 = i_553652711; + j_553648400 = j_553652715; + theBoard_553648247[0][chckIndx(i_553648399, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648400, 0, (theBoard_553648247[0][chckIndx(i_553648399, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].drunk = false; + i_553652716 = addInt(i_553652716, 1); + } + }; + }; + i_553652712 = addInt(i_553652712, 1); + } + }; + }; + }; + piecesChecking_553648271[0] = nimCopy(null, getPiecesChecking_1476396252(theBoard_553648247[0], side_553648229[0]), NTI1476395845); + if (gameIsOver_1476396229(theBoard_553648247[0])) { + if (alive_1476396153(side_553648229[0], theBoard_553648247[0])) { + addWins_1879048206(myDrafts_553648235[0]); + } + + currentScreen_553648276[0] = 6; + } + + var test_553648405 = []; + Label18: { + var i_553648406 = 0; + var j_553648407 = 0; + Label19: { + var i_553652722 = 0; + var i_553652723 = 0; + Label20: { + Label21: while (true) { + if (!(i_553652723 < 8)) break Label21; + i_553652722 = i_553652723; + Label22: { + var j_553652726 = 0; + var i_553652727 = 0; + Label23: { + Label24: while (true) { + if (!(i_553652727 < 8)) break Label24; + j_553652726 = i_553652727; + i_553648406 = i_553652722; + j_553648407 = j_553652726; + if (!(!(contains_553649022(test_553648405, theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648407, 0, (theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].index)))) { + Label25: { + var fmtRes_553648416 = [mnewString(0)]; + formatValue_553648421(fmtRes_553648416, 0, theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648407, 0, (theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)]).length - 1)]); + fmtRes_553648416[0].push.apply(fmtRes_553648416[0], [32,104,97,115,32,115,111,109,101,32,105,115,115,117,101,115]);; + }; + failedAssertImpl_268435541(([109,97,105,110,46,110,105,109,40,49,55,57,44,32,57,41,32,96,116,104,101,66,111,97,114,100,91,105,93,91,106,93,46,105,110,100,101,120,32,110,111,116,105,110,32,116,101,115,116,96,32] || []).concat(fmtRes_553648416[0] || [])); + } + + test_553648405.push(theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553648407, 0, (theBoard_553648247[0][chckIndx(i_553648406, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].index);; + i_553652727 = addInt(i_553652727, 1); + } + }; + }; + i_553652723 = addInt(i_553652723, 1); + } + }; + }; + }; + + +} + +function otherMove_553649746(d_553649747) { + var data_553649748 = nsuSplitString(d_553649747, [44], (-1)); + var mover_553649749 = nimCopy(null, {Field0: nsuParseInt(data_553649748[chckIndx(2, 0, (data_553649748).length - 1)]), Field1: nsuParseInt(data_553649748[chckIndx(1, 0, (data_553649748).length - 1)])}, NTI1476395011); + var moveTo_553649750 = nimCopy(null, {Field0: nsuParseInt(data_553649748[chckIndx(4, 0, (data_553649748).length - 1)]), Field1: nsuParseInt(data_553649748[chckIndx(3, 0, (data_553649748).length - 1)])}, NTI1476395011); + lastMove_553648266[0] = nimCopy(null, [nimCopy(null, mover_553649749, NTI1476395011), nimCopy(null, moveTo_553649750, NTI1476395011)], NTI553649407); + possibleMoves_553648256[0] = nimCopy(null, [], NTI1543504077); + possibleTakes_553648261[0] = nimCopy(null, [], NTI1543504077); + theState_553648248[0].Field0.turnNumber = addInt(theState_553648248[0].Field0.turnNumber, 1); + rawEcho(d_553649747, data_553649748[chckIndx(0, 0, (data_553649748).length - 1)], HEX24_1476395861(mover_553649749), HEX24_1476395861(moveTo_553649750)); + if (eqStrings(data_553649748[chckIndx(0, 0, (data_553649748).length - 1)], [109,111,118,101])) { + pieceOf_553648336(mover_553649749).onMove(pieceOf_553648336(mover_553649749), moveTo_553649750, theBoard_553648247[0], theState_553648248[0]); + } + else { + if (eqStrings(data_553649748[chckIndx(0, 0, (data_553649748).length - 1)], [116,97,107,101])) { + pieceOf_553648336(mover_553649749).onTake(pieceOf_553648336(mover_553649749), moveTo_553649750, theBoard_553648247[0], theState_553648248[0]); + } + } + + +} + +function binarySearch_1157628925(c_1157628926, tab_1157628927, len_1157628928, stride_1157628929) { + var result_1157628930 = 0; + + BeforeRet: { + var n_1157628931 = len_1157628928; + var t_1157628932 = 0; + Label1: { + Label2: while (true) { + if (!(1 < n_1157628931)) break Label2; + var m_1157628933 = divInt(n_1157628931, 2); + var p_1157628934 = addInt(t_1157628932, mulInt(m_1157628933, stride_1157628929)); + if ((tab_1157628927[chckIndx(p_1157628934, 0, (tab_1157628927).length - 1)] <= c_1157628926)) { + t_1157628932 = p_1157628934; + n_1157628931 = subInt(n_1157628931, m_1157628933); + } + else { + n_1157628931 = m_1157628933; + } + + } + }; + if ((!((n_1157628931 == 0)) && (tab_1157628927[chckIndx(t_1157628932, 0, (tab_1157628927).length - 1)] <= c_1157628926))) { + result_1157628930 = t_1157628932; + break BeforeRet; + } + + result_1157628930 = (-1); + break BeforeRet; + }; + + return result_1157628930; + +} + +function nuctoLower(c_1157628936) { + var result_1157628937 = 0; + + BeforeRet: { + var c_1157628938 = c_1157628936; + var p_1157628947 = binarySearch_1157628925(c_1157628938, toLowerRanges_1157628916, 45, 3); + if ((((0 <= p_1157628947) && (toLowerRanges_1157628916[chckIndx(p_1157628947, 0, (toLowerRanges_1157628916).length - 1)] <= c_1157628938)) && (c_1157628938 <= toLowerRanges_1157628916[chckIndx(addInt(p_1157628947, 1), 0, (toLowerRanges_1157628916).length - 1)]))) { + result_1157628937 = subInt(addInt(c_1157628938, toLowerRanges_1157628916[chckIndx(addInt(p_1157628947, 2), 0, (toLowerRanges_1157628916).length - 1)]), 500); + break BeforeRet; + } + + p_1157628947 = binarySearch_1157628925(c_1157628938, toLowerSinglets_1157628917, 610, 2); + if (((0 <= p_1157628947) && (c_1157628938 == toLowerSinglets_1157628917[chckIndx(p_1157628947, 0, (toLowerSinglets_1157628917).length - 1)]))) { + result_1157628937 = subInt(addInt(c_1157628938, toLowerSinglets_1157628917[chckIndx(addInt(p_1157628947, 1), 0, (toLowerSinglets_1157628917).length - 1)]), 500); + break BeforeRet; + } + + result_1157628937 = c_1157628938; + break BeforeRet; + }; + + return result_1157628937; + +} + +function HEX3CHEX3DHEX25_33555507(x_33555508, y_33555509) { + var result_33555510 = false; + + result_33555510 = (Number(BigInt.asUintN(32, BigInt(x_33555508))) <= Number(BigInt.asUintN(32, BigInt(y_33555509)))); + + return result_33555510; + +} + +function nuctoLowerStr(s_1157630237) { + var Temporary3; + var Temporary4; + var Temporary5; + var Temporary6; + var Temporary7; + var Temporary8; + + var result_1157630238 = []; + + result_1157630238 = nimCopy(null, mnewString(chckRange((s_1157630237).length, 0, 2147483647)), NTI33554449); + var iHEX60gensym252_1157630245 = 0; + var resultIndexHEX60gensym252_1157630246 = 0; + var runeHEX60gensym252_1157630247 = 0; + Label1: { + Label2: while (true) { + if (!(iHEX60gensym252_1157630245 < (s_1157630237).length)) break Label2; + if ((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] <= 127)) { + runeHEX60gensym252_1157630247 = chckRange(s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)], (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + else { + if (((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] >>> 5) == 6)) { + if ((iHEX60gensym252_1157630245 <= subInt((s_1157630237).length, 2))) { + runeHEX60gensym252_1157630247 = chckRange(((((((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] & 31) >>> 0) << 6) >>> 0) | ((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 1), 0, (s_1157630237).length - 1)] & 63) >>> 0)) >>> 0), (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 2); + } + else { + runeHEX60gensym252_1157630247 = 65533; + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + + } + else { + if (((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] >>> 4) == 14)) { + if ((iHEX60gensym252_1157630245 <= subInt((s_1157630237).length, 3))) { + runeHEX60gensym252_1157630247 = chckRange(((((((((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] & 15) >>> 0) << 12) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 1), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 6) >>> 0)) >>> 0) | ((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 2), 0, (s_1157630237).length - 1)] & 63) >>> 0)) >>> 0), (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 3); + } + else { + runeHEX60gensym252_1157630247 = 65533; + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + + } + else { + if (((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] >>> 3) == 30)) { + if ((iHEX60gensym252_1157630245 <= subInt((s_1157630237).length, 4))) { + runeHEX60gensym252_1157630247 = chckRange(((((((((((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] & 7) >>> 0) << 18) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 1), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 12) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 2), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 6) >>> 0)) >>> 0) | ((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 3), 0, (s_1157630237).length - 1)] & 63) >>> 0)) >>> 0), (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 4); + } + else { + runeHEX60gensym252_1157630247 = 65533; + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + + } + else { + if (((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] >>> 2) == 62)) { + if ((iHEX60gensym252_1157630245 <= subInt((s_1157630237).length, 5))) { + runeHEX60gensym252_1157630247 = chckRange(((((((((((((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] & 3) >>> 0) << 24) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 1), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 18) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 2), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 12) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 3), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 6) >>> 0)) >>> 0) | ((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 4), 0, (s_1157630237).length - 1)] & 63) >>> 0)) >>> 0), (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 5); + } + else { + runeHEX60gensym252_1157630247 = 65533; + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + + } + else { + if (((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] >>> 1) == 126)) { + if ((iHEX60gensym252_1157630245 <= subInt((s_1157630237).length, 6))) { + runeHEX60gensym252_1157630247 = chckRange(((((((((((((((s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)] & 1) >>> 0) << 30) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 1), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 24) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 2), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 18) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 3), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 12) >>> 0)) >>> 0) | ((((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 4), 0, (s_1157630237).length - 1)] & 63) >>> 0) << 6) >>> 0)) >>> 0) | ((s_1157630237[chckIndx(addInt(iHEX60gensym252_1157630245, 5), 0, (s_1157630237).length - 1)] & 63) >>> 0)) >>> 0), (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 6); + } + else { + runeHEX60gensym252_1157630247 = 65533; + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + + } + else { + runeHEX60gensym252_1157630247 = chckRange(s_1157630237[chckIndx(iHEX60gensym252_1157630245, 0, (s_1157630237).length - 1)], (-2147483648), 2147483647); + iHEX60gensym252_1157630245 = addInt(iHEX60gensym252_1157630245, 1); + } + }}}}} + runeHEX60gensym252_1157630247 = nuctoLower(runeHEX60gensym252_1157630247); + var iHEX60gensym274_1157630488 = runeHEX60gensym252_1157630247; + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 127)) { + if (result_1157630238.length < (Temporary3 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, 2147483647), Temporary3)) { for (var i = result_1157630238.length; i < Temporary3; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary3; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(iHEX60gensym274_1157630488, 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 1); + } + else { + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 2047)) { + if (result_1157630238.length < (Temporary4 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 2), 0, 2147483647), Temporary4)) { for (var i = result_1157630238.length; i < Temporary4; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary4; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 >> 6) | 192), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 & 63) | 128), 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 2); + } + else { + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 65535)) { + if (result_1157630238.length < (Temporary5 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 3), 0, 2147483647), Temporary5)) { for (var i = result_1157630238.length; i < Temporary5; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary5; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 >> 12) | 224), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 6) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 2), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 & 63) | 128), 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 3); + } + else { + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 2097151)) { + if (result_1157630238.length < (Temporary6 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 4), 0, 2147483647), Temporary6)) { for (var i = result_1157630238.length; i < Temporary6; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary6; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 >> 18) | 240), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 12) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 2), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 6) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 3), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 & 63) | 128), 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 4); + } + else { + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 67108863)) { + if (result_1157630238.length < (Temporary7 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 5), 0, 2147483647), Temporary7)) { for (var i = result_1157630238.length; i < Temporary7; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary7; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 >> 24) | 248), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 18) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 2), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 12) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 3), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 6) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 4), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 & 63) | 128), 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 5); + } + else { + if (HEX3CHEX3DHEX25_33555507(iHEX60gensym274_1157630488, 2147483647)) { + if (result_1157630238.length < (Temporary8 = chckRange(addInt(resultIndexHEX60gensym252_1157630246, 6), 0, 2147483647), Temporary8)) { for (var i = result_1157630238.length; i < Temporary8; ++i) result_1157630238.push(0); } + else {result_1157630238.length = Temporary8; }; + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 0), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 >> 30) | 252), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 1), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 24) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 2), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 18) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 3), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 12) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 4), 0, (result_1157630238).length - 1)] = chckRange((((iHEX60gensym274_1157630488 >> 6) & 63) | 128), 0, 255); + result_1157630238[chckIndx(addInt(resultIndexHEX60gensym252_1157630246, 5), 0, (result_1157630238).length - 1)] = chckRange(((iHEX60gensym274_1157630488 & 63) | 128), 0, 255); + resultIndexHEX60gensym252_1157630246 = addInt(resultIndexHEX60gensym252_1157630246, 6); + } + else { + } + }}}}} + } + }; + + return result_1157630238; + +} + +function toLower_1157635480(s_1157635481) { + var result_1157635482 = []; + + result_1157635482 = nimCopy(null, nuctoLowerStr((s_1157635481.slice(0, (s_1157635481).length - 1 + 1))), NTI33554449); + + return result_1157635482; + +} + +function toGlassType_1895825413(str_1895825414) { + var result_1895825415 = 0; + + BeforeRet: { + if (eqStrings(toLower_1157635480(str_1895825414), [115,107,121])) { + result_1895825415 = 0; + break BeforeRet; + } + else { + if (eqStrings(toLower_1157635480(str_1895825414), [122,101,114,111])) { + result_1895825415 = 1; + break BeforeRet; + } + else { + if (eqStrings(toLower_1157635480(str_1895825414), [115,116,101,101,108])) { + result_1895825415 = 2; + break BeforeRet; + } + }} + }; + + return result_1895825415; + +} + +function newSeq_553649837(len_553649839) { + var result_553649840 = []; + + result_553649840 = new Array(len_553649839); for (var i = 0 ; i < len_553649839 ; ++i) { result_553649840[i] = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; } + return result_553649840; + +} + +function isNone_553649874(self_553649876) { + var result_553649877 = false; + + result_553649877 = !(self_553649876.has); + + return result_553649877; + +} + +function get_553649866(self_553649868) { + var result_553649869 = null; + + BeforeRet: { + if (isNone_553649874(self_553649868)) { + raiseException({message: [67,97,110,39,116,32,111,98,116,97,105,110,32,97,32,118,97,108,117,101,32,102,114,111,109,32,97,32,96,110,111,110,101,96], parent: null, m_type: NTI1493172247, name: null, trace: [], up: null}, "UnpackDefect"); + } + + result_553649869 = self_553649868.val; + break BeforeRet; + }; + + return result_553649869; + +} + +function otherGlass_553649816(d_553649817) { + var Temporary1; + var Temporary16; + + var data_553649818 = nsuSplitString(d_553649817, [44], (-1)); + if (eqStrings(data_553649818[chckIndx(0, 0, (data_553649818).length - 1)], [99,97,115,116,105,110,103,115,116,97,114,116])) { + (Temporary1 = theBoard_553648247[0][chckIndx(nsuParseInt(data_553649818[chckIndx(1, 0, (data_553649818).length - 1)]), 0, (theBoard_553648247[0]).length - 1)], Temporary1)[chckIndx(nsuParseInt(data_553649818[chckIndx(2, 0, (data_553649818).length - 1)]), 0, (Temporary1).length - 1)].casts.push({Field0: nimCopy(null, {Field0: nsuParseInt(data_553649818[chckIndx(4, 0, (data_553649818).length - 1)]), Field1: nsuParseInt(data_553649818[chckIndx(3, 0, (data_553649818).length - 1)])}, NTI1476395011), Field1: nsuParseInt(data_553649818[chckIndx(5, 0, (data_553649818).length - 1)]), Field2: toGlassType_1895825413(data_553649818[chckIndx(6, 0, (data_553649818).length - 1)])});; + } + else { + if (eqStrings(data_553649818[chckIndx(0, 0, (data_553649818).length - 1)], [99,97,115,116,105,110,103,99,111,109,112,108,101,116,101])) { + turn_553648230[0] = true; + rawEcho([116,117,114,110,32,101,113,117,97,108,115,32,116,114,117,101,58,32,111,116,104,101,114,103,108,97,115,115]); + Label2: { + var i_553649830 = 0; + var j_553649831 = 0; + Label3: { + var i_553652775 = 0; + var i_553652776 = 0; + Label4: { + Label5: while (true) { + if (!(i_553652776 < 8)) break Label5; + i_553652775 = i_553652776; + Label6: { + var j_553652779 = 0; + var i_553652780 = 0; + Label7: { + Label8: while (true) { + if (!(i_553652780 < 8)) break Label8; + j_553652779 = i_553652780; + i_553649830 = i_553652775; + j_553649831 = j_553652779; + Label9: { + var c_553649835 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var colontmp__553652770 = []; + colontmp__553652770 = theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553649831, 0, (theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts; + var i_553652771 = 0; + var L_553652772 = (colontmp__553652770).length; + Label10: { + Label11: while (true) { + if (!(i_553652771 < L_553652772)) break Label11; + c_553649835 = colontmp__553652770[chckIndx(i_553652771, 0, (colontmp__553652770).length - 1)]; + if ((c_553649835.Field1 == nsuParseInt(data_553649818[chckIndx(1, 0, (data_553649818).length - 1)]))) { + var resultHEX60gensym140_553649845 = newSeq_553649837(0); + Label12: { + var it_553649849 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var colontmp__553652766 = []; + colontmp__553652766 = theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553649831, 0, (theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts; + var i_553652767 = 0; + var L_553652768 = (colontmp__553652766).length; + Label13: { + Label14: while (true) { + if (!(i_553652767 < L_553652768)) break Label14; + it_553649849 = colontmp__553652766[chckIndx(i_553652767, 0, (colontmp__553652766).length - 1)]; + if (!((it_553649849.Field1 == c_553649835.Field1))) { + var Temporary15 = nimCopy(null, it_553649849, NTI1476395023); + resultHEX60gensym140_553649845.push(Temporary15);; + } + + i_553652767 += 1; + if (!(((colontmp__553652766).length == L_553652768))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553649831, 0, (theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts = nimCopy(null, resultHEX60gensym140_553649845, NTI553649491); + get_553649866((Temporary16 = theState_553648248[0].Field1[chckIndx(otherSide_1476396146(side_553648229[0]), 0, (theState_553648248[0].Field1).length - 1)].glass, Temporary16)[chckIndx(c_553649835.Field2, 0, (Temporary16).length - 1)]).Field1(theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553649831, 0, (theBoard_553648247[0][chckIndx(i_553649830, 0, (theBoard_553648247[0]).length - 1)]).length - 1)], c_553649835.Field0, theBoard_553648247[0], theState_553648248[0]); + } + + i_553652771 += 1; + if (!(((colontmp__553652770).length == L_553652772))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + i_553652780 = addInt(i_553652780, 1); + } + }; + }; + i_553652776 = addInt(i_553652776, 1); + } + }; + }; + }; + } + } + + +} + +function otherAction_553649898(d_553649899) { + var data_553649900 = nsuSplitString(d_553649899, [44], (-1)); + if (eqStrings(data_553649900[chckIndx(0, 0, (data_553649900).length - 1)], [98,117,121])) { + otherBuy_553649693(d_553649899); + endRound_553648391(); + } + else { + if ((eqStrings(data_553649900[chckIndx(0, 0, (data_553649900).length - 1)], [109,111,118,101]) || eqStrings(data_553649900[chckIndx(0, 0, (data_553649900).length - 1)], [116,97,107,101]))) { + turn_553648230[0] = true; + rawEcho([111,116,104,101,114,97,99,116,105,111,110,32,111,102,32,109,111,118,101,47,116,97,107,101,58,32,116,117,114,110,32,101,113,117,97,108,115,32,116,114,117,101]); + otherMove_553649746(d_553649899); + endRound_553648391(); + } + else { + if ((toJSStr(data_553649900[chckIndx(0, 0, (data_553649900).length - 1)]).indexOf("casting")>=0)) { + otherGlass_553649816(d_553649899); + } + else { + if (eqStrings(data_553649900[chckIndx(0, 0, (data_553649900).length - 1)], [112,97,115,115])) { + turn_553648230[0] = true; + rawEcho([111,116,104,101,114,97,99,116,105,111,110,32,111,102,32,112,97,115,115,58,32,116,117,114,110,32,101,113,117,97,108,115,32,116,114,117,101]); + endRound_553648391(); + } + }}} + + +} + +function hostLogic_553650048(d_553650049, m_553650050) { + rawEcho(reprEnum(m_553650050, NTI1577058309), [32,111,102,32], d_553650049, [10]); + switch (m_553650050) { + case 0: + var colontmp__553652675 = true; + var colontmp__553652676 = toJSStr(d_553650049); + roomId_553648222[0] = nimCopy(roomId_553648222[0], {Field0: colontmp__553652675, Field1: colontmp__553652676}, NTI553648163); + side_553648229[0] = 1; + break; + case 1: + peer_553648228[0].Field0("options:deciding"); + currentScreen_553648276[0] = 4; + initGame_553648349(); + draftTier_553648245[0] = randomTier_1728054045({Field0: 50, Field1: 36, Field2: 12, Field3: 2}); + break; + case 3: + var x_553650054 = nsuSplitString(d_553650049, [44], (-1)); + if (eqStrings(x_553650054[chckIndx(0, 0, (x_553650054).length - 1)], [109,121])) { + turn_553648230[0] = true; + var Temporary1 = nimCopy(null, powers_1728053322[0][chckIndx(nsuParseInt(x_553650054[chckIndx(1, 0, (x_553650054).length - 1)]), 0, (powers_1728053322[0]).length - 1)], NTI1728053254); + opponentDrafts_553648240[0].push(Temporary1);; + if ((1 <= draftsLeft_553648244[0])) { + draftsLeft_553648244[0] = subInt(draftsLeft_553648244[0], 1); + draftTier_553648245[0] = randomTier_1728054045({Field0: 50, Field1: 36, Field2: 12, Field3: 2}); + draft_553649976(HEX26_1728054083(myDrafts_553648235[0], opponentDrafts_553648240[0]), myDrafts_553648235[0]); + } + else { + execute_1728054225(myDrafts_553648235[0], opponentDrafts_553648240[0], side_553648229[0], theBoard_553648247[0], theState_553648248[0]); + peer_553648228[0].Field0("handshake:gamestart"); + currentScreen_553648276[0] = 3; + } + + } + + break; + case 6: + otherAction_553649898(d_553650049); + break; + case 4: + if ((eqStrings(d_553650049, [100,105,115,99,111,110,110]) || eqStrings(d_553650049, [101,120,105,116]))) { + currentScreen_553648276[0] = 8; + } + else { + peer_553648228[0].Field0("end:exit"); + } + + peer_553648228[0].Field1(); + roomId_553648222[0].Field0 = false; + break; + default: + rawEcho([117,110,105,109,112,108,101,109,101,110,116,101,100]); + break; + } + redraw_721421809(kxi__); + + +} + +function createLobby_553650364() { + +function HEX3Aanonymous_553650374(__553650375, __553650376) { + currentScreen_553648276[0] = 2; + + + } + +function HEX3Aanonymous_553650377(ev_553650378, __553650379) { + alert("Unimplemented"); + + + } + +function HEX3Aanonymous_553650380(ev_553650381, __553650382) { + if (!((peer_553648228[0].Field1 == null))) { + peer_553648228[0].Field1(); + } + + peer_553648228[0] = nimCopy(peer_553648228[0], newHost_1577058350(hostLogic_553650048), NTI553648165); + currentScreen_553648276[0] = 1; + + + } + +function HEX3Aanonymous_553650434(ev_553650435, __553650436) { + currentScreen_553648276[0] = 10; + + + } + + var result_553650365 = null; + + var tmp_553650366 = tree_754975616(44, []); + tmp_553650366.class = "start-column height-100"; + var tmp_553650367 = tree_754975616(44, []); + tmp_553650367.class = "main"; + var tmp_553650368 = tree_754975616(44, []); + tmp_553650368.class = "start-column"; + var tmp_553650369 = tree_754975616(195, []); + tmp_553650369.class = " menu-button "; + add_754975552(tmp_553650369, text_754975684([74,111,105,110,32,97,32,82,111,111,109])); + addEventHandler_721422102(tmp_553650369, 0, HEX3Aanonymous_553650374, kxi__); + add_754975552(tmp_553650368, tmp_553650369); + var tmp_553650370 = tree_754975616(195, []); + tmp_553650370.class = " menu-button "; + add_754975552(tmp_553650370, text_754975684([83,101,101,32,80,111,119,101,114,115])); + addEventHandler_721422102(tmp_553650370, 0, HEX3Aanonymous_553650377, kxi__); + add_754975552(tmp_553650368, tmp_553650370); + add_754975552(tmp_553650367, tmp_553650368); + var tmp_553650371 = tree_754975616(44, []); + tmp_553650371.class = "start-column"; + var tmp_553650372 = tree_754975616(195, []); + tmp_553650372.class = " menu-button "; + add_754975552(tmp_553650372, text_754975684([67,114,101,97,116,101,32,97,32,82,111,111,109])); + addEventHandler_721422102(tmp_553650372, 0, HEX3Aanonymous_553650380, kxi__); + add_754975552(tmp_553650371, tmp_553650372); + var tmp_553650373 = tree_754975616(195, []); + tmp_553650373.class = " menu-button "; + add_754975552(tmp_553650373, text_754975684([79,116,104,101,114])); + addEventHandler_721422102(tmp_553650373, 0, HEX3Aanonymous_553650434, kxi__); + add_754975552(tmp_553650371, tmp_553650373); + add_754975552(tmp_553650367, tmp_553650371); + add_754975552(tmp_553650366, tmp_553650367); + result_553650365 = tmp_553650366; + + return result_553650365; + +} + +function text_754975687(s_754975688) { + var result_754975689 = null; + + result_754975689 = {kind: 0, text: s_754975688, index: (-1), m_type: NTI754974820, id: null, class: null, kids: [], attrs: [], events: [], style: null, styleVersion: 0, dom: null}; + + return result_754975689; + +} + +function createRoomMenu_553650453() { + var result_553650454 = null; + + var tmp_553650455 = tree_754975616(44, []); + tmp_553650455.class = "main"; + if (!(roomId_553648222[0].Field0)) { + add_754975552(tmp_553650455, text_754975684([67,114,101,97,116,105,110,103,32,114,111,111,109,32,107,101,121])); + } + else { + var tmp_553650456 = tree_754975616(22, []); + add_754975552(tmp_553650456, text_754975684([82,111,111,109,32,75,101,121,58,32])); + add_754975552(tmp_553650455, tmp_553650456); + var tmp_553650457 = tree_754975616(72, []); + add_754975552(tmp_553650455, tmp_553650457); + add_754975552(tmp_553650455, text_754975687(roomId_553648222[0].Field1)); + } + + result_553650454 = tmp_553650455; + + return result_553650454; + +} + +function getInputText_721422193(n_721422194) { + var result_721422195 = null; + + if (!((n_721422194.dom == null))) { + result_721422195 = n_721422194.dom.value; + } + + + return result_721422195; + +} + +function getVNodeById_721420594(id_721420595, kxi_721420596) { + var result_721420597 = null; + + if (kxi_721420596.byId.hasOwnProperty(id_721420595)) { + result_721420597 = kxi_721420596.byId[id_721420595]; + } + + + return result_721420597; + +} + +function len_754975743(a_754975744) { + var Temporary1; + + var result_754975745 = 0; + + if ((a_754975744 == null)) { + Temporary1 = 0; + } + else { + Temporary1 = ((a_754975744) == null ? 0 : (a_754975744).length); + } + + result_754975745 = Temporary1; + + return result_754975745; + +} + +function toString_754975748(n_754975749, result_754975750, result_754975750_Idx, indent_754975751) { + Label1: { + var i_754975756 = 0; + var res_553652785 = 1; + Label2: { + Label3: while (true) { + if (!(res_553652785 <= indent_754975751)) break Label3; + i_754975756 = res_553652785; + addChar(result_754975750[result_754975750_Idx], 32);; + res_553652785 = addInt(res_553652785, 1); + } + }; + }; + if ((0 < (result_754975750[result_754975750_Idx]).length)) { + addChar(result_754975750[result_754975750_Idx], 10);; + } + + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([60] || []).concat(reprEnum(n_754975749.kind, NTI754974723) || []));; + if ((0 < len_754975743(n_754975749.id))) { + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32,105,100,32,61,32] || []).concat(cstrToNimstr(n_754975749.id) || []));; + } + + if ((0 < len_754975743(n_754975749.class))) { + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32,99,108,97,115,115,32,61,32] || []).concat(cstrToNimstr(n_754975749.class) || []));; + } + + Label4: { + var k_754975760 = null; + var v_754975761 = null; + Label5: { + var i_553652789 = 0; + var colontmp__553652790 = 0; + colontmp__553652790 = subInt((n_754975749.attrs).length, 2); + var res_553652791 = 0; + Label6: { + Label7: while (true) { + if (!(res_553652791 <= colontmp__553652790)) break Label7; + i_553652789 = res_553652791; + k_754975760 = n_754975749.attrs[chckIndx(i_553652789, 0, (n_754975749.attrs).length - 1)]; + v_754975761 = n_754975749.attrs[chckIndx(addInt(i_553652789, 1), 0, (n_754975749.attrs).length - 1)]; + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32] || []).concat(cstrToNimstr(k_754975760) || [],[32,61,32] || [],cstrToNimstr(v_754975761) || []));; + res_553652791 = addInt(res_553652791, 2); + } + }; + }; + }; + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], [62,10]);; + if ((n_754975749.kind == 0)) { + add_33556373(result_754975750, result_754975750_Idx, n_754975749.text); + } + else { + if ((0 < len_754975743(n_754975749.text))) { + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], [32,118,97,108,117,101,32,61,32]);; + add_33556373(result_754975750, result_754975750_Idx, n_754975749.text); + } + + Label8: { + var child_754975767 = null; + Label9: { + var i_553652795 = 0; + var colontmp__553652796 = 0; + colontmp__553652796 = (n_754975749.kids).length; + var i_553652797 = 0; + Label10: { + Label11: while (true) { + if (!(i_553652797 < colontmp__553652796)) break Label11; + i_553652795 = i_553652797; + child_754975767 = n_754975749.kids[chckIndx(i_553652795, 0, (n_754975749.kids).length - 1)]; + toString_754975748(child_754975767, result_754975750, result_754975750_Idx, addInt(indent_754975751, 2)); + i_553652797 = addInt(i_553652797, 1); + } + }; + }; + }; + } + + Label12: { + var i_754975772 = 0; + var res_553652800 = 1; + Label13: { + Label14: while (true) { + if (!(res_553652800 <= indent_754975751)) break Label14; + i_754975772 = res_553652800; + addChar(result_754975750[result_754975750_Idx], 32);; + res_553652800 = addInt(res_553652800, 1); + } + }; + }; + result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([10,60,47] || []).concat(reprEnum(n_754975749.kind, NTI754974723) || [],[62] || []));; + + +} + +function HEX24_754975843(n_754975844) { + var result_754975845 = null; + + var res_754975846 = [[]]; + toString_754975748(n_754975844, res_754975846, 0, 0); + result_754975845 = toJSStr(res_754975846[0]); + + return result_754975845; + +} + +function newJoin_1577058551(id_1577058552, cb_1577058556) { + +function HEX3Aanonymous_1577058565() { + +function HEX3Aanonymous_1577058577() { + var result_1577058578 = null; + + result_1577058578 = conn_1577058564.send(("handshake:hello")); + + return result_1577058578; + + } + +function HEX3Aanonymous_1577058608(data_1577058609) { + cb_1577058556(cutMessage_1577058347(data_1577058609), messageType_1577058327(data_1577058609)); + + + } + + conn_1577058564 = peer_1577058563.connect((("9e4ada91-c493-4fd4-881d-3e05db99e100" + id_1577058552))); + conn_1577058564.on(("open"), (HEX3Aanonymous_1577058577)); + conn_1577058564.on(("data"), (HEX3Aanonymous_1577058608)); + + + } + +function HEX3Aanonymous_1577058647() { + rawEcho([68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84]); + peer_1577058563.id = ("9e4ada91-c493-4fd4-881d-3e05db99e100" + id_1577058552); + peer_1577058563.reconnect(); + + + } + +function HEX3Aanonymous_1577058681() { + peer_1577058563.destroy(); + + + } + +function HEX3Aanonymous_1577058686(data_1577058687) { + conn_1577058564.send((data_1577058687)); + + + } + + var result_1577058562 = {Field0: null, Field1: null}; + + var peer_1577058563 = new Peer(null, {config: { + iceServers: [ + { + urls: "turn:standard.relay.metered.ca:80", + username: "4eadefa5a1ad93a461469d19", + credential: "wLlcdHP/D2ZcRAg/", + } + ] + } + }) +; + var conn_1577058564 = null; + peer_1577058563.on(("open"), (HEX3Aanonymous_1577058565)); + peer_1577058563.on(("disconnect"), (HEX3Aanonymous_1577058647)); + result_1577058562.Field1 = HEX3Aanonymous_1577058681; + result_1577058562.Field0 = HEX3Aanonymous_1577058686; + + return result_1577058562; + +} + +function HEX5BHEX5D_553650117(s_553650121, x_553650122) { + var result_553650123 = []; + + var a_553650125 = x_553650122.a; + var L_553650130 = addInt(subInt(subInt((s_553650121).length, x_553650122.b), a_553650125), 1); + result_553650123 = new Array(chckRange(L_553650130, 0, 2147483647)); for (var i = 0 ; i < chckRange(L_553650130, 0, 2147483647) ; ++i) { result_553650123[i] = []; } Label1: { + var i_553650139 = 0; + var i_553652809 = 0; + Label2: { + Label3: while (true) { + if (!(i_553652809 < L_553650130)) break Label3; + i_553650139 = i_553652809; + result_553650123[chckIndx(i_553650139, 0, (result_553650123).length - 1)] = nimCopy(null, s_553650121[chckIndx(addInt(i_553650139, a_553650125), 0, (s_553650121).length - 1)], NTI33554449); + i_553652809 = addInt(i_553652809, 1); + } + }; + }; + + return result_553650123; + +} + +function joinLogic_553650093(d_553650094, m_553650095) { + rawEcho(reprEnum(m_553650095, NTI1577058309), [32,111,102,32], d_553650094, [10]); + switch (m_553650095) { + case 2: + currentScreen_553648276[0] = 4; + side_553648229[0] = 0; + turn_553648230[0] = false; + initGame_553648349(); + break; + case 1: + execute_1728054225(myDrafts_553648235[0], opponentDrafts_553648240[0], side_553648229[0], theBoard_553648247[0], theState_553648248[0]); + currentScreen_553648276[0] = 3; + break; + case 5: + if (rematch_553648246[0]) { + rematch_553648246[0] = false; + peer_553648228[0].Field0("handshake:newgame"); + } + else { + rematch_553648246[0] = true; + } + + break; + case 3: + var x_553650099 = nsuSplitString(d_553650094, [44], (-1)); + if (eqStrings(d_553650094, [115,116,97,114,116])) { + currentScreen_553648276[0] = 5; + } + else { + if (eqStrings(x_553650099[chckIndx(0, 0, (x_553650099).length - 1)], [109,121])) { + var Temporary1 = nimCopy(null, powers_1728053322[0][chckIndx(nsuParseInt(x_553650099[chckIndx(1, 0, (x_553650099).length - 1)]), 0, (powers_1728053322[0]).length - 1)], NTI1728053254); + opponentDrafts_553648240[0].push(Temporary1);; + } + else { + if (eqStrings(x_553650099[chckIndx(0, 0, (x_553650099).length - 1)], [103,111])) { + draftOptions_553648242[0] = nimCopy(null, [], NTI1728053692); + Label2: { + var i_553650161 = []; + var colontmp__553652803 = []; + colontmp__553652803 = HEX5BHEX5D_553650117(x_553650099, HEX2EHEX2E_1090519145(1, 1)); + var i_553652805 = 0; + var L_553652806 = (colontmp__553652803).length; + Label3: { + Label4: while (true) { + if (!(i_553652805 < L_553652806)) break Label4; + i_553650161 = colontmp__553652803[chckIndx(i_553652805, 0, (colontmp__553652803).length - 1)]; + var Temporary5 = nimCopy(null, powers_1728053322[0][chckIndx(nsuParseInt(i_553650161), 0, (powers_1728053322[0]).length - 1)], NTI1728053254); + draftOptions_553648242[0].push(Temporary5);; + i_553652805 += 1; + if (!(((colontmp__553652803).length == L_553652806))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + turn_553648230[0] = true; + } + }} + break; + case 6: + otherAction_553649898(d_553650094); + break; + case 4: + if ((eqStrings(d_553650094, [100,105,115,99,111,110,110]) || eqStrings(d_553650094, [101,120,105,116]))) { + currentScreen_553648276[0] = 8; + } + else { + peer_553648228[0].Field0("end:exit"); + } + + peer_553648228[0].Field1(); + break; + default: + rawEcho([117,110,105,109,112,108,101,109,101,110,116,101,100]); + break; + } + redraw_721421809(kxi__); + + +} + +function join_553650458(__553650459, __553650460) { + var id_553650461 = getInputText_721422193(getVNodeById_721420594("joincode", kxi__)); + roomId_553648222[0].Field1 = id_553650461; + rawEcho(HEX24_754975843(getVNodeById_721420594("joincode", kxi__))); + if (!((peer_553648228[0].Field1 == null))) { + peer_553648228[0].Field1(); + } + + peer_553648228[0] = nimCopy(peer_553648228[0], newJoin_1577058551(id_553650461, joinLogic_553650093), NTI553648165); + + +} + +function setAttr_754975467(n_754975468, key_754975469, val_754975470) { + BeforeRet: { + if (((n_754975468.attrs).length == 0)) { + n_754975468.attrs = nimCopy(null, [key_754975469, val_754975470], NTI754975006); + } + else { + Label1: { + var i_754975487 = 0; + var colontmp__553652812 = 0; + colontmp__553652812 = subInt((n_754975468.attrs).length, 2); + var res_553652813 = 0; + Label2: { + Label3: while (true) { + if (!(res_553652813 <= colontmp__553652812)) break Label3; + i_754975487 = res_553652813; + if ((n_754975468.attrs[chckIndx(i_754975487, 0, (n_754975468.attrs).length - 1)] == key_754975469)) { + n_754975468.attrs[chckIndx(addInt(i_754975487, 1), 0, (n_754975468.attrs).length - 1)] = val_754975470; + break BeforeRet; + } + + res_553652813 = addInt(res_553652813, 2); + } + }; + }; + n_754975468.attrs.push(key_754975469);; + n_754975468.attrs.push(val_754975470);; + } + + }; + + +} + +function addEventHandler_721422110(n_721422111, k_721422112, action_721422114, kxi_721422115) { + +function wrapper_721422116(ev_721422117, n_721422118) { + action_721422114(); + if (!(kxi_721422115.surpressRedraws)) { + redraw_721421809(kxi_721422115); + } + + + + } + + addEventListener_754975735(n_721422111, k_721422112, wrapper_721422116); + + +} + +function getError_1459617819(field_1459617820) { + var result_1459617821 = null; + + if (!(gerrorMsgs_1459617798[0].hasOwnProperty(field_1459617820))) { + result_1459617821 = ""; + } + else { + result_1459617821 = gerrorMsgs_1459617798[0][field_1459617820]; + } + + + return result_1459617821; + +} + +function setError_1459617834(field_1459617835, msg_1459617836) { + var previous_1459617837 = getError_1459617819(field_1459617835); + if ((((msg_1459617836) == null ? 0 : (msg_1459617836).length) == 0)) { + if (!((((previous_1459617837) == null ? 0 : (previous_1459617837).length) == 0))) { + gerrorCounter_1459617799[0] = subInt(gerrorCounter_1459617799[0], 1); + } + + } + else { + if ((((previous_1459617837) == null ? 0 : (previous_1459617837).length) == 0)) { + gerrorCounter_1459617799[0] = addInt(gerrorCounter_1459617799[0], 1); + } + + } + + gerrorMsgs_1459617798[0][field_1459617835] = msg_1459617836; + + +} + +function validateNotEmpty_553650172(field_553650173) { + +function HEX3Aanonymous_553650176() { + var x_553650177 = getInputText_721422193(getVNodeById_721420594(field_553650173, kxi__)); + if (((x_553650177 == null) || (x_553650177 == ""))) { + setError_1459617834(field_553650173, (field_553650173 + " must not be empty")); + } + else { + setError_1459617834(field_553650173, ""); + } + + + + } + + var result_553650175 = null; + + result_553650175 = HEX3Aanonymous_553650176; + + return result_553650175; + +} + +function createJoinMenu_553650483() { + var result_553650484 = null; + + var tmp_553650485 = tree_754975616(44, []); + tmp_553650485.class = "main cut-down"; + tmp_553650485.id = "join"; + addEventHandler_721422102(tmp_553650485, 29, join_553650458, kxi__); + var tmp_553650486 = tree_754975616(193, []); + setAttr_754975467(tmp_553650486, "for", "joincode"); + add_754975552(tmp_553650486, text_754975684([74,111,105,110,32,67,111,100,101,58])); + add_754975552(tmp_553650485, tmp_553650486); + var tmp_553650487 = tree_754975616(194, []); + tmp_553650487.id = "joincode"; + addEventHandler_721422110(tmp_553650487, 8, validateNotEmpty_553650172("joincode"), kxi__); + add_754975552(tmp_553650485, tmp_553650487); + var tmp_553650488 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650488, 0, join_553650458, kxi__); + add_754975552(tmp_553650488, text_754975684([69,110,116,101,114])); + add_754975552(tmp_553650485, tmp_553650488); + result_553650484 = tmp_553650485; + + return result_553650484; + +} + +function createOptionsMenu_553650489() { + +function HEX3Aanonymous_553650519(__553650520, __553650521) { + peer_553648228[0].Field0("handshake:gamestart"); + turn_553648230[0] = true; + currentScreen_553648276[0] = 3; + + + } + +function HEX3Aanonymous_553650524(__553650525, __553650526) { + peer_553648228[0].Field0("draft:start"); + currentScreen_553648276[0] = 5; + gameMode_553648278[0] = 1; + turn_553648230[0] = true; + baseDrafts_553648241[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftTierNumber", kxi__)), 10); + draftsLeft_553648244[0] = subInt(baseDrafts_553648241[0], 1); + draftChoices_553648243[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceTierNumber", kxi__)), 10); + draft_553649976([], []); + + + } + +function HEX3Aanonymous_553650545(__553650546, __553650547) { + peer_553648228[0].Field0("draft:start"); + currentScreen_553648276[0] = 5; + gameMode_553648278[0] = 2; + turn_553648230[0] = true; + baseDrafts_553648241[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftRandNumber", kxi__)), 10); + draftsLeft_553648244[0] = subInt(baseDrafts_553648241[0], 1); + draftChoices_553648243[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceRandNumber", kxi__)), 10); + draft_553649976([], []); + + + } + +function HEX3Aanonymous_553650550(__553650551, __553650552) { + peer_553648228[0].Field0("draft:start"); + currentScreen_553648276[0] = 5; + gameMode_553648278[0] = 3; + turn_553648230[0] = true; + baseDrafts_553648241[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftSuperRandNumber", kxi__)), 10); + draftsLeft_553648244[0] = subInt(baseDrafts_553648241[0], 1); + draftChoices_553648243[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceSuperRandNumber", kxi__)), 10); + draft_553649976([], []); + + + } + + var result_553650490 = null; + + var tmp_553650491 = tree_754975616(44, []); + tmp_553650491.class = "main"; + if ((side_553648229[0] == 0)) { + add_754975552(tmp_553650491, text_754975684([87,97,105,116,105,110,103,32,102,111,114,32,104,111,115,116,32,116,111,32,100,101,99,105,100,101,32,114,117,108,101,115,101,116,46,46,46])); + } + else { + var tmp_553650492 = tree_754975616(44, []); + tmp_553650492.class = "column cut-down"; + var tmp_553650493 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650493, 0, HEX3Aanonymous_553650519, kxi__); + add_754975552(tmp_553650493, text_754975684([78,111,114,109,97,108,32,67,104,101,115,115])); + add_754975552(tmp_553650492, tmp_553650493); + add_754975552(tmp_553650492, text_754975684([67,108,97,115,115,105,99,32,67,104,101,115,115,44,32,119,105,116,104,32,110,111,32,115,112,101,99,105,97,108,32,114,117,108,101,115,32,111,114,32,97,98,105,108,105,116,101,115,46])); + add_754975552(tmp_553650491, tmp_553650492); + var tmp_553650494 = tree_754975616(44, []); + tmp_553650494.class = "column cut-down"; + var tmp_553650495 = tree_754975616(44, []); + tmp_553650495.class = "column"; + var tmp_553650496 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650496, 0, HEX3Aanonymous_553650524, kxi__); + add_754975552(tmp_553650496, text_754975684([68,114,97,102,116,32,109,111,100,101])); + add_754975552(tmp_553650495, tmp_553650496); + add_754975552(tmp_553650495, text_754975684(makeNimstrLit("Take turns drafting power ups for your pieces, then play. \x0A Each side is guaranteed to get power ups of the same tier."))); + var tmp_553650497 = tree_754975616(193, []); + setAttr_754975467(tmp_553650497, "for", "draftTierNumber"); + add_754975552(tmp_553650497, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); + add_754975552(tmp_553650495, tmp_553650497); + var tmp_553650498 = tree_754975616(194, []); + tmp_553650498.id = "draftTierNumber"; + setAttr_754975467(tmp_553650498, "type", "number"); + addEventHandler_721422110(tmp_553650498, 8, validateNotEmpty_553650172("draftTierNumber"), kxi__); + setAttr_754975467(tmp_553650498, "step", "1"); + setAttr_754975467(tmp_553650498, "min", "1"); + setAttr_754975467(tmp_553650498, "max", "10"); + valueHEX3D_754975173(tmp_553650498, "3"); + setAttr_754975467(tmp_553650498, "value", "3"); + add_754975552(tmp_553650495, tmp_553650498); + var tmp_553650499 = tree_754975616(193, []); + setAttr_754975467(tmp_553650499, "for", "draftChoiceTierNumber"); + add_754975552(tmp_553650499, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); + add_754975552(tmp_553650495, tmp_553650499); + var tmp_553650500 = tree_754975616(194, []); + tmp_553650500.id = "draftChoiceTierNumber"; + setAttr_754975467(tmp_553650500, "type", "number"); + addEventHandler_721422110(tmp_553650500, 8, validateNotEmpty_553650172("draftChoiceTierNumber"), kxi__); + setAttr_754975467(tmp_553650500, "step", "1"); + setAttr_754975467(tmp_553650500, "min", "1"); + setAttr_754975467(tmp_553650500, "max", "5"); + valueHEX3D_754975173(tmp_553650500, "3"); + setAttr_754975467(tmp_553650500, "value", "3"); + add_754975552(tmp_553650495, tmp_553650500); + add_754975552(tmp_553650494, tmp_553650495); + var tmp_553650501 = tree_754975616(33, []); + add_754975552(tmp_553650494, tmp_553650501); + var tmp_553650502 = tree_754975616(44, []); + tmp_553650502.class = "column"; + var tmp_553650503 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650503, 0, HEX3Aanonymous_553650545, kxi__); + add_754975552(tmp_553650503, text_754975684([82,97,110,100,111,109,32,109,111,100,101])); + add_754975552(tmp_553650502, tmp_553650503); + add_754975552(tmp_553650502, text_754975684(makeNimstrLit("Draft powerups of random strength and quality, then play. \x0A Completely luck based."))); + var tmp_553650504 = tree_754975616(193, []); + setAttr_754975467(tmp_553650504, "for", "draftRandNumber"); + add_754975552(tmp_553650504, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); + add_754975552(tmp_553650502, tmp_553650504); + var tmp_553650505 = tree_754975616(194, []); + tmp_553650505.id = "draftRandNumber"; + setAttr_754975467(tmp_553650505, "type", "number"); + addEventHandler_721422110(tmp_553650505, 8, validateNotEmpty_553650172("draftRandNumber"), kxi__); + setAttr_754975467(tmp_553650505, "step", "1"); + setAttr_754975467(tmp_553650505, "min", "1"); + setAttr_754975467(tmp_553650505, "max", "10"); + valueHEX3D_754975173(tmp_553650505, "3"); + setAttr_754975467(tmp_553650505, "value", "3"); + add_754975552(tmp_553650502, tmp_553650505); + var tmp_553650506 = tree_754975616(193, []); + setAttr_754975467(tmp_553650506, "for", "draftChoiceRandNumber"); + add_754975552(tmp_553650506, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); + add_754975552(tmp_553650502, tmp_553650506); + var tmp_553650507 = tree_754975616(194, []); + tmp_553650507.id = "draftChoiceRandNumber"; + setAttr_754975467(tmp_553650507, "type", "number"); + addEventHandler_721422110(tmp_553650507, 8, validateNotEmpty_553650172("draftChoiceRandNumber"), kxi__); + setAttr_754975467(tmp_553650507, "step", "1"); + setAttr_754975467(tmp_553650507, "min", "1"); + setAttr_754975467(tmp_553650507, "max", "5"); + valueHEX3D_754975173(tmp_553650507, "3"); + setAttr_754975467(tmp_553650507, "value", "3"); + add_754975552(tmp_553650502, tmp_553650507); + add_754975552(tmp_553650494, tmp_553650502); + var tmp_553650508 = tree_754975616(33, []); + add_754975552(tmp_553650494, tmp_553650508); + var tmp_553650509 = tree_754975616(44, []); + tmp_553650509.class = "column"; + var tmp_553650510 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650510, 0, HEX3Aanonymous_553650550, kxi__); + add_754975552(tmp_553650510, text_754975684([83,117,112,101,114,32,82,97,110,100,111,109,32,109,111,100,101])); + add_754975552(tmp_553650509, tmp_553650510); + add_754975552(tmp_553650509, text_754975684(makeNimstrLit("Draft powerups of random strength and quality, then play. \x0A Completely luck based, with higher chances for rare pieces."))); + var tmp_553650511 = tree_754975616(193, []); + setAttr_754975467(tmp_553650511, "for", "draftSuperRandNumber"); + add_754975552(tmp_553650511, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); + add_754975552(tmp_553650509, tmp_553650511); + var tmp_553650512 = tree_754975616(194, []); + tmp_553650512.id = "draftSuperRandNumber"; + setAttr_754975467(tmp_553650512, "type", "number"); + addEventHandler_721422110(tmp_553650512, 8, validateNotEmpty_553650172("draftSuperRandNumber"), kxi__); + setAttr_754975467(tmp_553650512, "step", "1"); + setAttr_754975467(tmp_553650512, "min", "1"); + setAttr_754975467(tmp_553650512, "max", "10"); + valueHEX3D_754975173(tmp_553650512, "3"); + setAttr_754975467(tmp_553650512, "value", "3"); + add_754975552(tmp_553650509, tmp_553650512); + var tmp_553650513 = tree_754975616(193, []); + setAttr_754975467(tmp_553650513, "for", "draftChoiceSuperRandNumber"); + add_754975552(tmp_553650513, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); + add_754975552(tmp_553650509, tmp_553650513); + var tmp_553650514 = tree_754975616(194, []); + tmp_553650514.id = "draftChoiceSuperRandNumber"; + setAttr_754975467(tmp_553650514, "type", "number"); + addEventHandler_721422110(tmp_553650514, 8, validateNotEmpty_553650172("draftChoiceSuperRandNumber"), kxi__); + setAttr_754975467(tmp_553650514, "step", "1"); + setAttr_754975467(tmp_553650514, "min", "1"); + setAttr_754975467(tmp_553650514, "max", "5"); + valueHEX3D_754975173(tmp_553650514, "3"); + setAttr_754975467(tmp_553650514, "value", "3"); + add_754975552(tmp_553650509, tmp_553650514); + add_754975552(tmp_553650494, tmp_553650509); + add_754975552(tmp_553650491, tmp_553650494); + } + + result_553650490 = tmp_553650491; + + return result_553650490; + +} + +function createPowerMenu_553650555(p_553650556) { + var Temporary1; + p_553650556 = nimCopy(null, p_553650556, NTI1728053254); + +function HEX3Aanonymous_553650571(__553650572, __553650573) { + peer_553648228[0].Field0(toJSStr(([100,114,97,102,116,58,109,121,44] || []).concat(HEX24_385875976(p_553650556.index) || []))); + var Temporary1 = nimCopy(null, p_553650556, NTI1728053254); + myDrafts_553648235[0].push(Temporary1);; + turn_553648230[0] = false; + if ((side_553648229[0] == 1)) { + draft_553649976(HEX26_1728054083(myDrafts_553648235[0], opponentDrafts_553648240[0]), opponentDrafts_553648240[0]); + Label2: { + var iHEX60gensym159_553650606 = 0; + var resultHEX60gensym159_553650613 = newSeq_536871458(chckRange((draftOptions_553648242[0]).length, 0, 2147483647)); + Label3: { + var it_553650617 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652830 = 0; + var L_553652831 = (draftOptions_553648242[0]).length; + Label4: { + Label5: while (true) { + if (!(i_553652830 < L_553652831)) break Label5; + it_553650617 = draftOptions_553648242[0][chckIndx(i_553652830, 0, (draftOptions_553648242[0]).length - 1)]; + resultHEX60gensym159_553650613[chckIndx(iHEX60gensym159_553650606, 0, (resultHEX60gensym159_553650613).length - 1)] = nimCopy(null, ([44] || []).concat(HEX24_385875976(it_553650617.index) || []), NTI33554449); + iHEX60gensym159_553650606 = addInt(iHEX60gensym159_553650606, 1); + i_553652830 += 1; + if (!(((draftOptions_553648242[0]).length == L_553652831))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + }; + var sHEX60gensym162_553650629 = nimCopy(null, resultHEX60gensym159_553650613, NTI536871233); + var nHEX60gensym162_553650633 = (sHEX60gensym162_553650629).length; + if (!((0 < nHEX60gensym162_553650633))) { + failedAssertImpl_268435541(makeNimstrLit("sequtils.nim(977, 3) `n`gensym162 > 0` Can\'t fold empty sequences")); + } + + var resultHEX60gensym162_553650639 = nimCopy(null, sHEX60gensym162_553650629[chckIndx(subInt(nHEX60gensym162_553650633, 1), 0, (sHEX60gensym162_553650629).length - 1)], NTI33554449); + Label6: { + var iHEX60gensym162_553650645 = 0; + var colontmp__553652834 = 0; + colontmp__553652834 = subInt(nHEX60gensym162_553650633, 2); + var res_553652835 = colontmp__553652834; + Label7: { + Label8: while (true) { + if (!(0 <= res_553652835)) break Label8; + iHEX60gensym162_553650645 = res_553652835; + var a_553650646 = nimCopy(null, sHEX60gensym162_553650629[chckIndx(iHEX60gensym162_553650645, 0, (sHEX60gensym162_553650629).length - 1)], NTI33554449); + var b_553650647 = nimCopy(null, resultHEX60gensym162_553650639, NTI33554449); + resultHEX60gensym162_553650639 = nimCopy(null, (a_553650646 || []).concat(b_553650647 || []), NTI33554449); + res_553652835 = subInt(res_553652835, 1); + } + }; + }; + peer_553648228[0].Field0(toJSStr(([100,114,97,102,116,58,103,111] || []).concat(resultHEX60gensym162_553650639 || []))); + } + + + + } + + var result_553650557 = null; + + var tmp_553650558 = tree_754975616(44, []); + tmp_553650558.class = "power"; + var tmp_553650559 = tree_754975616(21, []); + if ((showTechnicalNames_553648272[0] && !(eqStrings(p_553650556.technicalName, [])))) { + Temporary1 = p_553650556.technicalName; + } + else { + Temporary1 = p_553650556.name; + } + + add_754975552(tmp_553650559, text_754975684(Temporary1)); + add_754975552(tmp_553650558, tmp_553650559); + if (!(eqStrings(p_553650556.icon, []))) { + var src_553650564 = [46,47,105,99,111,110,115,47]; + if (!(p_553650556.noColor)) { + src_553650564.push.apply(src_553650564, reprEnum(side_553648229[0], NTI1476395015));; + } + + var tmp_553650560 = tree_754975616(76, []); + setAttr_754975467(tmp_553650560, "src", toJSStr((src_553650564 || []).concat(p_553650556.icon || []))); + add_754975552(tmp_553650558, tmp_553650560); + } + else { + var tmp_553650561 = tree_754975616(76, []); + setAttr_754975467(tmp_553650561, "src", "./icons/blackbishop.svg"); + add_754975552(tmp_553650558, tmp_553650561); + } + + var tmp_553650562 = tree_754975616(22, []); + add_754975552(tmp_553650562, text_754975684(reprEnum(p_553650556.tier, NTI1728053251))); + add_754975552(tmp_553650558, tmp_553650562); + var tmp_553650563 = tree_754975616(32, []); + add_754975552(tmp_553650563, text_754975684(p_553650556.description)); + add_754975552(tmp_553650558, tmp_553650563); + addEventHandler_721422102(tmp_553650558, 0, HEX3Aanonymous_553650571, kxi__); + result_553650557 = tmp_553650558; + + return result_553650557; + +} + +function createDraftMenu_553650652() { + var result_553650653 = null; + + var tmp_553650654 = tree_754975616(44, []); + tmp_553650654.class = "main power-menu"; + if (turn_553648230[0]) { + Label1: { + var p_553650658 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var i_553652816 = 0; + var L_553652817 = (draftOptions_553648242[0]).length; + Label2: { + Label3: while (true) { + if (!(i_553652816 < L_553652817)) break Label3; + p_553650658 = draftOptions_553648242[0][chckIndx(i_553652816, 0, (draftOptions_553648242[0]).length - 1)]; + add_754975552(tmp_553650654, createPowerMenu_553650555(p_553650658)); + i_553652816 += 1; + if (!(((draftOptions_553648242[0]).length == L_553652817))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + } + else { + add_754975552(tmp_553650654, text_754975684([79,112,112,111,110,101,110,116,32,105,115,32,100,114,97,102,116,105,110,103,46,46,46])); + } + + result_553650653 = tmp_553650654; + + return result_553650653; + +} + +function replaceAnySynergies_1728054542(powers_1728054543) { + var result_1728054544 = []; + + BeforeRet: { + result_1728054544 = nimCopy(null, secretSynergize_1728053625(powers_1728054543, secretSynergies_1728053324[0]), NTI1728053494); + break BeforeRet; + }; + + return result_1728054544; + +} + +function createPowerSummary_553650659(p_553650660, ofSide_553650661) { + var Temporary1; + + var result_553650662 = null; + + var class_553650663 = [105,109,97,103,101,32]; + if ((!((side_553648229[0] == ofSide_553650661)) && p_553650660.rotatable)) { + class_553650663.push.apply(class_553650663, [32,114,111,116,97,116,101,32]);; + } + + var src_553650668 = [46,47,105,99,111,110,115,47]; + if (!(p_553650660.noColor)) { + src_553650668.push.apply(src_553650668, reprEnum(ofSide_553650661, NTI1476395015));; + } + + var tmp_553650672 = tree_754975616(44, []); + tmp_553650672.class = "power-grid"; + var tmp_553650673 = tree_754975616(24, []); + tmp_553650673.class = "title"; + if ((showTechnicalNames_553648272[0] && !(eqStrings(p_553650660.technicalName, [])))) { + Temporary1 = p_553650660.technicalName; + } + else { + Temporary1 = p_553650660.name; + } + + add_754975552(tmp_553650673, text_754975684(Temporary1)); + add_754975552(tmp_553650672, tmp_553650673); + var tmp_553650674 = tree_754975616(32, []); + tmp_553650674.class = "desc"; + add_754975552(tmp_553650674, text_754975684(p_553650660.description)); + add_754975552(tmp_553650672, tmp_553650674); + if (!(eqStrings(p_553650660.icon, []))) { + var tmp_553650675 = tree_754975616(76, []); + tmp_553650675.class = toJSStr(class_553650663); + setAttr_754975467(tmp_553650675, "src", toJSStr((src_553650668 || []).concat(p_553650660.icon || []))); + add_754975552(tmp_553650672, tmp_553650675); + } + else { + var tmp_553650676 = tree_754975616(76, []); + tmp_553650676.class = toJSStr(class_553650663); + setAttr_754975467(tmp_553650676, "src", "./icons/blackbishop.svg"); + add_754975552(tmp_553650672, tmp_553650676); + } + + result_553650662 = tmp_553650672; + + return result_553650662; + +} + +function isSelected_553648339(n_553648340, m_553648341) { + var result_553648342 = false; + + BeforeRet: { + result_553648342 = ((selectedTile_553648251[0].Field1 == n_553648340) && (selectedTile_553648251[0].Field0 == m_553648341)); + break BeforeRet; + }; + + return result_553648342; + +} + +function formatValue_553649687(result_553649690, result_553649690_Idx, value_553649691) { + result_553649690[result_553649690_Idx].push.apply(result_553649690[result_553649690_Idx], HEX24_385875976(value_553649691));; + + +} + +function setAttr_754975512(n_754975513, key_754975514, val_754975515) { + var Temporary1; + + if (val_754975515) { + Temporary1 = ""; + } + else { + Temporary1 = null; + } + + setAttr_754975467(n_754975513, key_754975514, Temporary1); + + +} + +function sendAction_553649085(data_553649086, end_553649087) { + if (end_553649087) { + theState_553648248[0].Field0.turnNumber = addInt(theState_553648248[0].Field0.turnNumber, 1); + } + + if (false) { + Label1: { + var fmtRes_553649097 = [mnewString(0)]; + fmtRes_553649097[0].push.apply(fmtRes_553649097[0], [97,99,116,105,111,110,58]);; + formatValue_553649009(fmtRes_553649097, 0, data_553649086); + }; + peer_553648228[0].Field0(toJSStr(fmtRes_553649097[0])); + if (end_553649087) { + turn_553648230[0] = false; + rawEcho([115,101,110,100,32,97,99,116,105,111,110,32,99,104,97,110,103,105,110,103,32,116,117,114,110]); + } + + } + + if (end_553649087) { + endRound_553648391(); + } + + + +} + +function sendBuy_553649654(option_553649655, tile_553649656) { + Label1: { + var fmtRes_553649661 = [mnewString(0)]; + fmtRes_553649661[0].push.apply(fmtRes_553649661[0], [98,117,121,44]);; + formatValue_553649009(fmtRes_553649661, 0, option_553649655.Field0); + fmtRes_553649661[0].push.apply(fmtRes_553649661[0], [44]);; + formatValue_553649009(fmtRes_553649661, 0, HEX24_385875976(tile_553649656.Field1)); + fmtRes_553649661[0].push.apply(fmtRes_553649661[0], [44]);; + formatValue_553649009(fmtRes_553649661, 0, HEX24_385875976(tile_553649656.Field0)); + }; + sendAction_553649085(fmtRes_553649661[0], false); + + +} + +function clear_553648382() { + var colontmp__553652862 = (-1); + var colontmp__553652863 = (-1); + selectedTile_553648251[0] = nimCopy(selectedTile_553648251[0], {Field0: colontmp__553652862, Field1: colontmp__553652863}, NTI1476395011); + possibleMoves_553648256[0] = nimCopy(null, [], NTI1543504077); + possibleTakes_553648261[0] = nimCopy(null, [], NTI1543504077); + + +} + +function createBuyButton_553650677(option_553650678, p_553650679) { + var Temporary1; + var Temporary2; + option_553650678 = nimCopy(null, option_553650678, NTI1476395026); + +function HEX3Aanonymous_553650707(__553650708, __553650709) { + sendBuy_553649654(option_553650678, p_553650679.tile); + buy_1828716652(p_553650679, option_553650678, theBoard_553648247[0], theState_553648248[0]); + clear_553648382(); + + + } + + var result_553650680 = null; + + BeforeRet: { + if (!(option_553650678.Field3(p_553650679, theBoard_553648247[0], theState_553648248[0]))) { + var tmp_553650681 = tree_754975616(44, []); + result_553650680 = tmp_553650681; + break BeforeRet; + } + else { + var cost_553650682 = option_553650678.Field1(p_553650679, theBoard_553648247[0], theState_553648248[0]); + var disabled_553650683 = (!(turn_553648230[0]) || (getMoney_1828716559(side_553648229[0], theState_553648248[0]) < cost_553650682)); + if ((0 <= cost_553650682)) { + Temporary2 = [45]; + } + else { + Temporary2 = [43]; + } + + var sign_553650684 = nimCopy(null, Temporary2, NTI33554449); + var tmp_553650685 = tree_754975616(195, []); + setAttr_754975512(tmp_553650685, "disabled", disabled_553650683); + Label3: { + var fmtRes_553650690 = [mnewString(0)]; + formatValue_553649009(fmtRes_553650690, 0, option_553650678.Field0); + fmtRes_553650690[0].push.apply(fmtRes_553650690[0], [58,32]);; + formatValue_553649009(fmtRes_553650690, 0, sign_553650684); + fmtRes_553650690[0].push.apply(fmtRes_553650690[0], [36]);; + formatValue_553649687(fmtRes_553650690, 0, absInt(cost_553650682)); + }; + add_754975552(tmp_553650685, text_754975684(fmtRes_553650690[0])); + addEventHandler_721422102(tmp_553650685, 0, HEX3Aanonymous_553650707, kxi__); + Temporary1 = tmp_553650685; + } + + result_553650680 = Temporary1; + }; + + return result_553650680; + +} + +function createPieceProfile_553650710(p_553650711) { + var result_553650712 = null; - + var imgClass_553650713 = []; + if ((!((side_553648229[0] == p_553650711.color)) && p_553650711.rotate)) { + imgClass_553650713.push.apply(imgClass_553650713, [114,111,116,97,116,101,32]);; } -function HEX3Aanonymous_553649029(ev_553649030, __553649031) { - currentScreen_553648240[0] = 10; - - + var src_553650718 = [46,47,105,99,111,110,115,47]; + if (p_553650711.colorable) { + src_553650718.push.apply(src_553650718, reprEnum(p_553650711.color, NTI1476395015));; + } + + var name_553650725 = reprEnum(p_553650711.item, NTI1476395014); + var tmp_553650726 = tree_754975616(44, []); + tmp_553650726.class = " piece-row "; + var tmp_553650727 = tree_754975616(24, []); + add_754975552(tmp_553650727, text_754975684(name_553650725)); + add_754975552(tmp_553650726, tmp_553650727); + var tmp_553650728 = tree_754975616(76, []); + tmp_553650728.class = toJSStr(imgClass_553650713); + setAttr_754975467(tmp_553650728, "src", toJSStr((src_553650718 || []).concat(p_553650711.filePath || []))); + add_754975552(tmp_553650726, tmp_553650728); + var tmp_553650729 = tree_754975616(32, []); + tmp_553650729.class = "take"; + Label1: { + var fmtRes_553650735 = [mnewString(0)]; + fmtRes_553650735[0].push.apply(fmtRes_553650735[0], [75,105,108,108,115,58,32]);; + formatValue_553649687(fmtRes_553650735, 0, p_553650711.piecesTaken); + fmtRes_553650735[0].push.apply(fmtRes_553650735[0], [32,112,105,101,99,101,115,46]);; + }; + add_754975552(tmp_553650729, text_754975684(fmtRes_553650735[0])); + add_754975552(tmp_553650726, tmp_553650729); + if (isColor_1476396138(p_553650711, side_553648229[0])) { + var tmp_553650730 = tree_754975616(44, []); + tmp_553650730.class = "row"; + Label2: { + var option_553650745 = {Field0: [], Field1: null, Field2: null, Field3: null}; + var colontmp__553652855 = []; + colontmp__553652855 = theState_553648248[0].Field1[chckIndx(p_553650711.color, 0, (theState_553648248[0].Field1).length - 1)].buys; + var i_553652856 = 0; + var L_553652857 = (colontmp__553652855).length; + Label3: { + Label4: while (true) { + if (!(i_553652856 < L_553652857)) break Label4; + option_553650745 = colontmp__553652855[chckIndx(i_553652856, 0, (colontmp__553652855).length - 1)]; + add_754975552(tmp_553650730, createBuyButton_553650677(option_553650745, p_553650711)); + i_553652856 += 1; + if (!(((colontmp__553652855).length == L_553652857))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + add_754975552(tmp_553650726, tmp_553650730); } + + result_553650712 = tmp_553650726; - var result_553648960 = null; - - var tmp_553648961 = tree_754975616(44, []); - tmp_553648961.class = "start-column height-100"; - var tmp_553648962 = tree_754975616(44, []); - tmp_553648962.class = "main"; - var tmp_553648963 = tree_754975616(44, []); - tmp_553648963.class = "start-column"; - var tmp_553648964 = tree_754975616(195, []); - tmp_553648964.class = "menu-button"; - add_754975552(tmp_553648964, text_754975684([74,111,105,110,32,97,32,82,111,111,109])); - addEventHandler_721422102(tmp_553648964, 0, HEX3Aanonymous_553648969, kxi__); - add_754975552(tmp_553648963, tmp_553648964); - var tmp_553648965 = tree_754975616(195, []); - tmp_553648965.class = "menu-button"; - add_754975552(tmp_553648965, text_754975684([83,101,101,32,80,111,119,101,114,115])); - addEventHandler_721422102(tmp_553648965, 0, HEX3Aanonymous_553648972, kxi__); - add_754975552(tmp_553648963, tmp_553648965); - add_754975552(tmp_553648962, tmp_553648963); - var tmp_553648966 = tree_754975616(44, []); - tmp_553648966.class = "start-column"; - var tmp_553648967 = tree_754975616(195, []); - tmp_553648967.class = "menu-button"; - add_754975552(tmp_553648967, text_754975684([67,114,101,97,116,101,32,97,32,82,111,111,109])); - addEventHandler_721422102(tmp_553648967, 0, HEX3Aanonymous_553648975, kxi__); - add_754975552(tmp_553648966, tmp_553648967); - var tmp_553648968 = tree_754975616(195, []); - tmp_553648968.class = "menu-button"; - add_754975552(tmp_553648968, text_754975684([79,116,104,101,114])); - addEventHandler_721422102(tmp_553648968, 0, HEX3Aanonymous_553649029, kxi__); - add_754975552(tmp_553648966, tmp_553648968); - add_754975552(tmp_553648962, tmp_553648966); - add_754975552(tmp_553648961, tmp_553648962); - result_553648960 = tmp_553648961; - - return result_553648960; + return result_553650712; } -function text_754975687(s_754975688) { - var result_754975689 = null; +function getKing_1476396334(side_1476396335, board_1476396336) { + var result_1476396337 = {Field0: 0, Field1: 0}; - result_754975689 = {kind: 0, text: s_754975688, index: (-1), m_type: NTI754974820, id: null, class: null, kids: [], attrs: [], events: [], style: null, styleVersion: 0, dom: null}; + BeforeRet: { + Label1: { + var i_1476396338 = 0; + var j_1476396339 = 0; + Label2: { + var i_553652866 = 0; + var i_553652867 = 0; + Label3: { + Label4: while (true) { + if (!(i_553652867 < 8)) break Label4; + i_553652866 = i_553652867; + Label5: { + var j_553652870 = 0; + var i_553652871 = 0; + Label6: { + Label7: while (true) { + if (!(i_553652871 < 8)) break Label7; + j_553652870 = i_553652871; + i_1476396338 = i_553652866; + j_1476396339 = j_553652870; + if (((board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)][chckIndx(j_1476396339, 0, (board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)]).length - 1)].item == 0) && (board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)][chckIndx(j_1476396339, 0, (board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)]).length - 1)].color == side_1476396335))) { + result_1476396337 = nimCopy(result_1476396337, board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)][chckIndx(j_1476396339, 0, (board_1476396336[chckIndx(i_1476396338, 0, (board_1476396336).length - 1)]).length - 1)].tile, NTI1476395011); + break BeforeRet; + } + + i_553652871 = addInt(i_553652871, 1); + } + }; + }; + i_553652867 = addInt(i_553652867, 1); + } + }; + }; + }; + }; - return result_754975689; + return result_1476396337; } -function createRoomMenu_553649048() { - var result_553649049 = null; +function isSome_1895825465(self_1895825467) { + var result_1895825468 = false; - var tmp_553649050 = tree_754975616(44, []); - tmp_553649050.class = "main"; - if (!(roomId_553648188[0].Field0)) { - add_754975552(tmp_553649050, text_754975684([67,114,101,97,116,105,110,103,32,114,111,111,109,32,107,101,121])); - } - else { - var tmp_553649051 = tree_754975616(22, []); - add_754975552(tmp_553649051, text_754975684([82,111,111,109,32,75,101,121,58,32])); - add_754975552(tmp_553649050, tmp_553649051); - var tmp_553649052 = tree_754975616(72, []); - add_754975552(tmp_553649050, tmp_553649052); - add_754975552(tmp_553649050, text_754975687(roomId_553648188[0].Field1)); - } - - result_553649049 = tmp_553649050; + result_1895825468 = self_1895825467.has; - return result_553649049; + return result_1895825468; } -function setAttr_754975467(n_754975468, key_754975469, val_754975470) { +function hasGlass_1895825432(side_1895825433, state_1895825434) { + var result_1895825435 = false; + BeforeRet: { - if (((n_754975468.attrs).length == 0)) { - n_754975468.attrs = nimCopy(null, [key_754975469, val_754975470], NTI754975006); - } - else { - Label1: { - var i_754975487 = 0; - var colontmp__553649901 = 0; - colontmp__553649901 = subInt((n_754975468.attrs).length, 2); - var res_553649902 = 0; - Label2: { - Label3: while (true) { - if (!(res_553649902 <= colontmp__553649901)) break Label3; - i_754975487 = res_553649902; - if ((n_754975468.attrs[chckIndx(i_754975487, 0, (n_754975468.attrs).length - 1)] == key_754975469)) { - n_754975468.attrs[chckIndx(addInt(i_754975487, 1), 0, (n_754975468.attrs).length - 1)] = val_754975470; + Label1: { + var g_1895825460 = 0; + Label2: { + var v_553652879 = 0; + var res_553652880 = 0; + Label3: { + Label4: while (true) { + if (!(res_553652880 <= 2)) break Label4; + v_553652879 = res_553652880; + g_1895825460 = v_553652879; + if (isSome_1895825465(state_1895825434.Field1[chckIndx(side_1895825433, 0, (state_1895825434.Field1).length - 1)].glass[chckIndx(g_1895825460, 0, (state_1895825434.Field1[chckIndx(side_1895825433, 0, (state_1895825434.Field1).length - 1)].glass).length - 1)])) { + result_1895825435 = true; break BeforeRet; } - res_553649902 = addInt(res_553649902, 2); + res_553652880 = addInt(res_553652880, 1); } }; }; - n_754975468.attrs.push(key_754975469);; - n_754975468.attrs.push(val_754975470);; - } - + }; + result_1895825435 = false; + break BeforeRet; }; - -} - -function addEventHandler_721422110(n_721422111, k_721422112, action_721422114, kxi_721422115) { - -function wrapper_721422116(ev_721422117, n_721422118) { - action_721422114(); - if (!(kxi_721422115.surpressRedraws)) { - redraw_721421809(kxi_721422115); - } - - - - } - - addEventListener_754975735(n_721422111, k_721422112, wrapper_721422116); + return result_1895825435; - } -function getInputText_721422193(n_721422194) { - var result_721422195 = null; +function isNone_553651049(self_553651051) { + var result_553651052 = false; - if (!((n_721422194.dom == null))) { - result_721422195 = n_721422194.dom.value; - } - + result_553651052 = !(self_553651051.has); - return result_721422195; + return result_553651052; } -function getVNodeById_721420594(id_721420595, kxi_721420596) { - var result_721420597 = null; +function get_553651066(self_553651068) { + var result_553651069 = null; + var result_553651069_Idx = 0; - if (kxi_721420596.byId.hasOwnProperty(id_721420595)) { - result_721420597 = kxi_721420596.byId[id_721420595]; + BeforeRet: { + if (isNone_553651049(self_553651068)) { + raiseException({message: [67,97,110,39,116,32,111,98,116,97,105,110,32,97,32,118,97,108,117,101,32,102,114,111,109,32,97,32,96,110,111,110,101,96], parent: null, m_type: NTI1493172247, name: null, trace: [], up: null}, "UnpackDefect"); } + result_553651069 = self_553651068; result_553651069_Idx = "val"; + break BeforeRet; + }; - return result_721420597; + return [result_553651069, result_553651069_Idx]; } -function getError_1459617819(field_1459617820) { - var result_1459617821 = null; +function some_553651098(val_553651100) { + var result_553651101 = ({val: 0, has: false}); - if (!(gerrorMsgs_1459617798[0].hasOwnProperty(field_1459617820))) { - result_1459617821 = ""; - } - else { - result_1459617821 = gerrorMsgs_1459617798[0][field_1459617820]; - } - + result_553651101.has = true; + result_553651101.val = val_553651100; - return result_1459617821; + return result_553651101; } -function setError_1459617834(field_1459617835, msg_1459617836) { - var previous_1459617837 = getError_1459617819(field_1459617835); - if ((((msg_1459617836) == null ? 0 : (msg_1459617836).length) == 0)) { - if (!((((previous_1459617837) == null ? 0 : (previous_1459617837).length) == 0))) { - gerrorCounter_1459617799[0] = subInt(gerrorCounter_1459617799[0], 1); - } - - } - else { - if ((((previous_1459617837) == null ? 0 : (previous_1459617837).length) == 0)) { - gerrorCounter_1459617799[0] = addInt(gerrorCounter_1459617799[0], 1); - } - - } +function createGlassOnClick_553651036(glass_553651037) { - gerrorMsgs_1459617798[0][field_1459617835] = msg_1459617836; - - -} +function HEX3Aanonymous_553651042(__553651043, __553651044) { + var Temporary1; -function validateNotEmpty_553648791(field_553648792) { - -function HEX3Aanonymous_553648795() { - var x_553648796 = getInputText_721422193(getVNodeById_721420594(field_553648792, kxi__)); - if (((x_553648796 == null) || (x_553648796 == ""))) { - setError_1459617834(field_553648792, (field_553648792 + " must not be empty")); + if ((isNone_553651049(selectedGlass_553648293[0]) || !(((Temporary1 = get_553651066(selectedGlass_553648293[0]), Temporary1)[0][Temporary1[1]] == glass_553651037)))) { + selectedGlass_553648293[0] = nimCopy(selectedGlass_553648293[0], some_553651098(glass_553651037), NTI553648225); } else { - setError_1459617834(field_553648792, ""); + selectedGlass_553648293[0] = nimCopy(selectedGlass_553648293[0], none_553648285(), NTI553648225); } } - var result_553648794 = null; + var result_553651041 = null; - result_553648794 = HEX3Aanonymous_553648795; + result_553651041 = HEX3Aanonymous_553651042; - return result_553648794; + return result_553651041; } -function len_754975743(a_754975744) { - var Temporary1; - - var result_754975745 = 0; +function isSome_553651174(self_553651176) { + var result_553651177 = false; - if ((a_754975744 == null)) { - Temporary1 = 0; - } - else { - Temporary1 = ((a_754975744) == null ? 0 : (a_754975744).length); - } - - result_754975745 = Temporary1; + result_553651177 = self_553651176.has; - return result_754975745; + return result_553651177; } -function toString_754975748(n_754975749, result_754975750, result_754975750_Idx, indent_754975751) { - Label1: { - var i_754975756 = 0; - var res_553649905 = 1; - Label2: { - Label3: while (true) { - if (!(res_553649905 <= indent_754975751)) break Label3; - i_754975756 = res_553649905; - addChar(result_754975750[result_754975750_Idx], 32);; - res_553649905 = addInt(res_553649905, 1); - } - }; - }; - if ((0 < (result_754975750[result_754975750_Idx]).length)) { - addChar(result_754975750[result_754975750_Idx], 10);; - } - - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([60] || []).concat(reprEnum(n_754975749.kind, NTI754974723) || []));; - if ((0 < len_754975743(n_754975749.id))) { - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32,105,100,32,61,32] || []).concat(cstrToNimstr(n_754975749.id) || []));; - } - - if ((0 < len_754975743(n_754975749.class))) { - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32,99,108,97,115,115,32,61,32] || []).concat(cstrToNimstr(n_754975749.class) || []));; - } - - Label4: { - var k_754975760 = null; - var v_754975761 = null; - Label5: { - var i_553649909 = 0; - var colontmp__553649910 = 0; - colontmp__553649910 = subInt((n_754975749.attrs).length, 2); - var res_553649911 = 0; - Label6: { - Label7: while (true) { - if (!(res_553649911 <= colontmp__553649910)) break Label7; - i_553649909 = res_553649911; - k_754975760 = n_754975749.attrs[chckIndx(i_553649909, 0, (n_754975749.attrs).length - 1)]; - v_754975761 = n_754975749.attrs[chckIndx(addInt(i_553649909, 1), 0, (n_754975749.attrs).length - 1)]; - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([32] || []).concat(cstrToNimstr(k_754975760) || [],[32,61,32] || [],cstrToNimstr(v_754975761) || []));; - res_553649911 = addInt(res_553649911, 2); - } - }; - }; - }; - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], [62,10]);; - if ((n_754975749.kind == 0)) { - add_33556373(result_754975750, result_754975750_Idx, n_754975749.text); - } - else { - if ((0 < len_754975743(n_754975749.text))) { - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], [32,118,97,108,117,101,32,61,32]);; - add_33556373(result_754975750, result_754975750_Idx, n_754975749.text); - } - - Label8: { - var child_754975767 = null; - Label9: { - var i_553649915 = 0; - var colontmp__553649916 = 0; - colontmp__553649916 = (n_754975749.kids).length; - var i_553649917 = 0; - Label10: { - Label11: while (true) { - if (!(i_553649917 < colontmp__553649916)) break Label11; - i_553649915 = i_553649917; - child_754975767 = n_754975749.kids[chckIndx(i_553649915, 0, (n_754975749.kids).length - 1)]; - toString_754975748(child_754975767, result_754975750, result_754975750_Idx, addInt(indent_754975751, 2)); - i_553649917 = addInt(i_553649917, 1); - } - }; - }; - }; - } - - Label12: { - var i_754975772 = 0; - var res_553649920 = 1; - Label13: { - Label14: while (true) { - if (!(res_553649920 <= indent_754975751)) break Label14; - i_754975772 = res_553649920; - addChar(result_754975750[result_754975750_Idx], 32);; - res_553649920 = addInt(res_553649920, 1); - } - }; - }; - result_754975750[result_754975750_Idx].push.apply(result_754975750[result_754975750_Idx], ([10,60,47] || []).concat(reprEnum(n_754975749.kind, NTI754974723) || [],[62] || []));; +function cancelAllPicks_553649941() { + promptHistory_553648313[0] = nimCopy(null, [], NTI1090519066); + promptStack_553648318[0] = nimCopy(null, [], NTI1090519066); + picks_553648327[0] = nimCopy(null, [], NTI1543504077); + picksLeft_553648319[0] = 0; + pickOptions_553648322[0] = nimCopy(null, [], NTI1543504077); + whenCollected_553648329[0] = null; + getPickOptions_553648321[0] = null; } -function HEX24_754975843(n_754975844) { - var result_754975845 = null; - - var res_754975846 = [[]]; - toString_754975748(n_754975844, res_754975846, 0, 0); - result_754975845 = toJSStr(res_754975846[0]); - - return result_754975845; +function cancelAllPicks_553649973(__553649974, __553649975) { + cancelAllPicks_553649941(); + } -function newJoin_1577058552(id_1577058553, cb_1577058557) { - -function HEX3Aanonymous_1577058566() { - -function HEX3Aanonymous_1577058578() { - var result_1577058579 = null; +function busy_553648343() { + var result_553648344 = false; - result_1577058579 = conn_1577058565.send(("handshake:hello")); + BeforeRet: { + result_553648344 = ((!(((actionStack_553648298[0]).length == 0)) || !((picksLeft_553648319[0] == 0))) || !(turn_553648230[0])); + break BeforeRet; + }; - return result_1577058579; + return result_553648344; - } - -function HEX3Aanonymous_1577058609(data_1577058610) { - cb_1577058557(cutMessage_1577058348(data_1577058610), messageType_1577058328(data_1577058610)); +} - - } +function formatValue_553651200(result_553651203, result_553651203_Idx, value_553651204) { + formatValue_553649009(result_553651203, result_553651203_Idx, reprEnum(value_553651204, NTI1476395027)); - conn_1577058565 = peer_1577058564.connect((("9e4ada91-c493-4fd4-881d-3e05db99e100" + id_1577058553))); - conn_1577058565.on(("open"), (HEX3Aanonymous_1577058578)); - conn_1577058565.on(("data"), (HEX3Aanonymous_1577058609)); + +} - - } - -function HEX3Aanonymous_1577058648() { - rawEcho([68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84,32,68,73,83,67,79,78,78,69,67,84]); - peer_1577058564.id = ("9e4ada91-c493-4fd4-881d-3e05db99e100" + id_1577058553); - peer_1577058564.reconnect(); +function newGroup_1476395648(s_1476395649) { + var result_1476395650 = 0; - - } - -function HEX3Aanonymous_1577058682() { - peer_1577058564.destroy(); + BeforeRet: { + s_1476395649.Field0.nextGroup = addInt(s_1476395649.Field0.nextGroup, 1); + result_1476395650 = s_1476395649.Field0.nextGroup; + break BeforeRet; + }; - - } - -function HEX3Aanonymous_1577058687(data_1577058688) { - conn_1577058565.send((data_1577058688)); + return result_1476395650; - - } +} - var result_1577058563 = {Field0: null, Field1: null}; +function reversed_553651309(a_553651311) { + var result_553651312 = []; - var peer_1577058564 = new Peer(null, {config: { - iceServers: [ - { - urls: "turn:standard.relay.metered.ca:80", - username: "4eadefa5a1ad93a461469d19", - credential: "wLlcdHP/D2ZcRAg/", - } - ] - } - }) -; - var conn_1577058565 = null; - peer_1577058564.on(("open"), (HEX3Aanonymous_1577058566)); - peer_1577058564.on(("disconnect"), (HEX3Aanonymous_1577058648)); - result_1577058563.Field1 = HEX3Aanonymous_1577058682; - result_1577058563.Field0 = HEX3Aanonymous_1577058687; + var n_553651316 = (a_553651311).length; + if (result_553651312.length < chckRange(n_553651316, 0, 2147483647)) { for (var i = result_553651312.length ; i < chckRange(n_553651316, 0, 2147483647) ; ++i) result_553651312.push([]); } + else { result_553651312.length = chckRange(n_553651316, 0, 2147483647); }; + Label1: { + var i_553651325 = 0; + var i_553652906 = 0; + Label2: { + Label3: while (true) { + if (!(i_553652906 < n_553651316)) break Label3; + i_553651325 = i_553652906; + result_553651312[chckIndx(i_553651325, 0, (result_553651312).length - 1)] = nimCopy(null, a_553651311[chckIndx(subInt(n_553651316, addInt(i_553651325, 1)), 0, (a_553651311).length - 1)], NTI33554449); + i_553652906 = addInt(i_553652906, 1); + } + }; + }; - return result_1577058563; + return result_553651312; } -function HEX5BHEX5D_553648736(s_553648740, x_553648741) { - var result_553648742 = []; +function cycle_553651283(s_553651285, n_553651286) { + var result_553651287 = []; - var a_553648744 = x_553648741.a; - var L_553648749 = addInt(subInt(subInt((s_553648740).length, x_553648741.b), a_553648744), 1); - result_553648742 = new Array(chckRange(L_553648749, 0, 2147483647)); for (var i = 0 ; i < chckRange(L_553648749, 0, 2147483647) ; ++i) { result_553648742[i] = []; } Label1: { - var i_553648758 = 0; - var i_553649938 = 0; + result_553651287 = nimCopy(null, newSeq_536871458(chckRange(mulInt(n_553651286, (s_553651285).length), 0, 2147483647)), NTI536871233); + var o_553651294 = 0; + Label1: { + var x_553651299 = 0; + var colontmp__553652912 = 0; + colontmp__553652912 = n_553651286; + var i_553652913 = 0; Label2: { Label3: while (true) { - if (!(i_553649938 < L_553648749)) break Label3; - i_553648758 = i_553649938; - result_553648742[chckIndx(i_553648758, 0, (result_553648742).length - 1)] = nimCopy(null, s_553648740[chckIndx(addInt(i_553648758, a_553648744), 0, (s_553648740).length - 1)], NTI33554449); - i_553649938 = addInt(i_553649938, 1); + if (!(i_553652913 < colontmp__553652912)) break Label3; + x_553651299 = i_553652913; + Label4: { + var e_553651303 = []; + var i_553652910 = 0; + Label5: { + Label6: while (true) { + if (!(i_553652910 < (s_553651285).length)) break Label6; + e_553651303 = s_553651285[chckIndx(i_553652910, 0, (s_553651285).length - 1)]; + result_553651287[chckIndx(o_553651294, 0, (result_553651287).length - 1)] = nimCopy(null, e_553651303, NTI33554449); + o_553651294 = addInt(o_553651294, 1); + i_553652910 += 1; + } + }; + }; + i_553652913 = addInt(i_553652913, 1); } }; }; - return result_553648742; + return result_553651287; } -function joinLogic_553648710(d_553648711, m_553648712) { - rawEcho(reprEnum(m_553648712, NTI1577058309), [32,111,102,32], d_553648711, [10]); - switch (m_553648712) { - case 3: - currentScreen_553648240[0] = 4; - side_553648195[0] = 0; - turn_553648196[0] = false; - initGame_553648271(); - break; - case 1: - executeOn_1728054240(myDrafts_553648201[0], 0, side_553648195[0], theBoard_553648213[0]); - executeOn_1728054240(opponentDrafts_553648206[0], 1, side_553648195[0], theBoard_553648213[0]); - Label1: { - var i_553648716 = 0; - var j_553648717 = 0; - Label2: { - var i_553649924 = 0; - var i_553649925 = 0; - Label3: { - Label4: while (true) { - if (!(i_553649925 < 8)) break Label4; - i_553649924 = i_553649925; - Label5: { - var j_553649928 = 0; - var i_553649929 = 0; - Label6: { - Label7: while (true) { - if (!(i_553649929 < 8)) break Label7; - j_553649928 = i_553649929; - i_553648716 = i_553649924; - j_553648717 = j_553649928; - theBoard_553648213[0][chckIndx(i_553648716, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648717, 0, (theBoard_553648213[0][chckIndx(i_553648716, 0, (theBoard_553648213[0]).length - 1)]).length - 1)].rand.Field1 = parseInt(roomId_553648188[0].Field1, 10); - i_553649929 = addInt(i_553649929, 1); - } +function packageGlass_1895825470(pieces_1895825471, tiles_1895825472, action_1895825473) { + tiles_1895825472 = nimCopy(null, tiles_1895825472, NTI1895825449); + +function HEX3Aanonymous_1895825547(board_1895825548, state_1895825549) { + Label1: { + var i_1895825550 = 0; + var j_1895825551 = 0; + Label2: { + var i_553652928 = 0; + var i_553652929 = 0; + Label3: { + Label4: while (true) { + if (!(i_553652929 < 8)) break Label4; + i_553652928 = i_553652929; + Label5: { + var j_553652932 = 0; + var i_553652933 = 0; + Label6: { + Label7: while (true) { + if (!(i_553652933 < 8)) break Label7; + j_553652932 = i_553652933; + i_1895825550 = i_553652928; + j_1895825551 = j_553652932; + Label8: { + var indexIndex_1895825575 = 0; + var index_1895825576 = 0; + var i_553652924 = 0; + var L_553652925 = (indexes_1895825546).length; + Label9: { + Label10: while (true) { + if (!(i_553652924 < L_553652925)) break Label10; + indexIndex_1895825575 = i_553652924; + index_1895825576 = indexes_1895825546[chckIndx(i_553652924, 0, (indexes_1895825546).length - 1)]; + if ((index_1895825576 == board_1895825548[chckIndx(i_1895825550, 0, (board_1895825548).length - 1)][chckIndx(j_1895825551, 0, (board_1895825548[chckIndx(i_1895825550, 0, (board_1895825548).length - 1)]).length - 1)].index)) { + action_1895825473(board_1895825548[chckIndx(i_1895825550, 0, (board_1895825548).length - 1)][chckIndx(j_1895825551, 0, (board_1895825548[chckIndx(i_1895825550, 0, (board_1895825548).length - 1)]).length - 1)], tiles_1895825472[chckIndx(indexIndex_1895825575, 0, (tiles_1895825472).length - 1)], board_1895825548, state_1895825549); + } + + i_553652924 += 1; + if (!(((indexes_1895825546).length == L_553652925))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + i_553652933 = addInt(i_553652933, 1); + } + }; }; - }; - i_553649925 = addInt(i_553649925, 1); - } + i_553652929 = addInt(i_553652929, 1); + } + }; }; }; - }; - currentScreen_553648240[0] = 3; - break; - case 6: - if (rematch_553648212[0]) { - rematch_553648212[0] = false; - peer_553648194[0].Field0("handshake:newgame"); - } - else { - rematch_553648212[0] = true; - } + - break; - case 4: - var x_553648718 = nsuSplitString(d_553648711, [44], (-1)); - if (eqStrings(d_553648711, [115,116,97,114,116])) { - currentScreen_553648240[0] = 5; - } - else { - if (eqStrings(x_553648718[chckIndx(0, 0, (x_553648718).length - 1)], [109,121])) { - var Temporary8 = nimCopy(null, powers_1728053317[0][chckIndx(nsuParseInt(x_553648718[chckIndx(1, 0, (x_553648718).length - 1)]), 0, (powers_1728053317[0]).length - 1)], NTI1728053253); - opponentDrafts_553648206[0].push(Temporary8);; - } - else { - if (eqStrings(x_553648718[chckIndx(0, 0, (x_553648718).length - 1)], [103,111])) { - draftOptions_553648208[0] = nimCopy(null, [], NTI1728053719); - Label9: { - var i_553648780 = []; - var colontmp__553649932 = []; - colontmp__553649932 = HEX5BHEX5D_553648736(x_553648718, HEX2EHEX2E_1090519145(1, 1)); - var i_553649934 = 0; - var L_553649935 = (colontmp__553649932).length; - Label10: { - Label11: while (true) { - if (!(i_553649934 < L_553649935)) break Label11; - i_553648780 = colontmp__553649932[chckIndx(i_553649934, 0, (colontmp__553649932).length - 1)]; - var Temporary12 = nimCopy(null, powers_1728053317[0][chckIndx(nsuParseInt(i_553648780), 0, (powers_1728053317[0]).length - 1)], NTI1728053253); - draftOptions_553648208[0].push(Temporary12);; - i_553649934 += 1; - if (!(((colontmp__553649932).length == L_553649935))) { + } + + var result_1895825474 = null; + + Label1: { + var iHEX60gensym0_1895825530 = 0; + var resultHEX60gensym0_1895825537 = newSeq_1728053982(chckRange((pieces_1895825471).length, 0, 2147483647)); + Label2: { + var it_1895825541 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_553652918 = 0; + var L_553652919 = (pieces_1895825471).length; + Label3: { + Label4: while (true) { + if (!(i_553652918 < L_553652919)) break Label4; + it_1895825541 = pieces_1895825471[chckIndx(i_553652918, 0, (pieces_1895825471).length - 1)]; + resultHEX60gensym0_1895825537[chckIndx(iHEX60gensym0_1895825530, 0, (resultHEX60gensym0_1895825537).length - 1)] = it_1895825541.index; + iHEX60gensym0_1895825530 = addInt(iHEX60gensym0_1895825530, 1); + i_553652918 += 1; + if (!(((pieces_1895825471).length == L_553652919))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - turn_553648196[0] = true; - } - }} - break; - case 2: - otherMove_553648332(d_553648711); - break; - case 7: - otherBuy_553648496(d_553648711); - break; - case 5: - if ((eqStrings(d_553648711, [100,105,115,99,111,110,110]) || eqStrings(d_553648711, [101,120,105,116]))) { - currentScreen_553648240[0] = 8; - } - else { - peer_553648194[0].Field0("end:exit"); - } - - peer_553648194[0].Field1(); - break; - default: - rawEcho([117,110,105,109,112,108,101,109,101,110,116,101,100]); - break; - } - redraw_721421809(kxi__); + }; + var indexes_1895825546 = nimCopy(null, resultHEX60gensym0_1895825537, NTI1728053770); + result_1895825474 = HEX3Aanonymous_1895825547; + + return result_1895825474; - } -function createJoinMenu_553649053() { +function createSendGlass_553649677(group_553649678) { -function HEX3Aanonymous_553649059(ev_553649060, v_553649061) { - var id_553649062 = getInputText_721422193(getVNodeById_721420594("joincode", kxi__)); - roomId_553648188[0].Field1 = id_553649062; - rawEcho(HEX24_754975843(getVNodeById_721420594("joincode", kxi__))); - if (!((peer_553648194[0].Field1 == null))) { - peer_553648194[0].Field1(); - } - - peer_553648194[0] = nimCopy(peer_553648194[0], newJoin_1577058552(id_553649062, joinLogic_553648710), NTI553648155); +function HEX3Aanonymous_553649681() { + Label1: { + var fmtRes_553649686 = [mnewString(0)]; + fmtRes_553649686[0].push.apply(fmtRes_553649686[0], [99,97,115,116,105,110,103,99,111,109,112,108,101,116,101,44]);; + formatValue_553649687(fmtRes_553649686, 0, group_553649678); + }; + sendAction_553649085(fmtRes_553649686[0], false); + sendAction_553649085([112,97,115,115], true); } - var result_553649054 = null; + var result_553649680 = null; - var tmp_553649055 = tree_754975616(44, []); - tmp_553649055.class = "main cut-down"; - tmp_553649055.id = "join"; - var tmp_553649056 = tree_754975616(193, []); - setAttr_754975467(tmp_553649056, "for", "joincode"); - add_754975552(tmp_553649056, text_754975684([74,111,105,110,32,67,111,100,101,58])); - add_754975552(tmp_553649055, tmp_553649056); - var tmp_553649057 = tree_754975616(194, []); - tmp_553649057.id = "joincode"; - addEventHandler_721422110(tmp_553649057, 8, validateNotEmpty_553648791("joincode"), kxi__); - add_754975552(tmp_553649055, tmp_553649057); - var tmp_553649058 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649058, 0, HEX3Aanonymous_553649059, kxi__); - add_754975552(tmp_553649058, text_754975684([69,110,116,101,114])); - add_754975552(tmp_553649055, tmp_553649058); - result_553649054 = tmp_553649055; + result_553649680 = HEX3Aanonymous_553649681; - return result_553649054; + return result_553649680; } -function createOptionsMenu_553649084() { - -function HEX3Aanonymous_553649114(__553649115, __553649116) { - peer_553648194[0].Field0("handshake:gamestart"); - turn_553648196[0] = true; - currentScreen_553648240[0] = 3; +function HEX5BHEX5D_553651482(s_553651484, i_553651485) { + var result_553651486 = null; - - } - -function HEX3Aanonymous_553649119(__553649120, __553649121) { - peer_553648194[0].Field0("draft:start"); - currentScreen_553648240[0] = 5; - gameMode_553648241[0] = 1; - turn_553648196[0] = true; - baseDrafts_553648207[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftTierNumber", kxi__)), 10); - draftsLeft_553648210[0] = subInt(baseDrafts_553648207[0], 1); - draftChoices_553648209[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceTierNumber", kxi__)), 10); - draft_553648589([], []); + result_553651486 = s_553651484[chckIndx(subInt((s_553651484).length, i_553651485), 0, (s_553651484).length - 1)]; - - } - -function HEX3Aanonymous_553649140(__553649141, __553649142) { - peer_553648194[0].Field0("draft:start"); - currentScreen_553648240[0] = 5; - gameMode_553648241[0] = 2; - turn_553648196[0] = true; - baseDrafts_553648207[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftRandNumber", kxi__)), 10); - draftsLeft_553648210[0] = subInt(baseDrafts_553648207[0], 1); - draftChoices_553648209[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceRandNumber", kxi__)), 10); - draft_553648589([], []); + return result_553651486; - - } - -function HEX3Aanonymous_553649145(__553649146, __553649147) { - peer_553648194[0].Field0("draft:start"); - currentScreen_553648240[0] = 5; - gameMode_553648241[0] = 3; - turn_553648196[0] = true; - baseDrafts_553648207[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftSuperRandNumber", kxi__)), 10); - draftsLeft_553648210[0] = subInt(baseDrafts_553648207[0], 1); - draftChoices_553648209[0] = parseInt(getInputText_721422193(getVNodeById_721420594("draftChoiceSuperRandNumber", kxi__)), 10); - draft_553648589([], []); +} +function createGlassMenu_553651127() { + var Temporary6; + +function HEX3Aanonymous_553651214(__553651215, __553651216) { - } - - var result_553649085 = null; - - var tmp_553649086 = tree_754975616(44, []); - tmp_553649086.class = "main"; - if ((side_553648195[0] == 0)) { - add_754975552(tmp_553649086, text_754975684([87,97,105,116,105,110,103,32,102,111,114,32,104,111,115,116,32,116,111,32,100,101,99,105,100,101,32,114,117,108,101,115,101,116,46,46,46])); - } - else { - var tmp_553649087 = tree_754975616(44, []); - tmp_553649087.class = "column cut-down"; - var tmp_553649088 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649088, 0, HEX3Aanonymous_553649114, kxi__); - add_754975552(tmp_553649088, text_754975684([78,111,114,109,97,108,32,67,104,101,115,115])); - add_754975552(tmp_553649087, tmp_553649088); - add_754975552(tmp_553649087, text_754975684([67,108,97,115,115,105,99,32,67,104,101,115,115,44,32,119,105,116,104,32,110,111,32,115,112,101,99,105,97,108,32,114,117,108,101,115,32,111,114,32,97,98,105,108,105,116,101,115,46])); - add_754975552(tmp_553649086, tmp_553649087); - var tmp_553649089 = tree_754975616(44, []); - tmp_553649089.class = "column cut-down"; - var tmp_553649090 = tree_754975616(44, []); - tmp_553649090.class = "column"; - var tmp_553649091 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649091, 0, HEX3Aanonymous_553649119, kxi__); - add_754975552(tmp_553649091, text_754975684([68,114,97,102,116,32,109,111,100,101])); - add_754975552(tmp_553649090, tmp_553649091); - add_754975552(tmp_553649090, text_754975684(makeNimstrLit("Take turns drafting power ups for your pieces, then play. \x0A Each side is guaranteed to get power ups of the same tier."))); - var tmp_553649092 = tree_754975616(193, []); - setAttr_754975467(tmp_553649092, "for", "draftTierNumber"); - add_754975552(tmp_553649092, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); - add_754975552(tmp_553649090, tmp_553649092); - var tmp_553649093 = tree_754975616(194, []); - tmp_553649093.id = "draftTierNumber"; - setAttr_754975467(tmp_553649093, "type", "number"); - addEventHandler_721422110(tmp_553649093, 8, validateNotEmpty_553648791("draftTierNumber"), kxi__); - setAttr_754975467(tmp_553649093, "step", "1"); - setAttr_754975467(tmp_553649093, "min", "1"); - setAttr_754975467(tmp_553649093, "max", "10"); - valueHEX3D_754975173(tmp_553649093, "3"); - setAttr_754975467(tmp_553649093, "value", "3"); - add_754975552(tmp_553649090, tmp_553649093); - var tmp_553649094 = tree_754975616(193, []); - setAttr_754975467(tmp_553649094, "for", "draftChoiceTierNumber"); - add_754975552(tmp_553649094, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); - add_754975552(tmp_553649090, tmp_553649094); - var tmp_553649095 = tree_754975616(194, []); - tmp_553649095.id = "draftChoiceTierNumber"; - setAttr_754975467(tmp_553649095, "type", "number"); - addEventHandler_721422110(tmp_553649095, 8, validateNotEmpty_553648791("draftChoiceTierNumber"), kxi__); - setAttr_754975467(tmp_553649095, "step", "1"); - setAttr_754975467(tmp_553649095, "min", "1"); - setAttr_754975467(tmp_553649095, "max", "5"); - valueHEX3D_754975173(tmp_553649095, "3"); - setAttr_754975467(tmp_553649095, "value", "3"); - add_754975552(tmp_553649090, tmp_553649095); - add_754975552(tmp_553649089, tmp_553649090); - var tmp_553649096 = tree_754975616(33, []); - add_754975552(tmp_553649089, tmp_553649096); - var tmp_553649097 = tree_754975616(44, []); - tmp_553649097.class = "column"; - var tmp_553649098 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649098, 0, HEX3Aanonymous_553649140, kxi__); - add_754975552(tmp_553649098, text_754975684([82,97,110,100,111,109,32,109,111,100,101])); - add_754975552(tmp_553649097, tmp_553649098); - add_754975552(tmp_553649097, text_754975684(makeNimstrLit("Draft powerups of random strength and quality, then play. \x0A Completely luck based."))); - var tmp_553649099 = tree_754975616(193, []); - setAttr_754975467(tmp_553649099, "for", "draftRandNumber"); - add_754975552(tmp_553649099, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); - add_754975552(tmp_553649097, tmp_553649099); - var tmp_553649100 = tree_754975616(194, []); - tmp_553649100.id = "draftRandNumber"; - setAttr_754975467(tmp_553649100, "type", "number"); - addEventHandler_721422110(tmp_553649100, 8, validateNotEmpty_553648791("draftRandNumber"), kxi__); - setAttr_754975467(tmp_553649100, "step", "1"); - setAttr_754975467(tmp_553649100, "min", "1"); - setAttr_754975467(tmp_553649100, "max", "10"); - valueHEX3D_754975173(tmp_553649100, "3"); - setAttr_754975467(tmp_553649100, "value", "3"); - add_754975552(tmp_553649097, tmp_553649100); - var tmp_553649101 = tree_754975616(193, []); - setAttr_754975467(tmp_553649101, "for", "draftChoiceRandNumber"); - add_754975552(tmp_553649101, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); - add_754975552(tmp_553649097, tmp_553649101); - var tmp_553649102 = tree_754975616(194, []); - tmp_553649102.id = "draftChoiceRandNumber"; - setAttr_754975467(tmp_553649102, "type", "number"); - addEventHandler_721422110(tmp_553649102, 8, validateNotEmpty_553648791("draftChoiceRandNumber"), kxi__); - setAttr_754975467(tmp_553649102, "step", "1"); - setAttr_754975467(tmp_553649102, "min", "1"); - setAttr_754975467(tmp_553649102, "max", "5"); - valueHEX3D_754975173(tmp_553649102, "3"); - setAttr_754975467(tmp_553649102, "value", "3"); - add_754975552(tmp_553649097, tmp_553649102); - add_754975552(tmp_553649089, tmp_553649097); - var tmp_553649103 = tree_754975616(33, []); - add_754975552(tmp_553649089, tmp_553649103); - var tmp_553649104 = tree_754975616(44, []); - tmp_553649104.class = "column"; - var tmp_553649105 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649105, 0, HEX3Aanonymous_553649145, kxi__); - add_754975552(tmp_553649105, text_754975684([83,117,112,101,114,32,82,97,110,100,111,109,32,109,111,100,101])); - add_754975552(tmp_553649104, tmp_553649105); - add_754975552(tmp_553649104, text_754975684(makeNimstrLit("Draft powerups of random strength and quality, then play. \x0A Completely luck based, with higher chances for rare pieces."))); - var tmp_553649106 = tree_754975616(193, []); - setAttr_754975467(tmp_553649106, "for", "draftSuperRandNumber"); - add_754975552(tmp_553649106, text_754975684([78,117,109,98,101,114,32,111,102,32,112,111,119,101,114,115,32,100,114,97,102,116,101,100])); - add_754975552(tmp_553649104, tmp_553649106); - var tmp_553649107 = tree_754975616(194, []); - tmp_553649107.id = "draftSuperRandNumber"; - setAttr_754975467(tmp_553649107, "type", "number"); - addEventHandler_721422110(tmp_553649107, 8, validateNotEmpty_553648791("draftSuperRandNumber"), kxi__); - setAttr_754975467(tmp_553649107, "step", "1"); - setAttr_754975467(tmp_553649107, "min", "1"); - setAttr_754975467(tmp_553649107, "max", "10"); - valueHEX3D_754975173(tmp_553649107, "3"); - setAttr_754975467(tmp_553649107, "value", "3"); - add_754975552(tmp_553649104, tmp_553649107); - var tmp_553649108 = tree_754975616(193, []); - setAttr_754975467(tmp_553649108, "for", "draftChoiceSuperRandNumber"); - add_754975552(tmp_553649108, text_754975684([78,117,109,98,101,114,32,111,102,32,99,104,111,105,99,101,115,32,101,97,99,104,32,114,111,117,110,100])); - add_754975552(tmp_553649104, tmp_553649108); - var tmp_553649109 = tree_754975616(194, []); - tmp_553649109.id = "draftChoiceSuperRandNumber"; - setAttr_754975467(tmp_553649109, "type", "number"); - addEventHandler_721422110(tmp_553649109, 8, validateNotEmpty_553648791("draftChoiceSuperRandNumber"), kxi__); - setAttr_754975467(tmp_553649109, "step", "1"); - setAttr_754975467(tmp_553649109, "min", "1"); - setAttr_754975467(tmp_553649109, "max", "5"); - valueHEX3D_754975173(tmp_553649109, "3"); - setAttr_754975467(tmp_553649109, "value", "3"); - add_754975552(tmp_553649104, tmp_553649109); - add_754975552(tmp_553649089, tmp_553649104); - add_754975552(tmp_553649086, tmp_553649089); - } - - result_553649085 = tmp_553649086; - - return result_553649085; - -} - -function createPowerMenu_553649150(p_553649151) { - var Temporary1; - p_553649151 = nimCopy(null, p_553649151, NTI1728053253); - -function HEX3Aanonymous_553649166(__553649167, __553649168) { - peer_553648194[0].Field0(toJSStr(([100,114,97,102,116,58,109,121,44] || []).concat(HEX24_385875976(p_553649151.index) || []))); - var Temporary1 = nimCopy(null, p_553649151, NTI1728053253); - myDrafts_553648201[0].push(Temporary1);; - turn_553648196[0] = false; - if ((side_553648195[0] == 1)) { - draft_553648589(HEX26_1728054098(myDrafts_553648201[0], opponentDrafts_553648206[0]), opponentDrafts_553648206[0]); - Label2: { - var iHEX60gensym32_553649201 = 0; - var resultHEX60gensym32_553649208 = newSeq_536871458(chckRange((draftOptions_553648208[0]).length, 0, 2147483647)); - Label3: { - var it_553649212 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649955 = 0; - var L_553649956 = (draftOptions_553648208[0]).length; - Label4: { - Label5: while (true) { - if (!(i_553649955 < L_553649956)) break Label5; - it_553649212 = draftOptions_553648208[0][chckIndx(i_553649955, 0, (draftOptions_553648208[0]).length - 1)]; - resultHEX60gensym32_553649208[chckIndx(iHEX60gensym32_553649201, 0, (resultHEX60gensym32_553649208).length - 1)] = nimCopy(null, ([44] || []).concat(HEX24_385875976(it_553649212.index) || []), NTI33554449); - iHEX60gensym32_553649201 = addInt(iHEX60gensym32_553649201, 1); - i_553649955 += 1; - if (!(((draftOptions_553648208[0]).length == L_553649956))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); +function HEX3Aanonymous_553651326() { + Label1: { + var piece_553651367 = {Field0: 0, Field1: 0}; + var tile_553651368 = {Field0: 0, Field1: 0}; + if (!((modInt((picks_553648327[0]).length, 2) == 0))) { + failedAssertImpl_268435541([112,105,101,99,101,46,110,105,109,40,49,49,52,44,32,53,41,32,96,115,46,108,101,110,32,109,111,100,32,50,32,61,61,32,48,96,32]); + } + + var index_553652894 = 0; + Label2: { + Label3: while (true) { + if (!(index_553652894 < (picks_553648327[0]).length)) break Label3; + piece_553651367 = nimCopy(piece_553651367, picks_553648327[0][chckIndx(index_553652894, 0, (picks_553648327[0]).length - 1)], NTI1476395011); + tile_553651368 = nimCopy(tile_553651368, picks_553648327[0][chckIndx(addInt(index_553652894, 1), 0, (picks_553648327[0]).length - 1)], NTI1476395011); + rawEcho([112,105,101,99,101,116,105,108,101], HEX24_1476395861(piece_553651367), [116,105,108,101,44,32], HEX24_1476395861(tile_553651368)); + var Temporary4 = nimCopy(null, HEX5BHEX5D_1476395509(theBoard_553648247[0], piece_553651367), NTI1476395032); + pieces_553651239.push(Temporary4);; + var Temporary5 = nimCopy(null, tile_553651368, NTI1476395011); + tiles_553651244.push(Temporary5);; + newCasting_553651234.push({Field0: nimCopy(null, tile_553651368, NTI1476395011), Field1: group_553651233, Field2: glass_553651194});; + HEX5BHEX5D_1476395509(theBoard_553648247[0], piece_553651367).casts.push({Field0: nimCopy(null, tile_553651368, NTI1476395011), Field1: group_553651233, Field2: glass_553651194});; + Label6: { + var fmtRes_553651407 = [mnewString(0)]; + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [99,97,115,116,105,110,103,115,116,97,114,116,44]);; + formatValue_553649687(fmtRes_553651407, 0, piece_553651367.Field1); + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [44]);; + formatValue_553649687(fmtRes_553651407, 0, piece_553651367.Field0); + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [44]);; + formatValue_553649687(fmtRes_553651407, 0, tile_553651368.Field1); + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [44]);; + formatValue_553649687(fmtRes_553651407, 0, tile_553651368.Field0); + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [44]);; + formatValue_553649687(fmtRes_553651407, 0, group_553651233); + fmtRes_553651407[0].push.apply(fmtRes_553651407[0], [44]);; + formatValue_553651200(fmtRes_553651407, 0, glass_553651194); + }; + sendAction_553649085(fmtRes_553651407[0], false); + index_553652894 = addInt(index_553652894, 2); } - - } + }; }; - }; - }; - var sHEX60gensym35_553649224 = nimCopy(null, resultHEX60gensym32_553649208, NTI536871233); - var nHEX60gensym35_553649228 = (sHEX60gensym35_553649224).length; - if (!((0 < nHEX60gensym35_553649228))) { - failedAssertImpl_268435541([115,101,113,117,116,105,108,115,46,110,105,109,40,57,55,55,44,32,51,41,32,96,110,96,103,101,110,115,121,109,51,53,32,62,32,48,96,32,67,97,110,39,116,32,102,111,108,100,32,101,109,112,116,121,32,115,101,113,117,101,110,99,101,115]); - } - - var resultHEX60gensym35_553649234 = nimCopy(null, sHEX60gensym35_553649224[chckIndx(subInt(nHEX60gensym35_553649228, 1), 0, (sHEX60gensym35_553649224).length - 1)], NTI33554449); - Label6: { - var iHEX60gensym35_553649240 = 0; - var colontmp__553649959 = 0; - colontmp__553649959 = subInt(nHEX60gensym35_553649228, 2); - var res_553649960 = colontmp__553649959; - Label7: { - Label8: while (true) { - if (!(0 <= res_553649960)) break Label8; - iHEX60gensym35_553649240 = res_553649960; - var a_553649241 = nimCopy(null, sHEX60gensym35_553649224[chckIndx(iHEX60gensym35_553649240, 0, (sHEX60gensym35_553649224).length - 1)], NTI33554449); - var b_553649242 = nimCopy(null, resultHEX60gensym35_553649234, NTI33554449); - resultHEX60gensym35_553649234 = nimCopy(null, (a_553649241 || []).concat(b_553649242 || []), NTI33554449); - res_553649960 = subInt(res_553649960, 1); - } - }; - }; - peer_553648194[0].Field0(toJSStr(([100,114,97,102,116,58,103,111] || []).concat(resultHEX60gensym35_553649234 || []))); + rawEcho([97,100,100,105,110,103,32,97,99,116,105,111,110,83,116,97,99,107]); + actionStack_553648298[0].push({Field0: ([67,97,115,116,105,110,103,32] || []).concat(reprEnum(glass_553651194, NTI1476395027) || []), Field1: 1, Field2: group_553651233, Field3: packageGlass_1895825470(pieces_553651239, tiles_553651244, action_553651260), Field4: true, Field5: false, Field6: createSendGlass_553649677(group_553651233)});; + rawEcho([97,118,116,105,111,110,115,116,97,99,107,32,97,100,100,101,100]); + sendAction_553649085([112,97,115,115], true); + + } +function HEX3Aanonymous_553651458() { + var result_553651459 = [[]]; + + if ((modInt(picksLeft_553648319[0], 2) == 0)) { + Label1: { + var i_553651460 = 0; + var j_553651461 = 0; + Label2: { + var i_553652898 = 0; + var i_553652899 = 0; + Label3: { + Label4: while (true) { + if (!(i_553652899 < 8)) break Label4; + i_553652898 = i_553652899; + Label5: { + var j_553652902 = 0; + var i_553652903 = 0; + Label6: { + Label7: while (true) { + if (!(i_553652903 < 8)) break Label7; + j_553652902 = i_553652903; + i_553651460 = i_553652898; + j_553651461 = j_553652902; + if (isColor_1476396138(theBoard_553648247[0][chckIndx(i_553651460, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553651461, 0, (theBoard_553648247[0][chckIndx(i_553651460, 0, (theBoard_553648247[0]).length - 1)]).length - 1)], side_553648229[0])) { + var Temporary8 = nimCopy(null, theBoard_553648247[0][chckIndx(i_553651460, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553651461, 0, (theBoard_553648247[0][chckIndx(i_553651460, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].tile, NTI1476395011); + result_553651459[0].push(Temporary8);; + } + + i_553652903 = addInt(i_553652903, 1); + } + }; + }; + i_553652899 = addInt(i_553652899, 1); + } + }; + }; + }; + } + else { + var condition_553651481 = get_553649866(theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass[chckIndx(glass_553651194, 0, (theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass).length - 1)]).Field2; + add_1476395683(result_553651459, 0, condition_553651481(side_553648229[0], HEX5BHEX5D_1476395509(theBoard_553648247[0], HEX5BHEX5D_553651482(picks_553648327[0], 1)), theBoard_553648247[0], theState_553648248[0])); + } + - - } - - var result_553649152 = null; + return result_553651459[0]; - var tmp_553649153 = tree_754975616(44, []); - tmp_553649153.class = "power"; - var tmp_553649154 = tree_754975616(21, []); - if ((showTechnicalNames_553648238[0] && !(eqStrings(p_553649151.technicalName, [])))) { - Temporary1 = p_553649151.technicalName; - } - else { - Temporary1 = p_553649151.name; - } - - add_754975552(tmp_553649154, text_754975684(Temporary1)); - add_754975552(tmp_553649153, tmp_553649154); - if (!(eqStrings(p_553649151.icon, []))) { - var src_553649159 = [46,47,105,99,111,110,115,47]; - if (!(p_553649151.noColor)) { - src_553649159.push.apply(src_553649159, reprEnum(side_553648195[0], NTI1476395017));; - } - - var tmp_553649155 = tree_754975616(76, []); - setAttr_754975467(tmp_553649155, "src", toJSStr((src_553649159 || []).concat(p_553649151.icon || []))); - add_754975552(tmp_553649153, tmp_553649155); - } - else { - var tmp_553649156 = tree_754975616(76, []); - setAttr_754975467(tmp_553649156, "src", "./icons/blackbishop.svg"); - add_754975552(tmp_553649153, tmp_553649156); - } - - var tmp_553649157 = tree_754975616(22, []); - add_754975552(tmp_553649157, text_754975684(reprEnum(p_553649151.tier, NTI1728053251))); - add_754975552(tmp_553649153, tmp_553649157); - var tmp_553649158 = tree_754975616(32, []); - add_754975552(tmp_553649158, text_754975684(p_553649151.description)); - add_754975552(tmp_553649153, tmp_553649158); - addEventHandler_721422102(tmp_553649153, 0, HEX3Aanonymous_553649166, kxi__); - result_553649152 = tmp_553649153; + } - return result_553649152; + var strength_553651232 = get_553649866(theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass[chckIndx(glass_553651194, 0, (theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass).length - 1)]).Field0; + var group_553651233 = newGroup_1476395648(theState_553648248[0]); + var newCasting_553651234 = []; + var pieces_553651239 = []; + var tiles_553651244 = []; + var action_553651260 = get_553649866(theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass[chckIndx(glass_553651194, 0, (theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass).length - 1)]).Field1; + picksLeft_553648319[0] = mulInt(strength_553651232, 2); + Label1: { + var fmtRes_553651265 = [mnewString(0)]; + fmtRes_553651265[0].push.apply(fmtRes_553651265[0], [80,105,99,107,32,97,32,112,105,101,99,101,32,116,111,32,115,116,97,114,116,32,99,97,115,116,105,110,103,32]);; + formatValue_553651200(fmtRes_553651265, 0, glass_553651194); + fmtRes_553651265[0].push.apply(fmtRes_553651265[0], [46]);; + }; + Label2: { + var fmtRes_553651276 = [mnewString(0)]; + fmtRes_553651276[0].push.apply(fmtRes_553651276[0], [80,105,99,107,32,97,32,116,105,108,101,32,116,111,32,99,97,115,116,32]);; + formatValue_553651200(fmtRes_553651276, 0, glass_553651194); + fmtRes_553651276[0].push.apply(fmtRes_553651276[0], [32,111,110,46]);; + }; + promptStack_553648318[0] = nimCopy(null, reversed_553651309(cycle_553651283([nimCopy(null, fmtRes_553651265[0], NTI33554449), nimCopy(null, fmtRes_553651276[0], NTI33554449)], chckRange(strength_553651232, 0, 2147483647))), NTI553651118); + whenCollected_553648329[0] = HEX3Aanonymous_553651326; + getPickOptions_553648321[0] = HEX3Aanonymous_553651458; + pickOptions_553648322[0] = nimCopy(null, getPickOptions_553648321[0](), NTI553648293); + clear_553648382(); -} + + } -function createDraftMenu_553649247() { - var result_553649248 = null; + var result_553651128 = null; - var tmp_553649249 = tree_754975616(44, []); - tmp_553649249.class = "main power-menu"; - if (turn_553648196[0]) { + var tmp_553651129 = tree_754975616(44, []); + tmp_553651129.class = " glass-menu "; + var tmp_553651130 = tree_754975616(24, []); + tmp_553651130.class = "title"; + add_754975552(tmp_553651130, text_754975684([71,108,97,115,115,101,115])); + add_754975552(tmp_553651129, tmp_553651130); Label1: { - var p_553649253 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var i_553649941 = 0; - var L_553649942 = (draftOptions_553648208[0]).length; + var glass_553651140 = 0; Label2: { - Label3: while (true) { - if (!(i_553649941 < L_553649942)) break Label3; - p_553649253 = draftOptions_553648208[0][chckIndx(i_553649941, 0, (draftOptions_553648208[0]).length - 1)]; - add_754975552(tmp_553649249, createPowerMenu_553649150(p_553649253)); - i_553649941 += 1; - if (!(((draftOptions_553648208[0]).length == L_553649942))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + var v_553652885 = 0; + var res_553652886 = 0; + Label3: { + Label4: while (true) { + if (!(res_553652886 <= 2)) break Label4; + v_553652885 = res_553652886; + glass_553651140 = v_553652885; + if (isSome_1895825465(theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass[chckIndx(glass_553651140, 0, (theState_553648248[0].Field1[chckIndx(side_553648229[0], 0, (theState_553648248[0].Field1).length - 1)].glass).length - 1)])) { + var tmp_553651131 = tree_754975616(71, []); + tmp_553651131.class = toJSStr(toLower_1157635480(reprEnum(glass_553651140, NTI1476395027))); + addEventHandler_721422102(tmp_553651131, 0, createGlassOnClick_553651036(glass_553651140), kxi__); + add_754975552(tmp_553651129, tmp_553651131); + } + else { + var tmp_553651132 = tree_754975616(71, []); + Label5: { + var fmtRes_553651155 = [mnewString(0)]; + formatValue_553649009(fmtRes_553651155, 0, toLower_1157635480(reprEnum(glass_553651140, NTI1476395027))); + fmtRes_553651155[0].push.apply(fmtRes_553651155[0], [32,101,109,112,116,121]);; + }; + tmp_553651132.class = toJSStr(fmtRes_553651155[0]); + add_754975552(tmp_553651129, tmp_553651132); + } + + var tmp_553651133 = tree_754975616(32, []); + tmp_553651133.class = toJSStr(toLower_1157635480(reprEnum(glass_553651140, NTI1476395027))); + add_754975552(tmp_553651133, text_754975684(reprEnum(glass_553651140, NTI1476395027))); + add_754975552(tmp_553651129, tmp_553651133); + res_553652886 = addInt(res_553652886, 1); } - - } + }; }; }; + if (isSome_553651174(selectedGlass_553648293[0])) { + var glass_553651194 = (Temporary6 = get_553651066(selectedGlass_553648293[0]), Temporary6)[0][Temporary6[1]]; + if (!((picksLeft_553648319[0] == 0))) { + var tmp_553651134 = tree_754975616(195, []); + tmp_553651134.class = "cancel"; + addEventHandler_721422102(tmp_553651134, 0, cancelAllPicks_553649973, kxi__); + add_754975552(tmp_553651134, text_754975684([67,97,110,99,101,108])); + add_754975552(tmp_553651129, tmp_553651134); } - else { - add_754975552(tmp_553649249, text_754975684([79,112,112,111,110,101,110,116,32,105,115,32,100,114,97,102,116,105,110,103,46,46,46])); + + var tmp_553651135 = tree_754975616(195, []); + tmp_553651135.class = "use"; + setAttr_754975512(tmp_553651135, "disabled", busy_553648343()); + Label7: { + var fmtRes_553651199 = [mnewString(0)]; + fmtRes_553651199[0].push.apply(fmtRes_553651199[0], [85,115,101,32]);; + formatValue_553651200(fmtRes_553651199, 0, glass_553651194); + }; + add_754975552(tmp_553651135, text_754975684(fmtRes_553651199[0])); + addEventHandler_721422102(tmp_553651135, 0, HEX3Aanonymous_553651214, kxi__); + add_754975552(tmp_553651129, tmp_553651135); } - result_553649248 = tmp_553649249; - - return result_553649248; - -} - -function isSelected_553648267(n_553648268, m_553648269) { - var result_553648270 = false; - - BeforeRet: { - result_553648270 = ((selectedTile_553648216[0].Field1 == n_553648268) && (selectedTile_553648216[0].Field0 == m_553648269)); - break BeforeRet; - }; - - return result_553648270; - -} + result_553651128 = tmp_553651129; -function formatValue_553649289(result_553649292, result_553649292_Idx, value_553649293) { - result_553649292[result_553649292_Idx].push.apply(result_553649292[result_553649292_Idx], HEX24_385875976(value_553649293));; + return result_553651128; - } -function setAttr_754975512(n_754975513, key_754975514, val_754975515) { - var Temporary1; +function HEX24_553651590(x_553651592) { + var result_553651593 = [[]]; - if (val_754975515) { - Temporary1 = ""; + result_553651593[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym215_553651604 = 0; + if ((0 < countHEX60gensym215_553651604)) { + result_553651593[0].push.apply(result_553651593[0], [44,32]);; } - else { - Temporary1 = null; + + result_553651593[0].push.apply(result_553651593[0], [110,101,120,116,73,110,100,101,120]);; + result_553651593[0].push.apply(result_553651593[0], [58,32]);; + countHEX60gensym215_553651604 += 1; + addQuoted_889193861(result_553651593, 0, x_553651592.nextIndex); + if ((0 < countHEX60gensym215_553651604)) { + result_553651593[0].push.apply(result_553651593[0], [44,32]);; } - setAttr_754975467(n_754975513, key_754975514, Temporary1); - - -} - -function validateUtf8_1157628240(s_1157628241) { - var result_1157628242 = 0; - - BeforeRet: { - var i_1157628243 = 0; - var L_1157628247 = (s_1157628241).length; - Label1: { - Label2: while (true) { - if (!(i_1157628243 < L_1157628247)) break Label2; - if ((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] <= 127)) { - i_1157628243 = addInt(i_1157628243, 1); - } - else { - if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 5) == 6)) { - if ((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] < 194)) { - result_1157628242 = i_1157628243; - break BeforeRet; - } - - if (((addInt(i_1157628243, 1) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { - i_1157628243 = addInt(i_1157628243, 2); - } - else { - result_1157628242 = i_1157628243; - break BeforeRet; - } - - } - else { - if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 4) == 14)) { - if ((((addInt(i_1157628243, 2) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 2), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { - i_1157628243 = addInt(i_1157628243, 3); - } - else { - result_1157628242 = i_1157628243; - break BeforeRet; - } - - } - else { - if (((s_1157628241[chckIndx(i_1157628243, 0, (s_1157628241).length - 1)] >>> 3) == 30)) { - if (((((addInt(i_1157628243, 3) < L_1157628247) && ((s_1157628241[chckIndx(addInt(i_1157628243, 1), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 2), 0, (s_1157628241).length - 1)] >>> 6) == 2)) && ((s_1157628241[chckIndx(addInt(i_1157628243, 3), 0, (s_1157628241).length - 1)] >>> 6) == 2))) { - i_1157628243 = addInt(i_1157628243, 4); - } - else { - result_1157628242 = i_1157628243; - break BeforeRet; - } - - } - else { - result_1157628242 = i_1157628243; - break BeforeRet; - } - }}} - } - }; - result_1157628242 = (-1); - break BeforeRet; - }; + result_553651593[0].push.apply(result_553651593[0], [110,101,120,116,71,114,111,117,112]);; + result_553651593[0].push.apply(result_553651593[0], [58,32]);; + countHEX60gensym215_553651604 += 1; + addQuoted_889193861(result_553651593, 0, x_553651592.nextGroup); + if ((0 < countHEX60gensym215_553651604)) { + result_553651593[0].push.apply(result_553651593[0], [44,32]);; + } + + result_553651593[0].push.apply(result_553651593[0], [114,97,110,100,83,101,101,100]);; + result_553651593[0].push.apply(result_553651593[0], [58,32]);; + countHEX60gensym215_553651604 += 1; + addQuoted_889193861(result_553651593, 0, x_553651592.randSeed); + if ((0 < countHEX60gensym215_553651604)) { + result_553651593[0].push.apply(result_553651593[0], [44,32]);; + } + + result_553651593[0].push.apply(result_553651593[0], [116,117,114,110,78,117,109,98,101,114]);; + result_553651593[0].push.apply(result_553651593[0], [58,32]);; + countHEX60gensym215_553651604 += 1; + addQuoted_889193861(result_553651593, 0, x_553651592.turnNumber); + result_553651593[0].push.apply(result_553651593[0], [41]);; - return result_1157628242; + return result_553651593[0]; } -function validateUtf8_1157635265(s_1157635266) { - var result_1157635267 = 0; +function HEX24_553651741(self_553651743) { + var result_553651744 = [[]]; - result_1157635267 = validateUtf8_1157628240((s_1157635266.slice(0, (s_1157635266).length - 1 + 1))); + if (isSome_1660947689(self_553651743)) { + result_553651744[0] = nimCopy(null, [115,111,109,101,40], NTI33554449); + addQuoted_889193861(result_553651744, 0, self_553651743.val); + result_553651744[0].push.apply(result_553651744[0], [41]);; + } + else { + result_553651744[0] = nimCopy(null, [110,111,110,101,40,105,110,116,41], NTI33554449); + } + - return result_1157635267; + return result_553651744[0]; } -function nucruneLen(s_1157627932) { - var result_1157627933 = 0; +function addQuoted_553651729(s_553651731, s_553651731_Idx, x_553651732) { + s_553651731[s_553651731_Idx].push.apply(s_553651731[s_553651731_Idx], HEX24_553651741(x_553651732));; - result_1157627933 = 0; - var i_1157627934 = 0; - Label1: { - Label2: while (true) { - if (!(i_1157627934 < (s_1157627932).length)) break Label2; - if ((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] <= 127)) { - i_1157627934 = addInt(i_1157627934, 1); - } - else { - if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 5) == 6)) { - i_1157627934 = addInt(i_1157627934, 2); - } - else { - if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 4) == 14)) { - i_1157627934 = addInt(i_1157627934, 3); - } - else { - if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 3) == 30)) { - i_1157627934 = addInt(i_1157627934, 4); - } - else { - if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 2) == 62)) { - i_1157627934 = addInt(i_1157627934, 5); - } - else { - if (((s_1157627932[chckIndx(i_1157627934, 0, (s_1157627932).length - 1)] >>> 1) == 126)) { - i_1157627934 = addInt(i_1157627934, 6); - } - else { - i_1157627934 = addInt(i_1157627934, 1); - } - }}}}} - result_1157627933 = addInt(result_1157627933, 1); - } - }; + +} - return result_1157627933; +function HEX24_553651869(x_553651871) { + var result_553651872 = [[]]; -} + result_553651872[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym246_553651883 = 0; + if ((0 < countHEX60gensym246_553651883)) { + result_553651872[0].push.apply(result_553651872[0], [44,32]);; + } + + result_553651872[0].push.apply(result_553651872[0], [110,97,109,101]);; + result_553651872[0].push.apply(result_553651872[0], [58,32]);; + countHEX60gensym246_553651883 += 1; + addQuoted_553648722(result_553651872, 0, x_553651871["Field0"]); + if ((0 < countHEX60gensym246_553651883)) { + result_553651872[0].push.apply(result_553651872[0], [44,32]);; + } + + result_553651872[0].push.apply(result_553651872[0], [99,111,115,116]);; + result_553651872[0].push.apply(result_553651872[0], [58,32]);; + countHEX60gensym246_553651883 += 1; + result_553651872[0].push.apply(result_553651872[0], [46,46,46]);; + if ((0 < countHEX60gensym246_553651883)) { + result_553651872[0].push.apply(result_553651872[0], [44,32]);; + } + + result_553651872[0].push.apply(result_553651872[0], [97,99,116,105,111,110]);; + result_553651872[0].push.apply(result_553651872[0], [58,32]);; + countHEX60gensym246_553651883 += 1; + result_553651872[0].push.apply(result_553651872[0], [46,46,46]);; + if ((0 < countHEX60gensym246_553651883)) { + result_553651872[0].push.apply(result_553651872[0], [44,32]);; + } + + result_553651872[0].push.apply(result_553651872[0], [99,111,110,100,105,116,105,111,110]);; + result_553651872[0].push.apply(result_553651872[0], [58,32]);; + countHEX60gensym246_553651883 += 1; + result_553651872[0].push.apply(result_553651872[0], [46,46,46]);; + result_553651872[0].push.apply(result_553651872[0], [41]);; -function runeLen_1157635093(s_1157635094) { - var result_1157635095 = 0; + return result_553651872[0]; - result_1157635095 = nucruneLen((s_1157635094.slice(0, (s_1157635094).length - 1 + 1))); +} - return result_1157635095; +function addQuoted_553651863(s_553651865, s_553651865_Idx, x_553651866) { + s_553651865[s_553651865_Idx].push.apply(s_553651865[s_553651865_Idx], HEX24_553651869(x_553651866));; + } -function nsuRepeatChar(c_889193569, count_889193570) { - var result_889193571 = []; +function collectionToString_553651848(x_553651850, prefix_553651851, separator_553651852, suffix_553651853) { + var result_553651854 = [[]]; - result_889193571 = nimCopy(null, mnewString(count_889193570), NTI33554449); + result_553651854[0] = nimCopy(null, prefix_553651851, NTI33554449); + var firstElement_553651855 = true; Label1: { - var i_889193576 = 0; - var colontmp__553649993 = 0; - colontmp__553649993 = subInt(count_889193570, 1); - var res_553649994 = 0; + var value_553651859 = {Field0: [], Field1: null, Field2: null, Field3: null}; + var i_553652937 = 0; + var L_553652938 = (x_553651850).length; Label2: { Label3: while (true) { - if (!(res_553649994 <= colontmp__553649993)) break Label3; - i_889193576 = res_553649994; - result_889193571[chckIndx(i_889193576, 0, (result_889193571).length - 1)] = c_889193569; - res_553649994 = addInt(res_553649994, 1); + if (!(i_553652937 < L_553652938)) break Label3; + value_553651859 = x_553651850[i_553652937]; + if (firstElement_553651855) { + firstElement_553651855 = false; + } + else { + result_553651854[0].push.apply(result_553651854[0], separator_553651852);; + } + + addQuoted_553651863(result_553651854, 0, value_553651859); + i_553652937 += 1; + if (!(((x_553651850).length == L_553652938))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + } }; }; + result_553651854[0].push.apply(result_553651854[0], suffix_553651853);; - return result_889193571; + return result_553651854[0]; } -function alignString_1862270996(s_1862270997, minimumWidth_1862270998, align_1862270999, fill_1862271000) { - var Temporary1; +function HEX24_553651844(x_553651846) { + var result_553651847 = []; - var result_1862271001 = []; + result_553651847 = nimCopy(null, collectionToString_553651848(x_553651846, [64,91], [44,32], [93]), NTI33554449); - if ((minimumWidth_1862270998 == 0)) { - result_1862271001 = nimCopy(null, s_1862270997, NTI33554449); + return result_553651847; + +} + +function addQuoted_553651838(s_553651840, s_553651840_Idx, x_553651841) { + s_553651840[s_553651840_Idx].push.apply(s_553651840[s_553651840_Idx], HEX24_553651844(x_553651841));; + + +} + +function HEX24_553652148(x_553652150) { + var result_553652151 = [[]]; + + result_553652151[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym265_553652162 = 0; + if ((0 < countHEX60gensym265_553652162)) { + result_553652151[0].push.apply(result_553652151[0], [44,32]);; } - else { - if ((validateUtf8_1157635265(s_1862270997) == (-1))) { - Temporary1 = runeLen_1157635093(s_1862270997); - } - else { - Temporary1 = (s_1862270997).length; - } - - var sRuneLen_1862271002 = Temporary1; - var toFill_1862271003 = subInt(minimumWidth_1862270998, sRuneLen_1862271002); - if ((toFill_1862271003 <= 0)) { - result_1862271001 = nimCopy(null, s_1862270997, NTI33554449); - } - else { - if (((align_1862270999 == 60) || (align_1862270999 == 0))) { - result_1862271001 = nimCopy(null, (s_1862270997 || []).concat(nsuRepeatChar(fill_1862271000, chckRange(toFill_1862271003, 0, 2147483647)) || []), NTI33554449); - } - else { - if ((align_1862270999 == 94)) { - var half_1862271004 = divInt(toFill_1862271003, 2); - result_1862271001 = nimCopy(null, (nsuRepeatChar(fill_1862271000, chckRange(half_1862271004, 0, 2147483647)) || []).concat(s_1862270997 || [],nsuRepeatChar(fill_1862271000, chckRange(subInt(toFill_1862271003, half_1862271004), 0, 2147483647)) || []), NTI33554449); - } - else { - result_1862271001 = nimCopy(null, (nsuRepeatChar(fill_1862271000, chckRange(toFill_1862271003, 0, 2147483647)) || []).concat(s_1862270997 || []), NTI33554449); - } - }} + + result_553652151[0].push.apply(result_553652151[0], [115,116,114,101,110,103,116,104]);; + result_553652151[0].push.apply(result_553652151[0], [58,32]);; + countHEX60gensym265_553652162 += 1; + addQuoted_889193861(result_553652151, 0, x_553652150["Field0"]); + if ((0 < countHEX60gensym265_553652162)) { + result_553652151[0].push.apply(result_553652151[0], [44,32]);; + } + + result_553652151[0].push.apply(result_553652151[0], [97,99,116,105,111,110]);; + result_553652151[0].push.apply(result_553652151[0], [58,32]);; + countHEX60gensym265_553652162 += 1; + result_553652151[0].push.apply(result_553652151[0], [46,46,46]);; + if ((0 < countHEX60gensym265_553652162)) { + result_553652151[0].push.apply(result_553652151[0], [44,32]);; } + result_553652151[0].push.apply(result_553652151[0], [99,111,110,100,105,116,105,111,110]);; + result_553652151[0].push.apply(result_553652151[0], [58,32]);; + countHEX60gensym265_553652162 += 1; + result_553652151[0].push.apply(result_553652151[0], [46,46,46]);; + result_553652151[0].push.apply(result_553652151[0], [41]);; - return result_1862271001; + return result_553652151[0]; } -function formatValue_553648564(result_553648566, result_553648566_Idx, value_553648567) { - var value_553648576 = nimCopy(null, value_553648567, NTI33554449); - result_553648566[result_553648566_Idx].push.apply(result_553648566[result_553648566_Idx], alignString_1862270996(value_553648576, 0, 0, 32));; +function addQuoted_553652142(s_553652144, s_553652144_Idx, x_553652145) { + s_553652144[s_553652144_Idx].push.apply(s_553652144[s_553652144_Idx], HEX24_553652148(x_553652145));; } -function sendBuy_553648544(option_553648545, tile_553648546) { - BeforeRet: { - if (false) { - break BeforeRet; +function HEX24_553652131(self_553652133) { + var result_553652134 = [[]]; + + if (isSome_1895825465(self_553652133)) { + result_553652134[0] = nimCopy(null, [115,111,109,101,40], NTI33554449); + addQuoted_553652142(result_553652134, 0, self_553652133.val); + result_553652134[0].push.apply(result_553652134[0], [41]);; + } + else { + result_553652134[0] = nimCopy(null, [110,111,110,101,40,71,108,97,115,115,65,98,105,108,105,116,121,41], NTI33554449); } + + return result_553652134[0]; + +} + +function addQuoted_553652119(s_553652121, s_553652121_Idx, x_553652122) { + s_553652121[s_553652121_Idx].push.apply(s_553652121[s_553652121_Idx], HEX24_553652131(x_553652122));; + + +} + +function collectionToString_553652077(x_553652079, prefix_553652080, separator_553652081, suffix_553652082) { + var result_553652083 = [[]]; + + result_553652083[0] = nimCopy(null, prefix_553652080, NTI33554449); + var firstElement_553652084 = true; Label1: { - var fmtRes_553648559 = [mnewString(0)]; - fmtRes_553648559[0].push.apply(fmtRes_553648559[0], [98,117,121,58]);; - formatValue_553648564(fmtRes_553648559, 0, option_553648545.Field0); - fmtRes_553648559[0].push.apply(fmtRes_553648559[0], [44]);; - formatValue_553648564(fmtRes_553648559, 0, HEX24_385875976(tile_553648546.Field1)); - fmtRes_553648559[0].push.apply(fmtRes_553648559[0], [44]);; - formatValue_553648564(fmtRes_553648559, 0, HEX24_385875976(tile_553648546.Field0)); + var value_553652115 = ({val: {Field0: 0, Field1: null, Field2: null}, has: false}); + var i_553652942 = 0; + Label2: { + Label3: while (true) { + if (!true) break Label3; + value_553652115 = nimCopy(value_553652115, x_553652079[i_553652942], NTI1476395068); + if (firstElement_553652084) { + firstElement_553652084 = false; + } + else { + result_553652083[0].push.apply(result_553652083[0], separator_553652081);; + } + + addQuoted_553652119(result_553652083, 0, value_553652115); + if ((2 <= i_553652942)) { + break Label2; + } + + i_553652942 += 1; + } + }; }; - peer_553648194[0].Field0(toJSStr(fmtRes_553648559[0])); - }; + result_553652083[0].push.apply(result_553652083[0], suffix_553652082);; + + return result_553652083[0]; - } -function createBuyButton_553649272(option_553649273, p_553649274) { - var Temporary1; - option_553649273 = nimCopy(null, option_553649273, NTI1476395025); - -function HEX3Aanonymous_553649295(__553649296, __553649297) { - sendBuy_553648544(option_553649273, p_553649274.tile); - buy_1476395867(p_553649274, option_553649273, theBoard_553648213[0]); - var colontmp__553649988 = (-1); - var colontmp__553649989 = (-1); - selectedTile_553648216[0] = nimCopy(selectedTile_553648216[0], {Field0: colontmp__553649988, Field1: colontmp__553649989}, NTI1476395011); - possibleMoves_553648221[0] = nimCopy(null, [], NTI1509949645); - possibleTakes_553648226[0] = nimCopy(null, [], NTI1509949645); +function HEX24_553652072(x_553652075) { + var result_553652076 = []; - - } + result_553652076 = nimCopy(null, collectionToString_553652077(x_553652075, [91], [44,32], [93]), NTI33554449); - var result_553649275 = null; + return result_553652076; - BeforeRet: { - if (!(option_553649273.Field3(p_553649274, theBoard_553648213[0]))) { - var tmp_553649276 = tree_754975616(44, []); - result_553649275 = tmp_553649276; - break BeforeRet; +} + +function addQuoted_553652060(s_553652062, s_553652062_Idx, x_553652063) { + s_553652062[s_553652062_Idx].push.apply(s_553652062[s_553652062_Idx], HEX24_553652072(x_553652063));; + + +} + +function HEX24_553651666(x_553651668) { + var result_553651669 = [[]]; + + result_553651669[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym229_553651680 = 0; + if ((0 < countHEX60gensym229_553651680)) { + result_553651669[0].push.apply(result_553651669[0], [44,32]);; } - else { - var disabled_553649277 = (!(turn_553648196[0]) || (getWallet_1476395857(side_553648195[0], theBoard_553648213[0]) < option_553649273.Field1)); - var tmp_553649278 = tree_754975616(195, []); - tmp_553649278.class = "menu-button"; - setAttr_754975512(tmp_553649278, "disabled", disabled_553649277); - Label2: { - var fmtRes_553649283 = [mnewString(0)]; - formatValue_553648564(fmtRes_553649283, 0, option_553649273.Field0); - fmtRes_553649283[0].push.apply(fmtRes_553649283[0], [58,32,36]);; - formatValue_553649289(fmtRes_553649283, 0, option_553649273.Field1); - }; - add_754975552(tmp_553649278, text_754975684(fmtRes_553649283[0])); - addEventHandler_721422102(tmp_553649278, 0, HEX3Aanonymous_553649295, kxi__); - Temporary1 = tmp_553649278; + + result_553651669[0].push.apply(result_553651669[0], [97,98,105,108,105,116,121,84,97,107,101,115]);; + result_553651669[0].push.apply(result_553651669[0], [58,32]);; + countHEX60gensym229_553651680 += 1; + addQuoted_889193861(result_553651669, 0, x_553651668.abilityTakes); + if ((0 < countHEX60gensym229_553651680)) { + result_553651669[0].push.apply(result_553651669[0], [44,32]);; } - result_553649275 = Temporary1; - }; + result_553651669[0].push.apply(result_553651669[0], [119,97,108,108,101,116]);; + result_553651669[0].push.apply(result_553651669[0], [58,32]);; + countHEX60gensym229_553651680 += 1; + addQuoted_553651729(result_553651669, 0, x_553651668.wallet); + if ((0 < countHEX60gensym229_553651680)) { + result_553651669[0].push.apply(result_553651669[0], [44,32]);; + } + + result_553651669[0].push.apply(result_553651669[0], [98,117,121,115]);; + result_553651669[0].push.apply(result_553651669[0], [58,32]);; + countHEX60gensym229_553651680 += 1; + addQuoted_553651838(result_553651669, 0, x_553651668.buys); + if ((0 < countHEX60gensym229_553651680)) { + result_553651669[0].push.apply(result_553651669[0], [44,32]);; + } + + result_553651669[0].push.apply(result_553651669[0], [112,105,101,99,101,115,83,111,108,100]);; + result_553651669[0].push.apply(result_553651669[0], [58,32]);; + countHEX60gensym229_553651680 += 1; + addQuoted_889193861(result_553651669, 0, x_553651668.piecesSold); + if ((0 < countHEX60gensym229_553651680)) { + result_553651669[0].push.apply(result_553651669[0], [44,32]);; + } + + result_553651669[0].push.apply(result_553651669[0], [103,108,97,115,115]);; + result_553651669[0].push.apply(result_553651669[0], [58,32]);; + countHEX60gensym229_553651680 += 1; + addQuoted_553652060(result_553651669, 0, x_553651668.glass); + result_553651669[0].push.apply(result_553651669[0], [41]);; - return result_553649275; + return result_553651669[0]; } -function createPieceProfile_553649306(p_553649307) { - var result_553649308 = null; +function HEX24_553649312(x_553649314) { + var result_553649315 = [[]]; - BeforeRet: { - if (isAir_1476395588(p_553649307)) { - var tmp_553649309 = tree_754975616(44, []); - result_553649308 = tmp_553649309; - break BeforeRet; + result_553649315[0] = nimCopy(null, [40], NTI33554449); + var countHEX60gensym98_553649326 = 0; + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; } - var imgClass_553649310 = []; - if ((!((side_553648195[0] == p_553649307.color)) && p_553649307.rotate)) { - imgClass_553649310.push.apply(imgClass_553649310, [114,111,116,97,116,101,32]);; + result_553649315[0].push.apply(result_553649315[0], [110,97,109,101]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + addQuoted_553648722(result_553649315, 0, x_553649314["Field0"]); + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; } - var src_553649315 = [46,47,105,99,111,110,115,47]; - if (p_553649307.colorable) { - src_553649315.push.apply(src_553649315, reprEnum(p_553649307.color, NTI1476395017));; + result_553649315[0].push.apply(result_553649315[0], [116,117,114,110,115]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + addQuoted_889193861(result_553649315, 0, x_553649314["Field1"]); + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; } - var name_553649322 = reprEnum(p_553649307.item, NTI1476395016); - var tmp_553649323 = tree_754975616(44, []); - tmp_553649323.class = "piece-row"; - var tmp_553649324 = tree_754975616(24, []); - add_754975552(tmp_553649324, text_754975684(name_553649322)); - add_754975552(tmp_553649323, tmp_553649324); - var tmp_553649325 = tree_754975616(76, []); - tmp_553649325.class = toJSStr(imgClass_553649310); - setAttr_754975467(tmp_553649325, "src", toJSStr((src_553649315 || []).concat(p_553649307.filePath || []))); - add_754975552(tmp_553649323, tmp_553649325); - var tmp_553649326 = tree_754975616(32, []); - tmp_553649326.class = "take"; + result_553649315[0].push.apply(result_553649315[0], [103,114,111,117,112]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + addQuoted_889193861(result_553649315, 0, x_553649314["Field2"]); + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; + } + + result_553649315[0].push.apply(result_553649315[0], [97,99,116,105,111,110]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + result_553649315[0].push.apply(result_553649315[0], [46,46,46]);; + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; + } + + result_553649315[0].push.apply(result_553649315[0], [99,97,110,99,101,108,97,98,108,101]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + addQuoted_553648708(result_553649315, 0, x_553649314["Field4"]); + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; + } + + result_553649315[0].push.apply(result_553649315[0], [112,97,115,115,116,104,114,111,117,103,104]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + addQuoted_553648708(result_553649315, 0, x_553649314["Field5"]); + if ((0 < countHEX60gensym98_553649326)) { + result_553649315[0].push.apply(result_553649315[0], [44,32]);; + } + + result_553649315[0].push.apply(result_553649315[0], [115,101,110,100]);; + result_553649315[0].push.apply(result_553649315[0], [58,32]);; + countHEX60gensym98_553649326 += 1; + result_553649315[0].push.apply(result_553649315[0], [46,46,46]);; + result_553649315[0].push.apply(result_553649315[0], [41]);; + + return result_553649315[0]; + +} + +function addQuoted_553649306(s_553649308, s_553649308_Idx, x_553649309) { + s_553649308[s_553649308_Idx].push.apply(s_553649308[s_553649308_Idx], HEX24_553649312(x_553649309));; + + +} + +function collectionToString_553649273(x_553649275, prefix_553649276, separator_553649277, suffix_553649278) { + var result_553649279 = [[]]; + + result_553649279[0] = nimCopy(null, prefix_553649276, NTI33554449); + var firstElement_553649280 = true; Label1: { - var fmtRes_553649332 = [mnewString(0)]; - fmtRes_553649332[0].push.apply(fmtRes_553649332[0], [75,105,108,108,115,58,32]);; - formatValue_553649289(fmtRes_553649332, 0, p_553649307.piecesTaken); - fmtRes_553649332[0].push.apply(fmtRes_553649332[0], [32,112,105,101,99,101,115,46]);; - }; - add_754975552(tmp_553649326, text_754975684(fmtRes_553649332[0])); - add_754975552(tmp_553649323, tmp_553649326); - if (isColor_1476395605(p_553649307, side_553648195[0])) { - var tmp_553649327 = tree_754975616(44, []); - tmp_553649327.class = "row"; - Label2: { - var option_553649342 = {Field0: [], Field1: 0, Field2: null, Field3: null}; - var i_553649984 = 0; - var L_553649985 = (p_553649307.wallet.Field1).length; - Label3: { - Label4: while (true) { - if (!(i_553649984 < L_553649985)) break Label4; - option_553649342 = p_553649307.wallet.Field1[chckIndx(i_553649984, 0, (p_553649307.wallet.Field1).length - 1)]; - add_754975552(tmp_553649327, createBuyButton_553649272(option_553649342, p_553649307)); - i_553649984 += 1; - if (!(((p_553649307.wallet.Field1).length == L_553649985))) { + var value_553649302 = {Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}; + var i_553652946 = 0; + var L_553652947 = (x_553649275).length; + Label2: { + Label3: while (true) { + if (!(i_553652946 < L_553652947)) break Label3; + value_553649302 = x_553649275[i_553652946]; + if (firstElement_553649280) { + firstElement_553649280 = false; + } + else { + result_553649279[0].push.apply(result_553649279[0], separator_553649277);; + } + + addQuoted_553649306(result_553649279, 0, value_553649302); + i_553652946 += 1; + if (!(((x_553649275).length == L_553652947))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - add_754975552(tmp_553649323, tmp_553649327); - } - - result_553649308 = tmp_553649323; - }; + result_553649279[0].push.apply(result_553649279[0], suffix_553649278);; - return result_553649308; + return result_553649279[0]; } -function replaceAnySynergies_1728054439(powers_1728054440) { - var result_1728054441 = []; +function HEX24_553649269(x_553649271) { + var result_553649272 = []; - BeforeRet: { - result_1728054441 = nimCopy(null, secretSynergize_1728053620(powers_1728054440, secretSynergies_1728053319[0]), NTI1728053488); - break BeforeRet; - }; + result_553649272 = nimCopy(null, collectionToString_553649273(x_553649271, [64,91], [44,32], [93]), NTI33554449); - return result_1728054441; + return result_553649272; } -function createPowerSummary_553649254(p_553649255, ofSide_553649256) { - var Temporary1; +function formatValue_553652228(result_553652231, result_553652231_Idx, value_553652232) { + formatValue_553649009(result_553652231, result_553652231_Idx, HEX24_553649269(value_553652232)); - var result_553649257 = null; + +} - var class_553649258 = [105,109,97,103,101,32]; - if ((!((side_553648195[0] == ofSide_553649256)) && p_553649255.rotatable)) { - class_553649258.push.apply(class_553649258, [32,114,111,116,97,116,101,32]);; - } - - var src_553649263 = [46,47,105,99,111,110,115,47]; - if (!(p_553649255.noColor)) { - src_553649263.push.apply(src_553649263, reprEnum(ofSide_553649256, NTI1476395017));; - } - - var tmp_553649267 = tree_754975616(44, []); - tmp_553649267.class = "power-grid"; - var tmp_553649268 = tree_754975616(24, []); - tmp_553649268.class = "title"; - if ((showTechnicalNames_553648238[0] && !(eqStrings(p_553649255.technicalName, [])))) { - Temporary1 = p_553649255.technicalName; - } - else { - Temporary1 = p_553649255.name; - } - - add_754975552(tmp_553649268, text_754975684(Temporary1)); - add_754975552(tmp_553649267, tmp_553649268); - var tmp_553649269 = tree_754975616(32, []); - tmp_553649269.class = "desc"; - add_754975552(tmp_553649269, text_754975684(p_553649255.description)); - add_754975552(tmp_553649267, tmp_553649269); - if (!(eqStrings(p_553649255.icon, []))) { - var tmp_553649270 = tree_754975616(76, []); - tmp_553649270.class = toJSStr(class_553649258); - setAttr_754975467(tmp_553649270, "src", toJSStr((src_553649263 || []).concat(p_553649255.icon || []))); - add_754975552(tmp_553649267, tmp_553649270); - } - else { - var tmp_553649271 = tree_754975616(76, []); - tmp_553649271.class = toJSStr(class_553649258); - setAttr_754975467(tmp_553649271, "src", "./icons/blackbishop.svg"); - add_754975552(tmp_553649267, tmp_553649271); - } - - result_553649257 = tmp_553649267; +function pop_553649922(s_553649924, s_553649924_Idx) { + var result_553649925 = []; - return result_553649257; + var L_553649929 = subInt((s_553649924[s_553649924_Idx]).length, 1); + result_553649925 = nimCopy(null, s_553649924[s_553649924_Idx][chckIndx(L_553649929, 0, (s_553649924[s_553649924_Idx]).length - 1)], NTI33554449); + if (s_553649924[s_553649924_Idx].length < chckRange(L_553649929, 0, 2147483647)) { for (var i = s_553649924[s_553649924_Idx].length ; i < chckRange(L_553649929, 0, 2147483647) ; ++i) s_553649924[s_553649924_Idx].push([]); } + else { s_553649924[s_553649924_Idx].length = chckRange(L_553649929, 0, 2147483647); }; + + return result_553649925; } -function sendMove_553648480(mode_553648481, start_553648482, to_553648483) { - BeforeRet: { - if (false) { - break BeforeRet; - } - - peer_553648194[0].Field0(toJSStr(([109,111,118,101,58] || []).concat(mode_553648481 || [],[44] || [],HEX24_385875976(start_553648482.Field1) || [],[44] || [],HEX24_385875976(start_553648482.Field0) || [],[44] || [],HEX24_385875976(to_553648483.Field1) || [],[44] || [],HEX24_385875976(to_553648483.Field0) || []))); - turn_553648196[0] = !(turn_553648196[0]); - turnNumber_553648237[0] = addInt(turnNumber_553648237[0], 1); - }; +function sendMove_553649625(moveType_553649626, start_553649627, to_553649628) { + Label1: { + var fmtRes_553649633 = [mnewString(0)]; + formatValue_553649009(fmtRes_553649633, 0, moveType_553649626); + fmtRes_553649633[0].push.apply(fmtRes_553649633[0], [44]);; + formatValue_553649009(fmtRes_553649633, 0, HEX24_385875976(start_553649627.Field1)); + fmtRes_553649633[0].push.apply(fmtRes_553649633[0], [44]);; + add_33556373(fmtRes_553649633, 0, (toJSStr(HEX24_385875976(start_553649627.Field0)))); + fmtRes_553649633[0].push.apply(fmtRes_553649633[0], [44]);; + formatValue_553649009(fmtRes_553649633, 0, HEX24_385875976(to_553649628.Field1)); + fmtRes_553649633[0].push.apply(fmtRes_553649633[0], [44]);; + formatValue_553649009(fmtRes_553649633, 0, HEX24_385875976(to_553649628.Field0)); + }; + sendAction_553649085(fmtRes_553649633[0], true); } -function createTile_553648797(p_553648798, m_553648799, n_553648800) { +function createTile_553650178(p_553650179, m_553650180, n_553650181) { var Temporary1; - p_553648798 = nimCopy(null, p_553648798, NTI1476395026); - -function HEX3Aanonymous_553648864(__553648865, __553648866) { - if (((contains_1476395777(possibleMoves_553648221[0], p_553648798.tile) && turn_553648196[0]) && isColor_1476395605(pieceOf_553648248(selectedTile_553648216[0]), side_553648195[0]))) { - sendMove_553648480([109,111,118,101], selectedTile_553648216[0], p_553648798.tile); - pieceOf_553648248(selectedTile_553648216[0]).onMove(pieceOf_553648248(selectedTile_553648216[0]), p_553648798.tile, theBoard_553648213[0]); - possibleMoves_553648221[0] = nimCopy(null, [], NTI1509949645); - var colontmp__553650003 = (-1); - var colontmp__553650004 = (-1); - selectedTile_553648216[0] = nimCopy(selectedTile_553648216[0], {Field0: colontmp__553650003, Field1: colontmp__553650004}, NTI1476395011); - possibleTakes_553648226[0] = nimCopy(null, [], NTI1509949645); - endRound_553648304(); + p_553650179 = nimCopy(null, p_553650179, NTI1476395032); + +function HEX3Aanonymous_553650273(__553650274, __553650275) { + if ((!((picksLeft_553648319[0] == 0)) && contains_1476395806(pickOptions_553648322[0], p_553650179.tile))) { + picksLeft_553648319[0] = subInt(picksLeft_553648319[0], 1); + var Temporary1 = nimCopy(null, p_553650179.tile, NTI1476395011); + picks_553648327[0].push(Temporary1);; + promptHistory_553648313[0].push(pop_553649922(promptStack_553648318, 0));; + pickOptions_553648322[0] = nimCopy(null, getPickOptions_553648321[0](), NTI553648293); + clear_553648382(); + if ((picksLeft_553648319[0] == 0)) { + rawEcho([119,104,101,110,32,99,111,108,108,101,99,116,101,100,32,115,116,97,114,116]); + whenCollected_553648329[0](); + rawEcho([87,104,101,110,32,67,111,108,108,101,99,116,101,100]); + cancelAllPicks_553649941(); + rawEcho([67,97,110,99,101,108,32,65,108,108]); + } + + } + else { + if (((contains_1476395806(possibleMoves_553648256[0], p_553650179.tile) && isColor_1476396138(pieceOf_553648336(selectedTile_553648251[0]), side_553648229[0])) && !(busy_553648343()))) { + pieceOf_553648336(selectedTile_553648251[0]).onMove(pieceOf_553648336(selectedTile_553648251[0]), p_553650179.tile, theBoard_553648247[0], theState_553648248[0]); + sendMove_553649625([109,111,118,101], selectedTile_553648251[0], p_553650179.tile); + rawEcho([115,101,110,100]); + clear_553648382(); } else { - if (((contains_1476395777(possibleTakes_553648226[0], p_553648798.tile) && turn_553648196[0]) && isColor_1476395605(pieceOf_553648248(selectedTile_553648216[0]), side_553648195[0]))) { - sendMove_553648480([116,97,107,101], selectedTile_553648216[0], p_553648798.tile); - pieceOf_553648248(selectedTile_553648216[0]).onTake(pieceOf_553648248(selectedTile_553648216[0]), p_553648798.tile, theBoard_553648213[0]); - possibleTakes_553648226[0] = nimCopy(null, [], NTI1509949645); - var colontmp__553650005 = (-1); - var colontmp__553650006 = (-1); - selectedTile_553648216[0] = nimCopy(selectedTile_553648216[0], {Field0: colontmp__553650005, Field1: colontmp__553650006}, NTI1476395011); - possibleMoves_553648221[0] = nimCopy(null, [], NTI1509949645); - endRound_553648304(); + if (((contains_1476395806(possibleTakes_553648261[0], p_553650179.tile) && isColor_1476396138(pieceOf_553648336(selectedTile_553648251[0]), side_553648229[0])) && !(busy_553648343()))) { + pieceOf_553648336(selectedTile_553648251[0]).onTake(pieceOf_553648336(selectedTile_553648251[0]), p_553650179.tile, theBoard_553648247[0], theState_553648248[0]); + sendMove_553649625([116,97,107,101], selectedTile_553648251[0], p_553650179.tile); + clear_553648382(); } else { - if (!(isSelected_553648267(m_553648799, n_553648800))) { - var colontmp__553650007 = n_553648800; - var colontmp__553650008 = m_553648799; - selectedTile_553648216[0] = nimCopy(selectedTile_553648216[0], {Field0: colontmp__553650007, Field1: colontmp__553650008}, NTI1476395011); - possibleMoves_553648221[0] = nimCopy(null, getMovesOn_1476395168(p_553648798, theBoard_553648213[0]), NTI1476395018); - possibleTakes_553648226[0] = nimCopy(null, getTakesOn_1476395283(p_553648798, theBoard_553648213[0]), NTI1476395018); + if (!(isSelected_553648339(m_553650180, n_553650181))) { + var colontmp__553652973 = n_553650181; + var colontmp__553652974 = m_553650180; + selectedTile_553648251[0] = nimCopy(selectedTile_553648251[0], {Field0: colontmp__553652973, Field1: colontmp__553652974}, NTI1476395011); + possibleMoves_553648256[0] = nimCopy(null, getMovesOn_1476395771(p_553650179, theBoard_553648247[0]), NTI1476395016); + possibleTakes_553648261[0] = nimCopy(null, getTakesOn_1476395656(p_553650179, theBoard_553648247[0]), NTI1476395016); } else { - var colontmp__553650009 = (-1); - var colontmp__553650010 = (-1); - selectedTile_553648216[0] = nimCopy(selectedTile_553648216[0], {Field0: colontmp__553650009, Field1: colontmp__553650010}, NTI1476395011); - possibleMoves_553648221[0] = nimCopy(null, [], NTI1509949645); - possibleTakes_553648226[0] = nimCopy(null, [], NTI1509949645); + clear_553648382(); } - }} + }}} } - var Temporary2; - var Temporary3; + var Temporary15; + var Temporary16; - var result_553648801 = null; + var result_553650182 = null; - if ((modInt(addInt(mulInt(m_553648799, 7), n_553648800), 2) == 0)) { + if ((modInt(addInt(mulInt(m_553650180, 7), n_553650181), 2) == 0)) { Temporary1 = [119,104,105,116,101,84,105,108,101]; } else { Temporary1 = [98,108,97,99,107,84,105,108,101]; } - - var class_553648802 = nimCopy(null, Temporary1, NTI33554449); - if ((isSelected_553648267(m_553648799, n_553648800) && contains_1476395777(possibleTakes_553648226[0], p_553648798.tile))) { - class_553648802.push.apply(class_553648802, [32,99,97,110,45,116,97,107,101]);; + + var class_553650183 = nimCopy(null, Temporary1, NTI33554449); + Label2: { + var i_553650184 = 0; + var j_553650185 = 0; + Label3: { + var i_553652962 = 0; + var i_553652963 = 0; + Label4: { + Label5: while (true) { + if (!(i_553652963 < 8)) break Label5; + i_553652962 = i_553652963; + Label6: { + var j_553652966 = 0; + var i_553652967 = 0; + Label7: { + Label8: while (true) { + if (!(i_553652967 < 8)) break Label8; + j_553652966 = i_553652967; + i_553650184 = i_553652962; + j_553650185 = j_553652966; + Label9: { + var c_553650189 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var colontmp__553652957 = []; + colontmp__553652957 = theBoard_553648247[0][chckIndx(i_553650184, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553650185, 0, (theBoard_553648247[0][chckIndx(i_553650184, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts; + var i_553652958 = 0; + var L_553652959 = (colontmp__553652957).length; + Label10: { + Label11: while (true) { + if (!(i_553652958 < L_553652959)) break Label11; + c_553650189 = colontmp__553652957[chckIndx(i_553652958, 0, (colontmp__553652957).length - 1)]; + if (HEX3DHEX3D_1476395830(p_553650179.tile, c_553650189.Field0)) { + class_553650183.push.apply(class_553650183, ([32,99,97,115,116,105,110,103,45,111,110,45] || []).concat(toLower_1157635480(reprEnum(c_553650189.Field2, NTI1476395027)) || []));; + } + + i_553652958 += 1; + if (!(((colontmp__553652957).length == L_553652959))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + i_553652967 = addInt(i_553652967, 1); + } + }; + }; + i_553652963 = addInt(i_553652963, 1); + } + }; + }; + }; + Label12: { + var c_553650200 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var i_553652970 = 0; + var L_553652971 = (p_553650179.casts).length; + Label13: { + Label14: while (true) { + if (!(i_553652970 < L_553652971)) break Label14; + c_553650200 = p_553650179.casts[chckIndx(i_553652970, 0, (p_553650179.casts).length - 1)]; + class_553650183.push.apply(class_553650183, ([32,99,97,115,116,105,110,103,45] || []).concat(toLower_1157635480(reprEnum(c_553650200.Field2, NTI1476395027)) || []));; + i_553652970 += 1; + if (!(((p_553650179.casts).length == L_553652971))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + if ((isSelected_553648339(m_553650180, n_553650181) && contains_1476395806(possibleTakes_553648261[0], p_553650179.tile))) { + class_553650183.push.apply(class_553650183, [32,99,97,110,45,116,97,107,101]);; + } + else { + if (isSelected_553648339(m_553650180, n_553650181)) { + class_553650183.push.apply(class_553650183, [32,115,101,108,101,99,116,101,100]);; } else { - if (isSelected_553648267(m_553648799, n_553648800)) { - class_553648802.push.apply(class_553648802, [32,115,101,108,101,99,116,101,100]);; + if (contains_1476395806(picks_553648327[0], p_553650179.tile)) { + class_553650183.push.apply(class_553650183, [32,112,105,99,107,105,110,103]);; } else { - if (contains_1476395777(possibleMoves_553648221[0], p_553648798.tile)) { - class_553648802.push.apply(class_553648802, [32,99,97,110,45,109,111,118,101]);; + if ((contains_1476395806(possibleMoves_553648256[0], p_553650179.tile) || contains_1476395806(pickOptions_553648322[0], p_553650179.tile))) { + class_553650183.push.apply(class_553650183, [32,99,97,110,45,109,111,118,101]);; } else { - if (contains_1476395777(possibleTakes_553648226[0], p_553648798.tile)) { - class_553648802.push.apply(class_553648802, [32,99,97,110,45,116,97,107,101]);; + if (contains_1476395806(possibleTakes_553648261[0], p_553650179.tile)) { + class_553650183.push.apply(class_553650183, [32,99,97,110,45,116,97,107,101]);; } else { - class_553648802.push.apply(class_553648802, [32,117,110,115,101,108,101,99,116,101,100]);; + class_553650183.push.apply(class_553650183, [32,117,110,115,101,108,101,99,116,101,100]);; } - }}} - if (contains_1476395777(piecesChecking_553648236[0], p_553648798.tile)) { - class_553648802.push.apply(class_553648802, [32,99,104,101,99,107,105,110,103]);; + }}}} + if (contains_1476395806(piecesChecking_553648271[0], p_553650179.tile)) { + class_553650183.push.apply(class_553650183, [32,99,104,101,99,107,105,110,103]);; } else { - if (contains_1476395777(lastMove_553648231[0], p_553648798.tile)) { - class_553648802.push.apply(class_553648802, [32,108,97,115,116,45,109,111,118,101]);; + if (contains_1476395806(lastMove_553648266[0], p_553650179.tile)) { + class_553650183.push.apply(class_553650183, [32,108,97,115,116,45,109,111,118,101]);; } } - var tmp_553648853 = tree_754975616(188, []); - tmp_553648853.class = toJSStr(class_553648802); - addEventHandler_721422102(tmp_553648853, 0, HEX3Aanonymous_553648864, kxi__); - if (eqStrings(p_553648798.filePath, [])) { - add_754975552(tmp_553648853, text_754975684(HEX24_1476395620(p_553648798))); + var tmp_553650262 = tree_754975616(188, []); + tmp_553650262.class = toJSStr(class_553650183); + addEventHandler_721422102(tmp_553650262, 0, HEX3Aanonymous_553650273, kxi__); + if (eqStrings(p_553650179.filePath, [])) { + add_754975552(tmp_553650262, text_754975684([])); } else { - if (p_553648798.rotate) { - Temporary2 = [114,111,116,97,116,101]; + if (p_553650179.rotate) { + Temporary15 = [114,111,116,97,116,101]; } else { - Temporary2 = []; + Temporary15 = []; } - var class_553648903 = nimCopy(null, Temporary2, NTI33554449); - if (p_553648798.colorable) { - Temporary3 = reprEnum(p_553648798.color, NTI1476395017); + var class_553650308 = nimCopy(null, Temporary15, NTI33554449); + if (p_553650179.colorable) { + Temporary16 = reprEnum(p_553650179.color, NTI1476395015); } else { - Temporary3 = []; + Temporary16 = []; } - var color_553648907 = nimCopy(null, Temporary3, NTI33554449); - var tmp_553648863 = tree_754975616(76, []); - setAttr_754975467(tmp_553648863, "src", toJSStr(([46,47,105,99,111,110,115,47] || []).concat(color_553648907 || [],p_553648798.filePath || []))); - tmp_553648863.class = toJSStr(class_553648903); - add_754975552(tmp_553648853, tmp_553648863); + var color_553650312 = nimCopy(null, Temporary16, NTI33554449); + var tmp_553650272 = tree_754975616(76, []); + setAttr_754975467(tmp_553650272, "src", toJSStr(([46,47,105,99,111,110,115,47] || []).concat(color_553650312 || [],p_553650179.filePath || []))); + tmp_553650272.class = toJSStr(class_553650308); + add_754975552(tmp_553650262, tmp_553650272); } - result_553648801 = tmp_553648853; + result_553650182 = tmp_553650262; - return result_553648801; + return result_553650182; } -function createBoard_553648923() { - var result_553648924 = null; +function createBoard_553650328() { + var result_553650329 = null; - var tmp_553648925 = tree_754975616(180, []); + var tmp_553650330 = tree_754975616(180, []); Label1: { - var i_553648933 = 0; - var r_553648934 = [({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}), ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}})]; - var i_553650001 = 0; + var i_553650338 = 0; + var r_553650339 = [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]; + var i_553652953 = 0; Label2: { Label3: while (true) { if (!true) break Label3; - i_553648933 = i_553650001; - r_553648934 = nimCopy(r_553648934, theBoard_553648213[0][chckIndx(i_553650001, 0, (theBoard_553648213[0]).length - 1)], NTI1476395014); - var tmp_553648926 = tree_754975616(187, []); + i_553650338 = i_553652953; + r_553650339 = nimCopy(r_553650339, theBoard_553648247[0][chckIndx(i_553652953, 0, (theBoard_553648247[0]).length - 1)], NTI1476395012); + var tmp_553650331 = tree_754975616(187, []); Label4: { - var j_553648941 = 0; - var p_553648942 = ({item: 0, color: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, rand: {Field0: false, Field1: 0}, wallet: {Field0: 0, Field1: []}}); - var i_553649999 = 0; + var j_553650346 = 0; + var p_553650347 = ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}); + var i_553652951 = 0; Label5: { Label6: while (true) { if (!true) break Label6; - j_553648941 = i_553649999; - p_553648942 = nimCopy(p_553648942, r_553648934[chckIndx(i_553649999, 0, (r_553648934).length - 1)], NTI1476395026); - add_754975552(tmp_553648926, createTile_553648797(p_553648942, i_553648933, j_553648941)); - if ((7 <= i_553649999)) { + j_553650346 = i_553652951; + p_553650347 = nimCopy(p_553650347, r_553650339[chckIndx(i_553652951, 0, (r_553650339).length - 1)], NTI1476395032); + add_754975552(tmp_553650331, createTile_553650178(p_553650347, i_553650338, j_553650346)); + if ((7 <= i_553652951)) { break Label5; } - i_553649999 += 1; + i_553652951 += 1; } }; }; - add_754975552(tmp_553648925, tmp_553648926); - if ((7 <= i_553650001)) { + add_754975552(tmp_553650330, tmp_553650331); + if ((7 <= i_553652953)) { break Label2; } - i_553650001 += 1; + i_553652953 += 1; } }; }; - result_553648924 = tmp_553648925; + result_553650329 = tmp_553650330; - return result_553648924; + return result_553650329; } -function reverseBoard_553648943() { - var result_553648944 = null; +function reverseBoard_553650348() { + var result_553650349 = null; - var tmp_553648945 = tree_754975616(180, []); + var tmp_553650350 = tree_754975616(180, []); Label1: { - var i_553648952 = 0; - var res_553650015 = 7; + var i_553650357 = 0; + var res_553652980 = 7; Label2: { Label3: while (true) { - if (!(0 <= res_553650015)) break Label3; - i_553648952 = res_553650015; - var tmp_553648946 = tree_754975616(187, []); + if (!(0 <= res_553652980)) break Label3; + i_553650357 = res_553652980; + var tmp_553650351 = tree_754975616(187, []); Label4: { - var j_553648958 = 0; - var res_553650013 = 7; + var j_553650363 = 0; + var res_553652978 = 7; Label5: { Label6: while (true) { - if (!(0 <= res_553650013)) break Label6; - j_553648958 = res_553650013; - add_754975552(tmp_553648946, createTile_553648797(theBoard_553648213[0][chckIndx(i_553648952, 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648958, 0, (theBoard_553648213[0][chckIndx(i_553648952, 0, (theBoard_553648213[0]).length - 1)]).length - 1)], i_553648952, j_553648958)); - res_553650013 = subInt(res_553650013, 1); + if (!(0 <= res_553652978)) break Label6; + j_553650363 = res_553652978; + add_754975552(tmp_553650351, createTile_553650178(theBoard_553648247[0][chckIndx(i_553650357, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553650363, 0, (theBoard_553648247[0][chckIndx(i_553650357, 0, (theBoard_553648247[0]).length - 1)]).length - 1)], i_553650357, j_553650363)); + res_553652978 = subInt(res_553652978, 1); } }; }; - add_754975552(tmp_553648945, tmp_553648946); - res_553650015 = subInt(res_553650015, 1); + add_754975552(tmp_553650350, tmp_553650351); + res_553652980 = subInt(res_553652980, 1); } }; }; - result_553648944 = tmp_553648945; + result_553650349 = tmp_553650350; - return result_553648944; + return result_553650349; } -function createWallet_553649343(side_553649344) { - var result_553649345 = null; +function HEX5BHEX5D_553650763(s_553650765, i_553650766) { + var result_553650767 = null; - var tmp_553649346 = tree_754975616(44, []); - if (hasWallet_1476395847(side_553649344, theBoard_553648213[0])) { - var tmp_553649347 = tree_754975616(21, []); - Label1: { - var fmtRes_553649352 = [mnewString(0)]; - fmtRes_553649352[0].push.apply(fmtRes_553649352[0], [89,111,117,32,104,97,118,101,32]);; - formatValue_553649289(fmtRes_553649352, 0, getWallet_1476395857(side_553649344, theBoard_553648213[0])); - fmtRes_553649352[0].push.apply(fmtRes_553649352[0], [32,100,111,108,108,97,114,115,46]);; - }; - add_754975552(tmp_553649347, text_754975684(fmtRes_553649352[0])); - add_754975552(tmp_553649346, tmp_553649347); - } - - result_553649345 = tmp_553649346; + result_553650767 = s_553650765[chckIndx(subInt((s_553650765).length, i_553650766), 0, (s_553650765).length - 1)]; - return result_553649345; + return result_553650767; } -function createGame_553649359() { - var Temporary1; +function pop_553650846(s_553650848, s_553650848_Idx) { + var result_553650849 = {Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}; + + var L_553650853 = subInt((s_553650848[s_553650848_Idx]).length, 1); + result_553650849 = nimCopy(result_553650849, s_553650848[s_553650848_Idx][chckIndx(L_553650853, 0, (s_553650848[s_553650848_Idx]).length - 1)], NTI553648138); + if (s_553650848[s_553650848_Idx].length < chckRange(L_553650853, 0, 2147483647)) { for (var i = s_553650848[s_553650848_Idx].length ; i < chckRange(L_553650853, 0, 2147483647) ; ++i) s_553650848[s_553650848_Idx].push({Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}); } + else { s_553650848[s_553650848_Idx].length = chckRange(L_553650853, 0, 2147483647); }; + + return result_553650849; + +} + +function newSeq_553649523(len_553649525) { + var result_553649526 = []; + + result_553649526 = new Array(len_553649525); for (var i = 0 ; i < len_553649525 ; ++i) { result_553649526[i] = false; } + return result_553649526; + +} - var result_553649360 = null; +function updateActionStack_553649105() { + var Temporary7; - rawEcho(HEX24_385875976(screenWidth_553648185[0])); - if ((1250 < screenWidth_553648185[0])) { - var tmp_553649361 = tree_754975616(44, []); - tmp_553649361.class = "main"; - var tmp_553649362 = tree_754975616(44, []); - tmp_553649362.class = "column-scroll"; - if (!(isSelected_553648267((-1), (-1)))) { - add_754975552(tmp_553649362, createPieceProfile_553649306(pieceOf_553648248(selectedTile_553648216[0]))); + rawEcho([97,115], HEX24_553649269(actionStack_553648298[0])); + rawEcho([110,97,115], HEX24_553649269(nextActionStack_553648303[0])); + rawEcho([115], HEX24_553649269(toSend_553648308[0])); + if (((actionStack_553648298[0]).length == 0)) { + if (!(((nextActionStack_553648303[0]).length == 0))) { + Label1: { + var i_553649482 = 0; + var x_553649483 = {Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}; + var i_553653005 = 0; + var L_553653006 = (nextActionStack_553648303[0]).length; + Label2: { + Label3: while (true) { + if (!(i_553653005 < L_553653006)) break Label3; + i_553649482 = i_553653005; + x_553649483 = nimCopy(x_553649483, nextActionStack_553648303[0][chckIndx(i_553653005, 0, (nextActionStack_553648303[0]).length - 1)], NTI553648138); + nextActionStack_553648303[0][chckIndx(i_553649482, 0, (nextActionStack_553648303[0]).length - 1)].Field1 = subInt(nextActionStack_553648303[0][chckIndx(i_553649482, 0, (nextActionStack_553648303[0]).length - 1)].Field1, 1); + i_553653005 += 1; + if (!(((nextActionStack_553648303[0]).length == L_553653006))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(187, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; } - Label2: { - var p_553649368 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649963 = []; - colontmp__553649963 = replaceAnySynergies_1728054439(myDrafts_553648201[0]); - var i_553649964 = 0; - var L_553649965 = (colontmp__553649963).length; - Label3: { - Label4: while (true) { - if (!(i_553649964 < L_553649965)) break Label4; - p_553649368 = colontmp__553649963[chckIndx(i_553649964, 0, (colontmp__553649963).length - 1)]; - add_754975552(tmp_553649362, createPowerSummary_553649254(p_553649368, side_553648195[0])); - i_553649964 += 1; - if (!(((colontmp__553649963).length == L_553649965))) { + if (false) { + if (!(((toSend_553648308[0]).length == 0))) { + Label4: { + var x_553649495 = {Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}; + var i_553653009 = 0; + var L_553653010 = (toSend_553648308[0]).length; + Label5: { + Label6: while (true) { + if (!(i_553653009 < L_553653010)) break Label6; + x_553649495 = toSend_553648308[0][chckIndx(i_553653009, 0, (toSend_553648308[0]).length - 1)]; + x_553649495.Field6(); + rawEcho([115,101,110,100,44,32,116,104,105,115,32,101,110,100,115,32,116,117,114,110,32,105,102,32,46,115,101,110,100,32,100,111,101,115]); + i_553653009 += 1; + if (!(((toSend_553648308[0]).length == L_553653010))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - add_754975552(tmp_553649361, tmp_553649362); - var tmp_553649363 = tree_754975616(44, []); - tmp_553649363.class = "column"; - if ((side_553648195[0] == 1)) { - add_754975552(tmp_553649363, createBoard_553648923()); } else { - add_754975552(tmp_553649363, reverseBoard_553648943()); + if (!!(((nextActionStack_553648303[0]).length == 0))) Temporary7 = false; else { Label8: { + var iHEX60gensym121_553649519 = 0; + var resultHEX60gensym121_553649563 = newSeq_553649523(chckRange((nextActionStack_553648303[0]).length, 0, 2147483647)); + Label9: { + var it_553649567 = {Field0: [], Field1: 0, Field2: 0, Field3: null, Field4: false, Field5: false, Field6: null}; + var i_553653014 = 0; + var L_553653015 = (nextActionStack_553648303[0]).length; + Label10: { + Label11: while (true) { + if (!(i_553653014 < L_553653015)) break Label11; + it_553649567 = nextActionStack_553648303[0][chckIndx(i_553653014, 0, (nextActionStack_553648303[0]).length - 1)]; + resultHEX60gensym121_553649563[chckIndx(iHEX60gensym121_553649519, 0, (resultHEX60gensym121_553649563).length - 1)] = it_553649567.Field5; + iHEX60gensym121_553649519 = addInt(iHEX60gensym121_553649519, 1); + i_553653014 += 1; + if (!(((nextActionStack_553648303[0]).length == L_553653015))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + }; + var sHEX60gensym124_553649579 = nimCopy(null, resultHEX60gensym121_553649563, NTI553649219); + var nHEX60gensym124_553649584 = (sHEX60gensym124_553649579).length; + if (!((0 < nHEX60gensym124_553649584))) { + failedAssertImpl_268435541(makeNimstrLit("sequtils.nim(977, 3) `n`gensym124 > 0` Can\'t fold empty sequences")); + } + + var resultHEX60gensym124_553649590 = sHEX60gensym124_553649579[chckIndx(subInt(nHEX60gensym124_553649584, 1), 0, (sHEX60gensym124_553649579).length - 1)]; + Label12: { + var iHEX60gensym124_553649596 = 0; + var colontmp__553653018 = 0; + colontmp__553653018 = subInt(nHEX60gensym124_553649584, 2); + var res_553653019 = colontmp__553653018; + Label13: { + Label14: while (true) { + if (!(0 <= res_553653019)) break Label14; + iHEX60gensym124_553649596 = res_553653019; + var a_553649597 = sHEX60gensym124_553649579[chckIndx(iHEX60gensym124_553649596, 0, (sHEX60gensym124_553649579).length - 1)]; + var b_553649598 = resultHEX60gensym124_553649590; + resultHEX60gensym124_553649590 = (a_553649597 && b_553649598); + res_553653019 = subInt(res_553653019, 1); + } + }; + }; + Temporary7 = !(resultHEX60gensym124_553649590); } if (Temporary7) { + sendAction_553649085([112,97,115,115], true); + } + } - add_754975552(tmp_553649363, createWallet_553649343(side_553648195[0])); - add_754975552(tmp_553649361, tmp_553649363); - var tmp_553649364 = tree_754975616(44, []); - tmp_553649364.class = "column-scroll"; - Label5: { - var p_553649376 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649968 = []; - colontmp__553649968 = replaceAnySynergies_1728054439(opponentDrafts_553648206[0]); - var i_553649969 = 0; - var L_553649970 = (colontmp__553649968).length; - Label6: { - Label7: while (true) { - if (!(i_553649969 < L_553649970)) break Label7; - p_553649376 = colontmp__553649968[chckIndx(i_553649969, 0, (colontmp__553649968).length - 1)]; - add_754975552(tmp_553649364, createPowerSummary_553649254(p_553649376, otherSide_1476395613(side_553648195[0]))); - i_553649969 += 1; - if (!(((colontmp__553649968).length == L_553649970))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } + } + + actionStack_553648298[0] = nimCopy(null, nextActionStack_553648303[0], NTI553648256); + nextActionStack_553648303[0] = nimCopy(null, [], NTI553648255); + toSend_553648308[0] = nimCopy(null, [], NTI553648255); + } + + + +} + +function HEX5BHEX5D_553651028(s_553651030, i_553651031) { + var result_553651032 = null; + var result_553651032_Idx = 0; + + result_553651032 = s_553651030; result_553651032_Idx = chckIndx(subInt((s_553651030).length, i_553651031), 0, (s_553651030).length - 1); + + return [result_553651032, result_553651032_Idx]; + +} + +function pop_553649910(s_553649912, s_553649912_Idx) { + var result_553649913 = {Field0: 0, Field1: 0}; + + var L_553649917 = subInt((s_553649912[s_553649912_Idx]).length, 1); + result_553649913 = nimCopy(result_553649913, s_553649912[s_553649912_Idx][chckIndx(L_553649917, 0, (s_553649912[s_553649912_Idx]).length - 1)], NTI1476395011); + if (s_553649912[s_553649912_Idx].length < chckRange(L_553649917, 0, 2147483647)) { for (var i = s_553649912[s_553649912_Idx].length ; i < chckRange(L_553649917, 0, 2147483647) ; ++i) s_553649912[s_553649912_Idx].push({Field0: 0, Field1: 0}); } + else { s_553649912[s_553649912_Idx].length = chckRange(L_553649917, 0, 2147483647); }; + + return result_553649913; + +} + +function cancelPick_553649901() { + if ((0 < (promptHistory_553648313[0]).length)) { + picksLeft_553648319[0] = addInt(picksLeft_553648319[0], 1); + var _ = pop_553649910(picks_553648327, 0); + promptStack_553648318[0].push(pop_553649922(promptHistory_553648313, 0));; + pickOptions_553648322[0] = nimCopy(null, getPickOptions_553648321[0](), NTI553648293); + } + + + +} + +function cancelPick_553649938(__553649939, __553649940) { + cancelPick_553649901(); + + +} + +function createInfo_553650746() { + +function HEX3Aanonymous_553650820(__553650821, __553650822) { + HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field3(theBoard_553648247[0], theState_553648248[0]); + rawEcho([97,99,116,105,111,110,32,99,111,109,112,108,101,116,101]); + Label1: { + var i_553650827 = 0; + var j_553650828 = 0; + Label2: { + var i_553652996 = 0; + var i_553652997 = 0; + Label3: { + Label4: while (true) { + if (!(i_553652997 < 8)) break Label4; + i_553652996 = i_553652997; + Label5: { + var j_553653000 = 0; + var i_553653001 = 0; + Label6: { + Label7: while (true) { + if (!(i_553653001 < 8)) break Label7; + j_553653000 = i_553653001; + i_553650827 = i_553652996; + j_553650828 = j_553653000; + var resultHEX60gensym181_553650833 = newSeq_553649837(0); + Label8: { + var it_553650837 = {Field0: {Field0: 0, Field1: 0}, Field1: 0, Field2: 0}; + var colontmp__553652991 = []; + colontmp__553652991 = theBoard_553648247[0][chckIndx(i_553650827, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553650828, 0, (theBoard_553648247[0][chckIndx(i_553650827, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts; + var i_553652992 = 0; + var L_553652993 = (colontmp__553652991).length; + Label9: { + Label10: while (true) { + if (!(i_553652992 < L_553652993)) break Label10; + it_553650837 = colontmp__553652991[chckIndx(i_553652992, 0, (colontmp__553652991).length - 1)]; + if (!((it_553650837.Field1 == HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field2))) { + var Temporary11 = nimCopy(null, it_553650837, NTI1476395023); + resultHEX60gensym181_553650833.push(Temporary11);; + } + + i_553652992 += 1; + if (!(((colontmp__553652991).length == L_553652993))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + theBoard_553648247[0][chckIndx(i_553650827, 0, (theBoard_553648247[0]).length - 1)][chckIndx(j_553650828, 0, (theBoard_553648247[0][chckIndx(i_553650827, 0, (theBoard_553648247[0]).length - 1)]).length - 1)].casts = nimCopy(null, resultHEX60gensym181_553650833, NTI553649491); + i_553653001 = addInt(i_553653001, 1); + } + }; + }; + i_553652997 = addInt(i_553652997, 1); + } + }; + }; + }; + toSend_553648308[0].push(pop_553650846(actionStack_553648298, 0));; + rawEcho([115,101,110,116]); + updateActionStack_553649105(); + + + } + +function HEX3Aanonymous_553650935(__553650936, __553650937) { + nextActionStack_553648303[0].push(pop_553650846(actionStack_553648298, 0));; + updateActionStack_553649105(); + + + } + +function HEX3Aanonymous_553650945(__553650946, __553650947) { + var _ = pop_553650846(actionStack_553648298, 0); + updateActionStack_553649105(); + + + } + +function HEX3Aanonymous_553651003(__553651004, __553651005) { + nextActionStack_553648303[0].push(pop_553650846(actionStack_553648298, 0));; + updateActionStack_553649105(); + + + } + var Temporary7; + var Temporary9; + + var result_553650747 = null; + + var tmp_553650748 = tree_754975616(44, []); + tmp_553650748.class = "bottom-info"; + if ((turn_553648230[0] && !(((actionStack_553648298[0]).length == 0)))) { + if ((HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field1 == 0)) { + var tmp_553650749 = tree_754975616(23, []); + if (HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field5) { + Label1: { + var fmtRes_553650796 = [mnewString(0)]; + fmtRes_553650796[0].push.apply(fmtRes_553650796[0], [69,120,101,99,117,116,101,32]);; + formatValue_553649009(fmtRes_553650796, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650796[0].push.apply(fmtRes_553650796[0], makeNimstrLit(" (This will end your turn, after all other actions are resolved): "));; + }; + add_754975552(tmp_553650749, text_754975684(fmtRes_553650796[0])); + } + else { + Label2: { + var fmtRes_553650810 = [mnewString(0)]; + fmtRes_553650810[0].push.apply(fmtRes_553650810[0], [69,120,101,99,117,116,101,32]);; + formatValue_553649009(fmtRes_553650810, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650810[0].push.apply(fmtRes_553650810[0], [58,32]);; }; + add_754975552(tmp_553650749, text_754975684(fmtRes_553650810[0])); + } + + add_754975552(tmp_553650748, tmp_553650749); + var tmp_553650750 = tree_754975616(195, []); + add_754975552(tmp_553650750, text_754975684([69,120,101,99,117,116,101,33])); + add_754975552(tmp_553650748, tmp_553650750); + addEventHandler_721422102(tmp_553650748, 0, HEX3Aanonymous_553650820, kxi__); + } + else { + if (HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field4) { + var tmp_553650751 = tree_754975616(23, []); + if (HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field5) { + Label3: { + var fmtRes_553650891 = [mnewString(0)]; + formatValue_553649009(fmtRes_553650891, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650891[0].push.apply(fmtRes_553650891[0], [32,119,105,108,108,32,99,111,109,112,108,101,116,101,32,105,110,32]);; + formatValue_553649687(fmtRes_553650891, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field1); + fmtRes_553650891[0].push.apply(fmtRes_553650891[0], [46,32,67,111,110,116,105,110,117,105,110,103,32,100,111,101,115,32,110,111,116,32,101,110,100,32,121,111,117,114,32,116,117,114,110,46,32]);; }; - add_754975552(tmp_553649361, tmp_553649364); - Temporary1 = tmp_553649361; + add_754975552(tmp_553650751, text_754975684(fmtRes_553650891[0])); } else { - var tmp_553649377 = tree_754975616(44, []); - tmp_553649377.class = "column height-100"; - Label8: { - var p_553649381 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649973 = []; - colontmp__553649973 = replaceAnySynergies_1728054439(opponentDrafts_553648206[0]); - var i_553649974 = 0; - var L_553649975 = (colontmp__553649973).length; - Label9: { - Label10: while (true) { - if (!(i_553649974 < L_553649975)) break Label10; - p_553649381 = colontmp__553649973[chckIndx(i_553649974, 0, (colontmp__553649973).length - 1)]; - add_754975552(tmp_553649377, createPowerSummary_553649254(p_553649381, otherSide_1476395613(side_553648195[0]))); - i_553649974 += 1; - if (!(((colontmp__553649973).length == L_553649975))) { + Label4: { + var fmtRes_553650915 = [mnewString(0)]; + formatValue_553649009(fmtRes_553650915, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650915[0].push.apply(fmtRes_553650915[0], [32,119,105,108,108,32,99,111,109,112,108,101,116,101,32,105,110,32]);; + formatValue_553649687(fmtRes_553650915, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field1); + fmtRes_553650915[0].push.apply(fmtRes_553650915[0], [46,32,89,111,117,114,32,116,117,114,110,32,119,105,108,108,32,101,110,100,32,105,102,32,121,111,117,32,99,111,110,116,105,110,117,101,46]);; + }; + add_754975552(tmp_553650751, text_754975684(fmtRes_553650915[0])); + } + + add_754975552(tmp_553650748, tmp_553650751); + var tmp_553650752 = tree_754975616(44, []); + tmp_553650752.class = "column"; + var tmp_553650753 = tree_754975616(195, []); + add_754975552(tmp_553650753, text_754975684([67,111,110,116,105,110,117,101])); + addEventHandler_721422102(tmp_553650753, 0, HEX3Aanonymous_553650935, kxi__); + add_754975552(tmp_553650752, tmp_553650753); + var tmp_553650754 = tree_754975616(195, []); + add_754975552(tmp_553650754, text_754975684([67,97,110,99,101,108])); + addEventHandler_721422102(tmp_553650754, 0, HEX3Aanonymous_553650945, kxi__); + add_754975552(tmp_553650752, tmp_553650754); + add_754975552(tmp_553650748, tmp_553650752); + } + else { + var tmp_553650755 = tree_754975616(23, []); + if (HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field5) { + Label5: { + var fmtRes_553650959 = [mnewString(0)]; + formatValue_553649009(fmtRes_553650959, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650959[0].push.apply(fmtRes_553650959[0], [32,119,105,108,108,32,114,101,115,111,108,118,101,32,105,110,32]);; + formatValue_553649687(fmtRes_553650959, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field1); + fmtRes_553650959[0].push.apply(fmtRes_553650959[0], [32,116,117,114,110,115,46]);; + }; + add_754975552(tmp_553650755, text_754975684(fmtRes_553650959[0])); + } + else { + Label6: { + var fmtRes_553650983 = [mnewString(0)]; + formatValue_553649009(fmtRes_553650983, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field0); + fmtRes_553650983[0].push.apply(fmtRes_553650983[0], [32,119,105,108,108,32,114,101,115,111,108,118,101,32,105,110,32]);; + formatValue_553649687(fmtRes_553650983, 0, HEX5BHEX5D_553650763(actionStack_553648298[0], 1).Field1); + fmtRes_553650983[0].push.apply(fmtRes_553650983[0], makeNimstrLit(" turns.\x0A This will end your turn, once all other actions are resolved."));; + }; + add_754975552(tmp_553650755, text_754975684(fmtRes_553650983[0])); + } + + add_754975552(tmp_553650748, tmp_553650755); + var tmp_553650756 = tree_754975616(195, []); + add_754975552(tmp_553650756, text_754975684([79,107])); + addEventHandler_721422102(tmp_553650756, 0, HEX3Aanonymous_553651003, kxi__); + add_754975552(tmp_553650748, tmp_553650756); + } + } + } + else { + if (((promptStack_553648318[0]).length == 0)) { + if (turn_553648230[0]) { + Temporary7 = [73,116,32,105,115,32,121,111,117,114,32,116,117,114,110,46,32]; + } + else { + Temporary7 = [79,112,112,111,110,101,110,116,32,105,115,32,109,111,118,105,110,103,46,32]; + } + + var text_553651016 = nimCopy(null, Temporary7, NTI33554449); + if (hasWallet_1828716548(side_553648229[0], theState_553648248[0])) { + Label8: { + var fmtRes_553651021 = [mnewString(0)]; + fmtRes_553651021[0].push.apply(fmtRes_553651021[0], [89,111,117,32,104,97,118,101,32]);; + formatValue_553649687(fmtRes_553651021, 0, getMoney_1828716559(side_553648229[0], theState_553648248[0])); + fmtRes_553651021[0].push.apply(fmtRes_553651021[0], [32,100,111,108,108,97,114,115,46]);; + }; + text_553651016.push.apply(text_553651016, fmtRes_553651021[0]);; + } + + var tmp_553650757 = tree_754975616(23, []); + add_754975552(tmp_553650757, text_754975684(text_553651016)); + add_754975552(tmp_553650748, tmp_553650757); + } + else { + var tmp_553650758 = tree_754975616(23, []); + add_754975552(tmp_553650758, text_754975684((Temporary9 = HEX5BHEX5D_553651028(promptStack_553648318[0], 1), Temporary9)[0][Temporary9[1]])); + add_754975552(tmp_553650748, tmp_553650758); + var tmp_553650759 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553650759, 0, cancelPick_553649938, kxi__); + add_754975552(tmp_553650759, text_754975684([85,110,100,111,32,108,97,115,116])); + add_754975552(tmp_553650748, tmp_553650759); + } + } + result_553650747 = tmp_553650748; + + return result_553650747; + +} + +function createGame_553651526() { + var Temporary1; + var Temporary2; + +function HEX3Aanonymous_553651546(__553651547, __553651548) { + currentTab_553648277[0] = 0; + + + } + +function HEX3Aanonymous_553651565(__553651566, __553651567) { + currentTab_553648277[0] = 1; + + + } + +function HEX3Aanonymous_553651568(__553651569, __553651570) { + currentTab_553648277[0] = 2; + + + } + +function HEX3Aanonymous_553651571(__553651572, __553651573) { + currentTab_553648277[0] = 3; + + + } + +function HEX3Aanonymous_553651578(__553651579, __553651580) { + showDebug_553648274[0] = true; + + + } + + var result_553651527 = null; + + if ((1200 < screenWidth_553648279[0])) { + Temporary1 = [109,97,105,110]; + } + else { + Temporary1 = [99,111,108,117,109,110,32,104,101,105,103,104,116,45,49,48,48]; + } + + var topClass_553651528 = nimCopy(null, Temporary1, NTI33554449); + if ((1200 < screenWidth_553648279[0])) { + Temporary2 = [116,97,98,45,99,111,108,117,109,110]; + } + else { + Temporary2 = [116,97,98,45,99,111,108,117,109,110,32,108,111,110,103]; + } + + var nextClass_553651529 = nimCopy(null, Temporary2, NTI33554449); + var tmp_553651530 = tree_754975616(44, []); + tmp_553651530.class = toJSStr(topClass_553651528); + var tmp_553651531 = tree_754975616(44, []); + tmp_553651531.class = toJSStr(nextClass_553651529); + var tmp_553651532 = tree_754975616(44, []); + tmp_553651532.class = "tab-row"; + var tmp_553651533 = tree_754975616(195, []); + add_754975552(tmp_553651533, text_754975684([89,111,117,114,32,68,114,97,102,116,115])); + addEventHandler_721422102(tmp_553651533, 0, HEX3Aanonymous_553651546, kxi__); + add_754975552(tmp_553651532, tmp_553651533); + var tmp_553651534 = tree_754975616(195, []); + add_754975552(tmp_553651534, text_754975684([79,112,112,111,110,101,110,116,32,68,114,97,102,116,115])); + addEventHandler_721422102(tmp_553651534, 0, HEX3Aanonymous_553651565, kxi__); + add_754975552(tmp_553651532, tmp_553651534); + var tmp_553651535 = tree_754975616(195, []); + add_754975552(tmp_553651535, text_754975684([80,111,119,101,114,32,67,111,110,116,114,111,108])); + addEventHandler_721422102(tmp_553651535, 0, HEX3Aanonymous_553651568, kxi__); + add_754975552(tmp_553651532, tmp_553651535); + if ((true || showDebug_553648274[0])) { + var tmp_553651536 = tree_754975616(195, []); + add_754975552(tmp_553651536, text_754975684([68,101,98,117,103])); + addEventHandler_721422102(tmp_553651536, 0, HEX3Aanonymous_553651571, kxi__); + add_754975552(tmp_553651532, tmp_553651536); + } + + add_754975552(tmp_553651531, tmp_553651532); + var tmp_553651537 = tree_754975616(44, []); + tmp_553651537.class = "column-scroll"; + switch (currentTab_553648277[0]) { + case 0: + Label3: { + var p_553651577 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var colontmp__553652838 = []; + colontmp__553652838 = replaceAnySynergies_1728054542(myDrafts_553648235[0]); + var i_553652839 = 0; + var L_553652840 = (colontmp__553652838).length; + Label4: { + Label5: while (true) { + if (!(i_553652839 < L_553652840)) break Label5; + p_553651577 = colontmp__553652838[chckIndx(i_553652839, 0, (colontmp__553652838).length - 1)]; + add_754975552(tmp_553651537, createPowerSummary_553650659(p_553651577, side_553648229[0])); + i_553652839 += 1; + if (!(((colontmp__553652838).length == L_553652840))) { failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); } } }; }; - if ((!(isSelected_553648267((-1), (-1))) && isColor_1476395605(pieceOf_553648248(selectedTile_553648216[0]), otherSide_1476395613(side_553648195[0])))) { - add_754975552(tmp_553649377, createPieceProfile_553649306(pieceOf_553648248(selectedTile_553648216[0]))); - } - - if ((side_553648195[0] == 1)) { - add_754975552(tmp_553649377, createBoard_553648923()); + var tmp_553651538 = tree_754975616(44, []); + tmp_553651538.class = "debug"; + addEventHandler_721422102(tmp_553651538, 0, HEX3Aanonymous_553651578, kxi__); + add_754975552(tmp_553651537, tmp_553651538); + break; + case 1: + Label6: { + var p_553651584 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); + var colontmp__553652843 = []; + colontmp__553652843 = replaceAnySynergies_1728054542(opponentDrafts_553648240[0]); + var i_553652844 = 0; + var L_553652845 = (colontmp__553652843).length; + Label7: { + Label8: while (true) { + if (!(i_553652844 < L_553652845)) break Label8; + p_553651584 = colontmp__553652843[chckIndx(i_553652844, 0, (colontmp__553652843).length - 1)]; + add_754975552(tmp_553651537, createPowerSummary_553650659(p_553651584, otherSide_1476396146(side_553648229[0]))); + i_553652844 += 1; + if (!(((colontmp__553652843).length == L_553652845))) { + failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); + } + + } + }; + }; + break; + case 2: + if ((isSelected_553648339((-1), (-1)) || isAir_1476396121(HEX5BHEX5D_1476395509(theBoard_553648247[0], selectedTile_553648251[0])))) { + add_754975552(tmp_553651537, createPieceProfile_553650710(HEX5BHEX5D_1476395509(theBoard_553648247[0], getKing_1476396334(side_553648229[0], theBoard_553648247[0])))); } else { - add_754975552(tmp_553649377, reverseBoard_553648943()); + add_754975552(tmp_553651537, createPieceProfile_553650710(pieceOf_553648336(selectedTile_553648251[0]))); } - add_754975552(tmp_553649377, createWallet_553649343(side_553648195[0])); - if ((!(isSelected_553648267((-1), (-1))) && isColor_1476395605(pieceOf_553648248(selectedTile_553648216[0]), side_553648195[0]))) { - add_754975552(tmp_553649377, createPieceProfile_553649306(pieceOf_553648248(selectedTile_553648216[0]))); + if (hasGlass_1895825432(side_553648229[0], theState_553648248[0])) { + add_754975552(tmp_553651537, createGlassMenu_553651127()); } + break; + case 3: + var tmp_553651539 = tree_754975616(44, []); + tmp_553651539.class = "main"; + Label9: { + var fmtRes_553651589 = [mnewString(0)]; + fmtRes_553651589[0].push.apply(fmtRes_553651589[0], [83,104,97,114,101,100,58,32]);; + formatValue_553649009(fmtRes_553651589, 0, HEX24_553651590(theState_553648248[0].Field0)); + }; + add_754975552(tmp_553651539, text_754975684(fmtRes_553651589[0])); + add_754975552(tmp_553651537, tmp_553651539); + var tmp_553651540 = tree_754975616(44, []); + tmp_553651540.class = "main"; + Label10: { + var fmtRes_553651665 = [mnewString(0)]; + fmtRes_553651665[0].push.apply(fmtRes_553651665[0], [87,104,105,116,101,58,32]);; + formatValue_553649009(fmtRes_553651665, 0, HEX24_553651666(theState_553648248[0].Field1[chckIndx(1, 0, (theState_553648248[0].Field1).length - 1)])); + }; + add_754975552(tmp_553651540, text_754975684(fmtRes_553651665[0])); + add_754975552(tmp_553651537, tmp_553651540); + var tmp_553651541 = tree_754975616(44, []); + tmp_553651541.class = "main"; Label11: { - var p_553649389 = ({name: [], technicalName: [], synergy: false, tier: 0, rarity: 0, description: [], icon: [], rotatable: false, noColor: false, onStart: null, index: 0, priority: 0}); - var colontmp__553649978 = []; - colontmp__553649978 = replaceAnySynergies_1728054439(myDrafts_553648201[0]); - var i_553649979 = 0; - var L_553649980 = (colontmp__553649978).length; - Label12: { - Label13: while (true) { - if (!(i_553649979 < L_553649980)) break Label13; - p_553649389 = colontmp__553649978[chckIndx(i_553649979, 0, (colontmp__553649978).length - 1)]; - add_754975552(tmp_553649377, createPowerSummary_553649254(p_553649389, side_553648195[0])); - i_553649979 += 1; - if (!(((colontmp__553649978).length == L_553649980))) { - failedAssertImpl_268435541(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - }; + var fmtRes_553652201 = [mnewString(0)]; + fmtRes_553652201[0].push.apply(fmtRes_553652201[0], [66,108,97,99,107,58,32]);; + formatValue_553649009(fmtRes_553652201, 0, HEX24_553651666(theState_553648248[0].Field1[chckIndx(0, 0, (theState_553648248[0].Field1).length - 1)])); + }; + add_754975552(tmp_553651541, text_754975684(fmtRes_553652201[0])); + add_754975552(tmp_553651537, tmp_553651541); + if (!(isSelected_553648339((-1), (-1)))) { + var tmp_553651542 = tree_754975616(44, []); + tmp_553651542.class = "main"; + Label12: { + var fmtRes_553652214 = [mnewString(0)]; + fmtRes_553652214[0].push.apply(fmtRes_553652214[0], [83,101,108,101,99,116,101,100,32,112,105,101,99,101,58,32]);; + formatValue_553649009(fmtRes_553652214, 0, HEX24_553648427(pieceOf_553648336(selectedTile_553648251[0]))); }; - Temporary1 = tmp_553649377; + add_754975552(tmp_553651542, text_754975684(fmtRes_553652214[0])); + add_754975552(tmp_553651537, tmp_553651542); + } + + var tmp_553651543 = tree_754975616(44, []); + tmp_553651543.class = "main"; + Label13: { + var fmtRes_553652227 = [mnewString(0)]; + fmtRes_553652227[0].push.apply(fmtRes_553652227[0], [65,99,116,105,111,110,32,83,116,97,99,107,58,32]);; + formatValue_553652228(fmtRes_553652227, 0, actionStack_553648298[0]); + }; + add_754975552(tmp_553651543, text_754975684(fmtRes_553652227[0])); + add_754975552(tmp_553651537, tmp_553651543); + var tmp_553651544 = tree_754975616(44, []); + tmp_553651544.class = "main"; + Label14: { + var fmtRes_553652246 = [mnewString(0)]; + fmtRes_553652246[0].push.apply(fmtRes_553652246[0], [78,101,120,116,32,65,99,116,105,111,110,83,116,97,99,107,58,32]);; + formatValue_553652228(fmtRes_553652246, 0, nextActionStack_553648303[0]); + }; + add_754975552(tmp_553651544, text_754975684(fmtRes_553652246[0])); + add_754975552(tmp_553651537, tmp_553651544); + break; + } + add_754975552(tmp_553651531, tmp_553651537); + add_754975552(tmp_553651530, tmp_553651531); + var tmp_553651545 = tree_754975616(44, []); + tmp_553651545.class = "column"; + if ((side_553648229[0] == 1)) { + add_754975552(tmp_553651545, createBoard_553650328()); + } + else { + add_754975552(tmp_553651545, reverseBoard_553650348()); } - result_553649360 = Temporary1; + add_754975552(tmp_553651545, createInfo_553650746()); + add_754975552(tmp_553651530, tmp_553651545); + result_553651527 = tmp_553651530; - return result_553649360; + return result_553651527; } -function createResults_553649390() { +function createResults_553652257() { -function HEX3Aanonymous_553649397(__553649398, __553649399) { - if ((side_553648195[0] == 0)) { - joinLogic_553648710([], 6); +function HEX3Aanonymous_553652264(__553652265, __553652266) { + if ((side_553648229[0] == 0)) { + joinLogic_553650093([], 5); } else { - peer_553648194[0].Field0("rematch:please"); + peer_553648228[0].Field0("rematch:please"); } - currentScreen_553648240[0] = 7; + currentScreen_553648276[0] = 7; } -function HEX3Aanonymous_553649406(__553649407, __553649408) { - if ((side_553648195[0] == 1)) { - hostLogic_553648663([], 5); +function HEX3Aanonymous_553652273(__553652274, __553652275) { + if ((side_553648229[0] == 1)) { + hostLogic_553650048([], 4); } else { - if ((side_553648195[0] == 0)) { - joinLogic_553648710([], 5); + if ((side_553648229[0] == 0)) { + joinLogic_553650093([], 4); } } - currentScreen_553648240[0] = 0; + currentScreen_553648276[0] = 0; } - var result_553649391 = null; + var result_553652258 = null; - var tmp_553649392 = tree_754975616(44, []); - tmp_553649392.class = "start-column"; - if (alive_1476395633(side_553648195[0], theBoard_553648213[0])) { - var tmp_553649393 = tree_754975616(21, []); - add_754975552(tmp_553649393, text_754975684([89,111,117,32,119,111,110,33])); - add_754975552(tmp_553649392, tmp_553649393); + var tmp_553652259 = tree_754975616(44, []); + tmp_553652259.class = "start-column"; + if (alive_1476396153(side_553648229[0], theBoard_553648247[0])) { + var tmp_553652260 = tree_754975616(21, []); + add_754975552(tmp_553652260, text_754975684([89,111,117,32,119,111,110,33])); + add_754975552(tmp_553652259, tmp_553652260); } else { - var tmp_553649394 = tree_754975616(21, []); - add_754975552(tmp_553649394, text_754975684([89,111,117,32,108,111,115,116,46,46,46])); - add_754975552(tmp_553649392, tmp_553649394); + var tmp_553652261 = tree_754975616(21, []); + add_754975552(tmp_553652261, text_754975684([89,111,117,32,108,111,115,116,46,46,46])); + add_754975552(tmp_553652259, tmp_553652261); } - var tmp_553649395 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649395, 0, HEX3Aanonymous_553649397, kxi__); - add_754975552(tmp_553649395, text_754975684([82,101,109,97,116,99,104])); - add_754975552(tmp_553649392, tmp_553649395); - var tmp_553649396 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649396, 0, HEX3Aanonymous_553649406, kxi__); - add_754975552(tmp_553649396, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); - add_754975552(tmp_553649392, tmp_553649396); - result_553649391 = tmp_553649392; + var tmp_553652262 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553652262, 0, HEX3Aanonymous_553652264, kxi__); + add_754975552(tmp_553652262, text_754975684([82,101,109,97,116,99,104])); + add_754975552(tmp_553652259, tmp_553652262); + var tmp_553652263 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553652263, 0, HEX3Aanonymous_553652273, kxi__); + add_754975552(tmp_553652263, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); + add_754975552(tmp_553652259, tmp_553652263); + result_553652258 = tmp_553652259; - return result_553649391; + return result_553652258; } -function createRematch_553649417() { +function createRematch_553652284() { -function HEX3Aanonymous_553649421(__553649422, __553649423) { - currentScreen_553648240[0] = 0; - peer_553648194[0].Field0("end:exit"); +function HEX3Aanonymous_553652288(__553652289, __553652290) { + currentScreen_553648276[0] = 0; + peer_553648228[0].Field0("end:exit"); } - var result_553649418 = null; + var result_553652285 = null; - var tmp_553649419 = tree_754975616(44, []); - tmp_553649419.class = "main"; - add_754975552(tmp_553649419, text_754975684([87,97,105,116,105,110,103,32,102,111,114,32,111,112,112,111,110,101,110,116,32,116,111,32,97,99,99,101,112,116,46,46,46])); - var tmp_553649420 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649420, 0, HEX3Aanonymous_553649421, kxi__); - add_754975552(tmp_553649420, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); - add_754975552(tmp_553649419, tmp_553649420); - result_553649418 = tmp_553649419; + var tmp_553652286 = tree_754975616(44, []); + tmp_553652286.class = "main"; + add_754975552(tmp_553652286, text_754975684([87,97,105,116,105,110,103,32,102,111,114,32,111,112,112,111,110,101,110,116,32,116,111,32,97,99,99,101,112,116,46,46,46])); + var tmp_553652287 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553652287, 0, HEX3Aanonymous_553652288, kxi__); + add_754975552(tmp_553652287, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); + add_754975552(tmp_553652286, tmp_553652287); + result_553652285 = tmp_553652286; - return result_553649418; + return result_553652285; } -function createDisconnect_553649426() { +function createDisconnect_553652293() { -function HEX3Aanonymous_553649430(__553649431, __553649432) { - currentScreen_553648240[0] = 0; +function HEX3Aanonymous_553652297(__553652298, __553652299) { + currentScreen_553648276[0] = 0; } - var result_553649427 = null; + var result_553652294 = null; - var tmp_553649428 = tree_754975616(44, []); - tmp_553649428.class = "start-column"; - add_754975552(tmp_553649428, text_754975684([89,111,117,114,32,111,112,112,111,110,101,110,116,32,100,105,115,99,111,110,110,101,99,116,101,100])); - var tmp_553649429 = tree_754975616(195, []); - addEventHandler_721422102(tmp_553649429, 0, HEX3Aanonymous_553649430, kxi__); - add_754975552(tmp_553649429, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); - add_754975552(tmp_553649428, tmp_553649429); - result_553649427 = tmp_553649428; + var tmp_553652295 = tree_754975616(44, []); + tmp_553652295.class = "start-column"; + add_754975552(tmp_553652295, text_754975684([89,111,117,114,32,111,112,112,111,110,101,110,116,32,100,105,115,99,111,110,110,101,99,116,101,100])); + var tmp_553652296 = tree_754975616(195, []); + addEventHandler_721422102(tmp_553652296, 0, HEX3Aanonymous_553652297, kxi__); + add_754975552(tmp_553652296, text_754975684([66,97,99,107,32,116,111,32,76,111,98,98,121])); + add_754975552(tmp_553652295, tmp_553652296); + result_553652294 = tmp_553652295; - return result_553649427; + return result_553652294; } -function createOther_553649433() { +function createOther_553652300() { -function HEX3Aanonymous_553649441(__553649442, __553649443) { - currentScreen_553648240[0] = 9; +function HEX3Aanonymous_553652308(__553652309, __553652310) { + currentScreen_553648276[0] = 9; } -function HEX3Aanonymous_553649444(ev_553649445, __553649446) { +function HEX3Aanonymous_553652311(ev_553652312, __553652313) { alert("Unimplemented"); } -function HEX3Aanonymous_553649447(ev_553649448, __553649449) { +function HEX3Aanonymous_553652314(ev_553652315, __553652316) { alert("Unimplemented"); } -function HEX3Aanonymous_553649450(__553649451, __553649452) { - currentScreen_553648240[0] = 0; +function HEX3Aanonymous_553652317(__553652318, __553652319) { + currentScreen_553648276[0] = 0; } - var result_553649434 = null; - - var tmp_553649435 = tree_754975616(44, []); - tmp_553649435.class = "start-column"; - var tmp_553649436 = tree_754975616(44, []); - tmp_553649436.class = "main"; - var tmp_553649437 = tree_754975616(195, []); - tmp_553649437.class = "menu-button"; - add_754975552(tmp_553649437, text_754975684([83,101,116,116,105,110,103,115])); - addEventHandler_721422102(tmp_553649437, 0, HEX3Aanonymous_553649441, kxi__); - add_754975552(tmp_553649436, tmp_553649437); - var tmp_553649438 = tree_754975616(195, []); - tmp_553649438.class = "menu-button"; - add_754975552(tmp_553649438, text_754975684([67,104,97,110,103,101,32,76,111,103])); - addEventHandler_721422102(tmp_553649438, 0, HEX3Aanonymous_553649444, kxi__); - add_754975552(tmp_553649436, tmp_553649438); - add_754975552(tmp_553649435, tmp_553649436); - var tmp_553649439 = tree_754975616(195, []); - tmp_553649439.class = "width-100"; - add_754975552(tmp_553649439, text_754975684([67,114,101,100,105,116,115])); - addEventHandler_721422102(tmp_553649439, 0, HEX3Aanonymous_553649447, kxi__); - add_754975552(tmp_553649435, tmp_553649439); - var tmp_553649440 = tree_754975616(195, []); - tmp_553649440.class = "width-100"; - add_754975552(tmp_553649440, text_754975684([82,101,116,117,114,110,32,84,111,32,76,111,98,98,121])); - addEventHandler_721422102(tmp_553649440, 0, HEX3Aanonymous_553649450, kxi__); - add_754975552(tmp_553649435, tmp_553649440); - result_553649434 = tmp_553649435; - - return result_553649434; - -} - -function createSettings_553649453() { + var result_553652301 = null; + + var tmp_553652302 = tree_754975616(44, []); + tmp_553652302.class = "start-column"; + var tmp_553652303 = tree_754975616(44, []); + tmp_553652303.class = "main"; + var tmp_553652304 = tree_754975616(195, []); + tmp_553652304.class = " menu-button "; + add_754975552(tmp_553652304, text_754975684([83,101,116,116,105,110,103,115])); + addEventHandler_721422102(tmp_553652304, 0, HEX3Aanonymous_553652308, kxi__); + add_754975552(tmp_553652303, tmp_553652304); + var tmp_553652305 = tree_754975616(195, []); + tmp_553652305.class = " menu-button "; + add_754975552(tmp_553652305, text_754975684([67,104,97,110,103,101,32,76,111,103])); + addEventHandler_721422102(tmp_553652305, 0, HEX3Aanonymous_553652311, kxi__); + add_754975552(tmp_553652303, tmp_553652305); + add_754975552(tmp_553652302, tmp_553652303); + var tmp_553652306 = tree_754975616(195, []); + tmp_553652306.class = "width-100"; + add_754975552(tmp_553652306, text_754975684([67,114,101,100,105,116,115])); + addEventHandler_721422102(tmp_553652306, 0, HEX3Aanonymous_553652314, kxi__); + add_754975552(tmp_553652302, tmp_553652306); + var tmp_553652307 = tree_754975616(195, []); + tmp_553652307.class = "width-100"; + add_754975552(tmp_553652307, text_754975684([82,101,116,117,114,110,32,84,111,32,76,111,98,98,121])); + addEventHandler_721422102(tmp_553652307, 0, HEX3Aanonymous_553652317, kxi__); + add_754975552(tmp_553652302, tmp_553652307); + result_553652301 = tmp_553652302; + + return result_553652301; + +} + +function createSetting_553652320(setting_553652321, setting_553652321_Idx, title_553652322, description_553652323, defaultOption_553652324) { var Temporary1; - -function HEX3Aanonymous_553649467(__553649468, __553649469) { - showTechnicalNames_553648238[0] = !(showTechnicalNames_553648238[0]); - - - } var Temporary2; + var Temporary3; -function HEX3Aanonymous_553649470(__553649471, __553649472) { - disableRNGPowers_553648239[0] = !(disableRNGPowers_553648239[0]); - - - } - -function HEX3Aanonymous_553649473(__553649474, __553649475) { - currentScreen_553648240[0] = 10; +function HEX3Aanonymous_553652332(__553652333, __553652334) { + setting_553652321[setting_553652321_Idx] = !(setting_553652321[setting_553652321_Idx]); } - var result_553649454 = null; - - var tmp_553649455 = tree_754975616(44, []); - tmp_553649455.class = "start-column"; - var tmp_553649456 = tree_754975616(44, []); - tmp_553649456.class = "setting-item"; - var tmp_553649457 = tree_754975616(25, []); - add_754975552(tmp_553649457, text_754975684([84,101,99,104,110,105,99,97,108,32,78,97,109,101,115])); - add_754975552(tmp_553649456, tmp_553649457); - var tmp_553649458 = tree_754975616(32, []); - add_754975552(tmp_553649458, text_754975684(makeNimstrLit("Shows the technical names for synergy powers and powers with multiple variations."))); - add_754975552(tmp_553649456, tmp_553649458); - var tmp_553649459 = tree_754975616(195, []); - if (showTechnicalNames_553648238[0]) { - Temporary1 = [68,105,115,97,98,108,101]; - } - else { - Temporary1 = [69,110,97,98,108,101]; - } - - add_754975552(tmp_553649459, text_754975684(Temporary1)); - addEventHandler_721422102(tmp_553649459, 0, HEX3Aanonymous_553649467, kxi__); - add_754975552(tmp_553649456, tmp_553649459); - add_754975552(tmp_553649455, tmp_553649456); - var tmp_553649460 = tree_754975616(33, []); - add_754975552(tmp_553649455, tmp_553649460); - var tmp_553649461 = tree_754975616(44, []); - tmp_553649461.class = "setting-item"; - var tmp_553649462 = tree_754975616(25, []); - add_754975552(tmp_553649462, text_754975684([68,105,115,97,98,108,101,32,82,78,71,32,80,111,119,101,114,115])); - add_754975552(tmp_553649461, tmp_553649462); - var tmp_553649463 = tree_754975616(32, []); - add_754975552(tmp_553649463, text_754975684(makeNimstrLit("Removes RNG based powers, like civilians, from the draft pool. Only works when you are the host."))); - add_754975552(tmp_553649461, tmp_553649463); - var tmp_553649464 = tree_754975616(195, []); - if (!(disableRNGPowers_553648239[0])) { + var result_553652325 = null; + + var tmp_553652326 = tree_754975616(44, []); + tmp_553652326.class = "start-column"; + var tmp_553652327 = tree_754975616(44, []); + tmp_553652327.class = " setting-item "; + var tmp_553652328 = tree_754975616(24, []); + add_754975552(tmp_553652328, text_754975684(title_553652322)); + add_754975552(tmp_553652327, tmp_553652328); + var tmp_553652329 = tree_754975616(32, []); + add_754975552(tmp_553652329, text_754975684(description_553652323)); + add_754975552(tmp_553652327, tmp_553652329); + var tmp_553652330 = tree_754975616(195, []); + if (defaultOption_553652324) { + if (!(setting_553652321[setting_553652321_Idx])) { Temporary2 = [68,105,115,97,98,108,101]; } else { Temporary2 = [69,110,97,98,108,101]; } - add_754975552(tmp_553649464, text_754975684(Temporary2)); - addEventHandler_721422102(tmp_553649464, 0, HEX3Aanonymous_553649470, kxi__); - add_754975552(tmp_553649461, tmp_553649464); - add_754975552(tmp_553649455, tmp_553649461); - var tmp_553649465 = tree_754975616(33, []); - add_754975552(tmp_553649455, tmp_553649465); - var tmp_553649466 = tree_754975616(195, []); - tmp_553649466.class = "width-100"; - add_754975552(tmp_553649466, text_754975684([82,101,116,117,114,110,32,116,111,32,79,116,104,101,114])); - addEventHandler_721422102(tmp_553649466, 0, HEX3Aanonymous_553649473, kxi__); - add_754975552(tmp_553649455, tmp_553649466); - result_553649454 = tmp_553649455; + Temporary1 = Temporary2; + } + else { + if (setting_553652321[setting_553652321_Idx]) { + Temporary3 = [68,105,115,97,98,108,101]; + } + else { + Temporary3 = [69,110,97,98,108,101]; + } + + Temporary1 = Temporary3; + } + + add_754975552(tmp_553652330, text_754975684(Temporary1)); + addEventHandler_721422102(tmp_553652330, 0, HEX3Aanonymous_553652332, kxi__); + add_754975552(tmp_553652327, tmp_553652330); + add_754975552(tmp_553652326, tmp_553652327); + var tmp_553652331 = tree_754975616(33, []); + add_754975552(tmp_553652326, tmp_553652331); + result_553652325 = tmp_553652326; + + return result_553652325; + +} + +function createSettings_553652335() { + +function HEX3Aanonymous_553652339(__553652340, __553652341) { + currentScreen_553648276[0] = 10; + + + } + + var result_553652336 = null; + + var tmp_553652337 = tree_754975616(44, []); + tmp_553652337.class = "start-column gap-10"; + add_754975552(tmp_553652337, createSetting_553652320(showTechnicalNames_553648272, 0, [84,101,99,104,110,105,99,97,108,32,78,97,109,101,115], makeNimstrLit("Shows the technical names for synergy powers and powers with multiple variations."), false)); + add_754975552(tmp_553652337, createSetting_553652320(disableRNGPowers_553648273, 0, [68,105,115,97,98,108,101,32,82,78,71,32,80,111,119,101,114,115], makeNimstrLit("Removes RNG based powers, like civilians, from the draft pool. Only works when you are the host."), true)); + add_754975552(tmp_553652337, createSetting_553652320(enableExperimental_553648275, 0, [73,110,99,108,117,100,101,32,69,120,112,101,114,105,109,101,110,116,97,108,32,80,111,119,101,114,115], makeNimstrLit("Adds the cutting edge of SuperChess. It is likely to break or be unbalanced."), false)); + var tmp_553652338 = tree_754975616(195, []); + tmp_553652338.class = "width-100"; + add_754975552(tmp_553652338, text_754975684([82,101,116,117,114,110,32,116,111,32,79,116,104,101,114])); + addEventHandler_721422102(tmp_553652338, 0, HEX3Aanonymous_553652339, kxi__); + add_754975552(tmp_553652337, tmp_553652338); + result_553652336 = tmp_553652337; - return result_553649454; + return result_553652336; } -function main_553649476() { - var result_553649477 = null; +function main_553652342() { + var result_553652343 = null; - var tmp_553649478 = tree_754975616(44, []); - tmp_553649478.class = "main scroll"; - switch (currentScreen_553648240[0]) { + var tmp_553652344 = tree_754975616(44, []); + tmp_553652344.class = "main scroll"; + switch (currentScreen_553648276[0]) { case 0: - add_754975552(tmp_553649478, createLobby_553648959()); + add_754975552(tmp_553652344, createLobby_553650364()); break; case 1: - add_754975552(tmp_553649478, createRoomMenu_553649048()); + add_754975552(tmp_553652344, createRoomMenu_553650453()); break; case 2: - add_754975552(tmp_553649478, createJoinMenu_553649053()); + add_754975552(tmp_553652344, createJoinMenu_553650483()); break; case 4: - add_754975552(tmp_553649478, createOptionsMenu_553649084()); + add_754975552(tmp_553652344, createOptionsMenu_553650489()); break; case 5: - add_754975552(tmp_553649478, createDraftMenu_553649247()); + add_754975552(tmp_553652344, createDraftMenu_553650652()); break; case 3: - add_754975552(tmp_553649478, createGame_553649359()); + add_754975552(tmp_553652344, createGame_553651526()); break; case 6: - add_754975552(tmp_553649478, createResults_553649390()); + add_754975552(tmp_553652344, createResults_553652257()); break; case 7: - add_754975552(tmp_553649478, createRematch_553649417()); + add_754975552(tmp_553652344, createRematch_553652284()); break; case 8: - add_754975552(tmp_553649478, createDisconnect_553649426()); + add_754975552(tmp_553652344, createDisconnect_553652293()); break; case 10: - add_754975552(tmp_553649478, createOther_553649433()); + add_754975552(tmp_553652344, createOther_553652300()); break; case 9: - add_754975552(tmp_553649478, createSettings_553649453()); + add_754975552(tmp_553652344, createSettings_553652335()); break; } - result_553649477 = tmp_553649478; - - return result_553649477; - -} -var screenWidth_553648185 = [window.innerWidth]; -var roomId_553648188 = [nimCopy(null, {Field0: false, Field1: "Waiting..."}, NTI553648153)]; -var peer_553648194 = [{Field0: null, Field1: null}]; -var side_553648195 = [0]; -var turn_553648196 = [false]; -var myDrafts_553648201 = [[]]; -var opponentDrafts_553648206 = [[]]; -var baseDrafts_553648207 = [0]; -var draftOptions_553648208 = [[]]; -var draftChoices_553648209 = [3]; -var draftsLeft_553648210 = [0]; -var draftTier_553648211 = [0]; -var rematch_553648212 = [false]; -var theBoard_553648213 = [startingBoard_1493172483()]; -var selectedTile_553648216 = [nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011)]; -var possibleMoves_553648221 = [[]]; -var possibleTakes_553648226 = [[]]; -var lastMove_553648231 = [[]]; -var piecesChecking_553648236 = [[]]; -var turnNumber_553648237 = [1]; -var showTechnicalNames_553648238 = [false]; -var disableRNGPowers_553648239 = [false]; -var currentScreen_553648240 = [0]; -var gameMode_553648241 = [0]; -window.addEventListener('resize', resize_553648247); -initStorage_1845493769(); -if (false) { -gameMode_553648241[0] = 2; -draft_553648589([], []); -} - -Label2: { - var i_553648661 = [0]; - var j_553648662 = [0]; - Label3: { - var i_553649512 = 0; - var i_553649513 = 0; - Label4: { - Label5: while (true) { - if (!(i_553649513 < 8)) break Label5; - i_553649512 = i_553649513; - Label6: { - var j_553649516 = 0; - var i_553649517 = 0; - Label7: { - Label8: while (true) { - if (!(i_553649517 < 8)) break Label8; - j_553649516 = i_553649517; - i_553648661[0] = i_553649512; - j_553648662[0] = j_553649516; - theBoard_553648213[0][chckIndx(i_553648661[0], 0, (theBoard_553648213[0]).length - 1)][chckIndx(j_553648662[0], 0, (theBoard_553648213[0][chckIndx(i_553648661[0], 0, (theBoard_553648213[0]).length - 1)]).length - 1)].rand.Field1 = 0; - i_553649517 = addInt(i_553649517, 1); - } - }; - }; - i_553649513 = addInt(i_553649513, 1); - } - }; - }; -}; -executeOn_1728054240(myDrafts_553648201[0], 1, side_553648195[0], theBoard_553648213[0]); -executeOn_1728054240(opponentDrafts_553648206[0], 0, side_553648195[0], theBoard_553648213[0]); -setRenderer_721422053(main_553649476, "ROOT", null); + result_553652343 = tmp_553652344; + + return result_553652343; + +} +var roomId_553648222 = [nimCopy(null, {Field0: false, Field1: "Waiting..."}, NTI553648163)]; +var peer_553648228 = [{Field0: null, Field1: null}]; +var side_553648229 = [1]; +var turn_553648230 = [true]; +var myDrafts_553648235 = [[]]; +var opponentDrafts_553648240 = [[]]; +var baseDrafts_553648241 = [0]; +var draftOptions_553648242 = [[]]; +var draftChoices_553648243 = [3]; +var draftsLeft_553648244 = [0]; +var draftTier_553648245 = [0]; +var rematch_553648246 = [false]; +var theBoard_553648247 = [[[({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})], [({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []}), ({item: 0, color: 0, index: 0, timesMoved: 0, piecesTaken: 0, tile: {Field0: 0, Field1: 0}, moves: [], takes: [], onMove: null, onTake: null, whenTaken: null, onEndTurn: [], onPromote: [], promoted: false, filePath: [], colorable: false, rotate: false, drunk: false, casts: []})]]]; +var theState_553648248 = [{Field0: ({nextIndex: 0, nextGroup: 0, randSeed: 0, turnNumber: 0}), Field1: [({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]}), ({abilityTakes: 0, wallet: ({val: 0, has: false}), buys: [], piecesSold: 0, glass: [({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false}), ({val: {Field0: 0, Field1: null, Field2: null}, has: false})]})]}]; +var selectedTile_553648251 = [nimCopy(null, {Field0: (-1), Field1: (-1)}, NTI1476395011)]; +var possibleMoves_553648256 = [[]]; +var possibleTakes_553648261 = [[]]; +var lastMove_553648266 = [[]]; +var piecesChecking_553648271 = [[]]; +var showTechnicalNames_553648272 = [false]; +var disableRNGPowers_553648273 = [false]; +var showDebug_553648274 = [false]; +var enableExperimental_553648275 = [false]; +var currentScreen_553648276 = [3]; +var currentTab_553648277 = [0]; +var gameMode_553648278 = [0]; +var screenWidth_553648279 = [window.innerWidth]; +var selectedGlass_553648293 = [none_553648285()]; +var actionStack_553648298 = [[]]; +var nextActionStack_553648303 = [[]]; +var toSend_553648308 = [[]]; +var promptHistory_553648313 = [[]]; +var promptStack_553648318 = [[]]; +var picksLeft_553648319 = [0]; +var getPickOptions_553648321 = [null]; +var pickOptions_553648322 = [[]]; +var picks_553648327 = [[]]; +var whenCollected_553648329 = [null]; +initStorage_1879048201(); +window.addEventListener('resize', resize_553648335); +if (true) { +switch (currentScreen_553648276[0]) { +case 3: + initGame_553648349(); + theState_553648248[0].Field0.randSeed = 0; + myDrafts_553648235[0] = nimCopy(null, myDebugPowers_553648214, NTI553648145); + opponentDrafts_553648240[0] = nimCopy(null, opponentDebugPowers_553648219, NTI553648154); + execute_1728054225(myDrafts_553648235[0], opponentDrafts_553648240[0], side_553648229[0], theBoard_553648247[0], theState_553648248[0]); + break; +case 5: + gameMode_553648278[0] = 2; + draft_553649976([], []); + break; +default: + break; +} +} + +setRenderer_721422053(main_553652342, "ROOT", null); diff --git a/change_logs/12.3.2024.txt b/change_logs/12.3.2024.txt new file mode 100644 index 0000000..bffb71a --- /dev/null +++ b/change_logs/12.3.2024.txt @@ -0,0 +1,11 @@ +12/3/2024 Changelog + +I added new glass powers, which take one turn to cast. Currently, there are only 3: +Sky - teleport 2 pieces +Zero - kill 2 tiles +Steel - have 3 pieces take any piece in front of them + +I originally planned to only make 3, but since it ended up taking so long, I need +to add more to get my money's worth. I created an action system, which is currently +only used by the glass system. I think I want these actions to become the future +of the game, since they are fun. Glass and capitalism are the start of these powers. \ No newline at end of file diff --git a/chess.nimble b/chess.nimble index f0eaae0..b0a4871 100644 --- a/chess.nimble +++ b/chess.nimble @@ -29,3 +29,6 @@ task jscr, "compiles for release": task host, "hosts app.html, build from main.nim with task html": exec "npx parcel app/app.html" + +task sass, "adds watcher to scss": + exec "sass --watch styles.scss main.css" diff --git a/icons/skyglass.svg b/icons/skyglass.svg new file mode 100644 index 0000000..6d8ef8b --- /dev/null +++ b/icons/skyglass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/steelglass.svg b/icons/steelglass.svg new file mode 100644 index 0000000..124361f --- /dev/null +++ b/icons/steelglass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/zeroglass.svg b/icons/zeroglass.svg new file mode 100644 index 0000000..fc7969b --- /dev/null +++ b/icons/zeroglass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 90cdf06..9a8be84 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ SuperChess - + diff --git a/main.css b/main.css new file mode 100644 index 0000000..ef13df0 --- /dev/null +++ b/main.css @@ -0,0 +1,1179 @@ +/* +I split the css into two files so that I can have two strokes +as punishment for my sins. + +*/ +@media only screen { + td { + min-width: 100px; + min-height: 100px; + width: 100px; + height: 100px; + text-align: center; + vertical-align: middle; + border-width: 6px; + transition: ease-in-out all 0.5s; + } + .power-grid { + font-size: 23px; + } +} +@media only screen and (max-width: 2000px) { + td { + min-width: 75px; + min-height: 75px; + width: 75px; + height: 75px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 23px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu { + width: 40px !important; + height: 40px !important; + border-width: 6px !important; + } + .bottom-info { + max-width: 630px; + } +} +@media only screen and (max-width: 1900px) { + td { + min-width: 69px; + min-height: 69px; + width: 69px; + height: 69px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 22.5px; + } + .column-scroll h4 { + font-size: 31.5px; + } + .glass-menu { + width: 35px !important; + height: 35px !important; + border-width: 5.8px !important; + } + .bottom-info { + max-width: 590px; + } +} +@media only screen and (max-width: 1800px) { + td { + min-width: 63px; + min-height: 63px; + width: 63px; + height: 63px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 22px; + } + .column-scroll h4 { + font-size: 31px; + } + .glass-menu { + width: 30px !important; + height: 30px !important; + border-width: 5.6px !important; + } + .bottom-info { + max-width: 550px; + } +} +@media only screen and (max-width: 1700px) { + td { + min-width: 57px; + min-height: 57px; + width: 57px; + height: 57px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 21.5px; + } + .column-scroll h4 { + font-size: 30.5px; + } + .glass-menu { + width: 25px !important; + height: 25px !important; + border-width: 5.4px !important; + } + .bottom-info { + max-width: 510px; + } +} +@media only screen and (max-width: 1600px) { + td { + min-width: 51px; + min-height: 51px; + width: 51px; + height: 51px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 21px; + } + .column-scroll h4 { + font-size: 30px; + } + .glass-menu { + width: 20px !important; + height: 20px !important; + border-width: 5.2px !important; + } + .bottom-info { + max-width: 470px; + } +} +@media only screen and (max-width: 1500px) { + td { + min-width: 45px; + min-height: 45px; + width: 45px; + height: 45px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 20.5px; + } + .column-scroll h4 { + font-size: 29.5px; + } + .glass-menu { + width: 15px !important; + height: 15px !important; + border-width: 5px !important; + } + .bottom-info { + max-width: 430px; + } +} +@media only screen and (max-width: 1400px) { + td { + min-width: 39px; + min-height: 39px; + width: 39px; + height: 39px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 20px; + } + .column-scroll h4 { + font-size: 29px; + } + .glass-menu { + width: 10px !important; + height: 10px !important; + border-width: 4.8px !important; + } + .bottom-info { + max-width: 390px; + } +} +@media only screen and (max-width: 1300px) { + td { + min-width: 33px; + min-height: 33px; + width: 33px; + height: 33px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 19.5px; + } + .column-scroll h4 { + font-size: 28.5px; + } + .glass-menu { + width: 5px !important; + height: 5px !important; + border-width: 4.6px !important; + } + .bottom-info { + max-width: 350px; + } +} +@media only screen and (max-width: 1200px) { + td { + min-width: 27px; + min-height: 27px; + width: 27px; + height: 27px; + text-align: center; + vertical-align: middle; + } + .column-scroll { + font-size: 19px; + } + .column-scroll h4 { + font-size: 28px; + } + .glass-menu { + width: 0px !important; + height: 0px !important; + border-width: 4.4px !important; + } + .bottom-info { + max-width: 310px; + } +} +@media only screen and (max-width: 1200px) { + td { + min-width: 86px; + min-height: 86px; + width: 86px; + height: 86px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 1150px) { + td { + min-width: 82px; + min-height: 82px; + width: 82px; + height: 82px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 1100px) { + td { + min-width: 78px; + min-height: 78px; + width: 78px; + height: 78px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 1050px) { + td { + min-width: 74px; + min-height: 74px; + width: 74px; + height: 74px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 1000px) { + td { + min-width: 70px; + min-height: 70px; + width: 70px; + height: 70px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 950px) { + td { + min-width: 66px; + min-height: 66px; + width: 66px; + height: 66px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 900px) { + td { + min-width: 62px; + min-height: 62px; + width: 62px; + height: 62px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 850px) { + td { + min-width: 58px; + min-height: 58px; + width: 58px; + height: 58px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 800px) { + td { + min-width: 54px; + min-height: 54px; + width: 54px; + height: 54px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 750px) { + td { + min-width: 50px; + min-height: 50px; + width: 50px; + height: 50px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 700px) { + td { + min-width: 46px; + min-height: 46px; + width: 46px; + height: 46px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 650px) { + td { + min-width: 42px; + min-height: 42px; + width: 42px; + height: 42px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 600px) { + td { + min-width: 38px; + min-height: 38px; + width: 38px; + height: 38px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 550px) { + td { + min-width: 34px; + min-height: 34px; + width: 34px; + height: 34px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +@media only screen and (max-width: 500px) { + td { + min-width: 30px; + min-height: 30px; + width: 30px; + height: 30px; + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + .column-scroll { + font-size: 27px; + } + .column-scroll h4 { + font-size: 32px; + } + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } +} +.glass-menu { + justify-content: center; + justify-items: center; + align-items: center; + text-wrap: wrap; + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-template-rows: repeat(4, 1fr); + column-gap: 10%; + row-gap: 20px; + padding-top: -20px; + padding-bottom: 20px; + padding-left: 10px; + padding-right: 10px; + min-width: 90%; + width: 90%; + max-width: 90%; + min-height: fit-content; + transition: ease-in-out all 0.5s; + background-color: #F8F7F7; + grid-template-areas: ". title ." "sky zero steel" "skydesc zerodesc steeldesc" "cancel use use"; +} +.glass-menu:hover { + background-color: #DCDCDC; +} +.glass-menu .title { + grid-area: title; + margin-top: 15px; + margin-bottom: 10px; + font-size: 23px; +} +.glass-menu span { + width: 40px; + height: 40px; + border-radius: 50%; + border-color: gray; + border-width: 5px; + border-style: solid; + display: inline-block; + align-self: center; + transition: 0.9s; +} +.glass-menu button { + font-size: 25px; +} +.glass-menu span.sky { + grid-area: sky; + background-color: #183dd1; +} +.glass-menu span.zero { + grid-area: zero; + background-color: #424242; +} +.glass-menu span.steel { + grid-area: steel; + background-color: #ea332d; +} +.glass-menu p.sky { + grid-area: skydesc; +} +.glass-menu p.zero { + grid-area: zerodesc; +} +.glass-menu p.steel { + grid-area: steeldesc; +} +.glass-menu span.empty { + background-color: #fdfcfc !important; +} +.glass-menu button.cancel { + margin-left: 10px; + min-width: 100%; + grid-area: cancel; +} +.glass-menu button.use { + margin-right: 10px; + min-width: 100%; + grid-area: use; +} + +.piece-row { + justify-content: center; + justify-items: center; + align-items: center; + text-wrap: wrap; + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-template-rows: repeat(3, 1fr); + column-gap: 10%; + row-gap: 20px; + padding-top: -20px; + padding-bottom: 20px; + padding-left: 10px; + padding-right: 10px; + min-width: 90%; + width: 90%; + max-width: 90%; + min-height: fit-content; + transition: ease-in-out all 0.5s; + background-color: #F8F7F7; + grid-template-areas: "name . row" "img . row" "take . row"; +} +.piece-row:hover { + background-color: #DCDCDC; +} +.piece-row h4 { + grid-area: name; + margin-top: 10px; + margin-bottom: 5px; + font-size: 20px; +} +.piece-row img { + grid-area: img; +} +.piece-row .row { + grid-area: row; + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 50px; +} +.piece-row .row button { + height: min-content; + font-size: 20px; + min-width: fit-content; +} +.piece-row .take { + grid-area: take; +} + +.power-grid { + justify-content: center; + justify-items: center; + align-items: center; + text-wrap: wrap; + display: grid; + grid-template-columns: repeat(5, 1fr); + grid-template-rows: repeat(4, 1fr); + column-gap: 10%; + row-gap: 20px; + padding-top: -20px; + padding-bottom: 20px; + padding-left: 10px; + padding-right: 10px; + min-width: 90%; + width: 90%; + max-width: 90%; + min-height: fit-content; + transition: ease-in-out all 0.5s; + background-color: #F8F7F7; + grid-template-areas: "title title title . ." "desc desc desc img img" "desc desc desc img img" "desc desc desc . ."; +} +.power-grid:hover { + background-color: #DCDCDC; +} +.power-grid img { + position: relative; + max-height: 100px; + min-height: 100px; +} +.power-grid h4 { + margin-top: 0px; + margin-bottom: 0px; +} + +/* +WARNING: Due to the graphic nature of the following, we require you to sign +a Non Dicslosure Agreenebt (NDA) before acessing the content. Such a contract waives your +write to report on the following, to any other person, or entity, for perpetuity. Violating this agreement +will result in fines up to 5000 dollares and up to 3 years of jail time. +*/ +html, +body { + height: 100%; + width: 100%; + min-height: 100%; + min-width: 100%; +} + +h3 { + font-size: 25px; +} + +img { + width: 100%; + height: 100%; + max-height: inherit; + object-fit: contain; +} + +::-webkit-scrollbar { + -webkit-appearance: none; + height: 0px; + width: 7px; +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: rgba(0, 0, 0, 0.1); +} + +.height-100 { + min-height: 100%; + height: 100%; +} + +.width-100 { + min-width: 100%; + width: 100%; +} + +.main { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + gap: 90px; + height: 100%; +} + +.cut-down { + max-height: 80%; +} + +.column { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + align-self: center; + gap: 20px; + text-align: center; +} + +hr { + min-width: 100%; + max-width: 100%; + width: 100%; + /**one of these do something*/ + border-style: solid; + border-width: 0px 0px 4px 0px; + border-color: black; +} + +.start-column { + display: flex; + min-height: 50%; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 50px; + text-align: center; + padding: 35px; +} + +.power-menu { + flex-wrap: wrap; +} + +.power { + padding: 20px; + min-height: 90%; + width: 180px; + min-width: 180px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + background-color: #F8F7F7; + transition: 0.9s; +} + +.power:hover { + background-color: #DCDCDC; +} + +.column-scroll { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + text-align: center; + border-width: 3px; + border-color: black; + border-style: solid; + overflow-y: scroll; + overflow-x: scroll; + max-height: 100%; + height: 100%; + max-width: 95%; + min-width: 95%; + width: 95%; + padding-top: 20px; + padding-bottom: 20px; +} + +/*If you close your eyes its not too bad*/ +.column-scroll > .piece-row > .row > button { + font-size: 16px; + max-width: min-content; +} + +.setting-item { + display: grid; + grid-template-areas: "title title title" "desc desc desc" "desc desc desc" "button button button"; + padding: 5px; + justify-content: center; + height: auto; + min-width: 100%; + max-width: 100%; + text-wrap: wrap; + transition: 0.9s; +} + +.setting-item > h4 { + font-size: 22px; + grid-area: title; + margin-bottom: 0px; +} + +.setting-item > p { + grid-area: desc; +} + +.setting-item > button { + grid-area: button; +} + +.title { + grid-area: title; +} + +.desc { + grid-area: desc; +} + +.image { + grid-area: img; + max-width: 100%; + max-height: 100%; +} + +.power > h1 { + text-align: center; + flex-basis: 90px; +} + +.tab-row { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: 0px; + min-width: 100%; + margin-top: -10px; + height: auto; + transform: translateX(2.5%); + /*Moves every other element to the right + to make an overlap effect*/ +} +.tab-row button { + border-top-left-radius: 10px; + border-top-right-radius: 10px; +} +.tab-row button:not(first-child) { + margin-right: -6px; +} + +.tab-column { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + align-self: center; + max-height: 78%; + min-height: 78%; + height: 78%; + width: min-content; + min-width: 70%; + max-width: 70%; +} + +.long { + max-height: 40% !important; + min-height: 40% !important; + height: 40% !important; + width: 90% !important; + min-width: 90% !important; + max-width: 90% !important; + transform: translateY(10px); +} + +.debug { + min-width: 10px; + min-height: 10px; + background-color: lightyellow; +} + +.unselected { + border-color: rgba(0, 0, 0, 0); + border-style: solid; +} + +.selected { + border-color: blue !important; + border-style: solid; +} + +.can-move { + border-color: green !important; + border-style: solid; +} + +.can-take { + border-color: yellow !important; + border-style: solid; +} + +.last-move { + border-color: purple; + border-style: solid; +} + +.checking { + border-color: red; + border-style: solid; +} + +.picking { + border-color: orange; + border-style: solid; +} + +.casting-on-sky { + outline-width: 1px; + outline-color: #183dd1; + outline-style: solid; + animation: animateOutlineu7lkoj6 2s ease infinite; +} +@keyframes animateOutlineu7lkoj6 { + 0% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #183dd1; + } + 50% { + outline-width: 8px; + outline-offset: 0px; + outline-color: rgba(0, 0, 0, 0); + } + 100% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #183dd1; + } +} + +.casting-on-steel { + outline-width: 1px; + outline-color: #ea332d; + outline-style: solid; + animation: animateOutlineu7lkojk 2s ease infinite; +} +@keyframes animateOutlineu7lkojk { + 0% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #ea332d; + } + 50% { + outline-width: 8px; + outline-offset: 0px; + outline-color: rgba(0, 0, 0, 0); + } + 100% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #ea332d; + } +} + +.casting-on-zero { + outline-width: 1px; + outline-color: #424242; + outline-style: solid; + animation: animateOutlineu7lkojl 2s ease infinite; +} +@keyframes animateOutlineu7lkojl { + 0% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #424242; + } + 50% { + outline-width: 8px; + outline-offset: 0px; + outline-color: rgba(0, 0, 0, 0); + } + 100% { + outline-width: 2px; + outline-offset: 0px; + outline-color: #424242; + } +} + +.casting-sky::before { + content: ""; + position: absolute; + min-width: inherit; + min-height: inherit; + padding-bottom: 5px; + border-radius: 50%; + outline-width: 2px; + outline-style: solid; + animation: castingAnimation-u7lkojz 4s ease-in-out infinite; +} +@keyframes castingAnimation-u7lkojz { + 0% { + outline-width: 3px; + outline-offset: 50px; + outline-color: #183dd1; + } + 100% { + outline-width: 20px; + outline-offset: -25px; + outline-color: rgba(0, 0, 0, 0); + } +} + +.casting-steel::before { + content: ""; + position: absolute; + min-width: inherit; + min-height: inherit; + padding-bottom: 5px; + border-radius: 50%; + outline-width: 2px; + outline-style: solid; + animation: castingAnimation-u7lkokw 4s ease-in-out infinite; +} +@keyframes castingAnimation-u7lkokw { + 0% { + outline-width: 3px; + outline-offset: 50px; + outline-color: #ea332d; + } + 100% { + outline-width: 20px; + outline-offset: -25px; + outline-color: rgba(0, 0, 0, 0); + } +} + +.casting-zero::before { + content: ""; + position: absolute; + min-width: inherit; + min-height: inherit; + padding-bottom: 5px; + border-radius: 50%; + outline-width: 2px; + outline-style: solid; + animation: castingAnimation-u7lkold 4s ease-in-out infinite; +} +@keyframes castingAnimation-u7lkold { + 0% { + outline-width: 3px; + outline-offset: 50px; + outline-color: #424242; + } + 100% { + outline-width: 20px; + outline-offset: -25px; + outline-color: rgba(0, 0, 0, 0); + } +} + +.blackTile { + background-color: darkgrey; +} + +.whiteTile { + background-color: whitesmoke; +} + +.rotate { + transform: rotate(180deg); +} + +.menu-button { + min-width: 120px; +} + +.scroll { + overflow: scroll; +} + +.bottom-info { + margin-bottom: -10px; + margin-top: -10px; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + gap: 90px; + height: 100%; +} + +.gap-10 { + gap: 10px; +} + +/*# sourceMappingURL=main.css.map */ diff --git a/main.css.map b/main.css.map new file mode 100644 index 0000000..083079a --- /dev/null +++ b/main.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["rows.scss","styles.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;;AAAA;AA6CA;EACI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;;AAKJ;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAzBR;EACI;IACI;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAIR;IACI;IACA;IACA;;EAGJ;IACI;;;AAMR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAxBR;EAEI;IACI;IACA;IACA;IACA;IACA;IACA;IACA;;EAGJ;IACI;;EAEA;IACI;;EAKR;IACI;IACA;IACA;;;AAKZ;EA7GI;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EAEA,kBA/BmB;EAuHnB,qBACI;;AAvFJ;EACI,kBAjCW;;AA4Hf;EACI;EACA;EACA;EACA;;AAGJ;EACI;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EAEA;;AAGJ;EACI;;AAGJ;EACI;EACA,kBAvJF;;AA0JF;EACI;EACA,kBA3JD;;AA8JH;EACI;EACA,kBA/JA;;AAkKJ;EACI;;AAGJ;EACI;;AAIJ;EACI;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;;AAGJ;EACI;EACA;EACA;;;AAMR;EA/LI;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EAEA,kBA/BmB;EAyMnB,qBACI;;AAzKJ;EACI,kBAjCW;;AA6Mf;EACI;EACA;EACA;EACA;;AAGJ;EACI;;AAGJ;EACI;EACA;EACA;EACA;EACA;;AAEA;EACI;EACA;EACA;;AAIR;EACI;;;AAKR;EAtOI;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EAEA,kBA/BmB;EAgPnB,qBACI;;AAhNJ;EACI,kBAjCW;;AAqPf;EACI;EACA;EACA;;AAGJ;EACI;EACA;;;AChQR;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;EAEI;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;AACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA,kBDxGmB;ECyGnB;;;AAGJ;EACI,kBD5Ge;;;AC+GnB;EACI;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;;AAGJ;AACA;EACI;EACA;;;AAGJ;EACI;EACA,qBACI;EAKJ;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAIJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;AAOA;AAAA;;AALA;EACI;EACA;;AAKJ;EACI;;;AAIR;EACI;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAKJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AA+DJ;EA3BI;EACA,eD/TE;ECgUF;EACA;;AAEA;EACI;IACI;IACA;IACA,eDvUN;;EC0UE;IACI;IACA;IACA;;EAGJ;IACI;IACA;IACA,eDnVN;;;;AC6VN;EA/BI;EACA,eD7TI;EC8TJ;EACA;;AAEA;EACI;IACI;IACA;IACA,eDrUJ;;ECwUA;IACI;IACA;IACA;;EAGJ;IACI;IACA;IACA,eDjVJ;;;;AC+VR;EAnCI;EACA,eD9TG;EC+TH;EACA;;AAEA;EACI;IACI;IACA;IACA,eDtUL;;ECyUC;IACI;IACA;IACA;;EAGJ;IACI;IACA;IACA,eDlVL;;;;ACoWP;EArEI;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACI;IACI;IACA;IACA,eDhTN;;ECmTE;IACI;IACA;IACA;;;;AAmDZ;EAzEI;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACI;IACI;IACA;IACA,eD9SJ;;ECiTA;IACI;IACA;IACA;;;;AAuDZ;EA7EI;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AAEA;EACI;IACI;IACA;IACA,eD/SL;;ECkTC;IACI;IACA;IACA;;;;AA2DZ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;;AAGJ;EACI","file":"main.css"} \ No newline at end of file diff --git a/rows.scss b/rows.scss new file mode 100644 index 0000000..b4b5daf --- /dev/null +++ b/rows.scss @@ -0,0 +1,264 @@ +/* +I split the css into two files so that I can have two strokes +as punishment for my sins. + +*/ + +$border-width: 4px; +$background-highlight: #F8F7F7; +$background-hover: #DCDCDC; +$sky: #183dd1; +$zero: #424242; +$steel: #ea332d; + +@mixin row($col, $row){ + justify-content: center; + justify-items: center; + align-items: center; + text-wrap: wrap; + + display: grid; + grid-template-columns: repeat($col, 1fr); + grid-template-rows: repeat($row, 1fr); + + column-gap: 10%; + row-gap: 20px; + padding-top: -20px; + padding-bottom: 20px; + padding-left: 10px; + padding-right: 10px; + + min-width: 90%; + width: 90%; + max-width: 90%; + + min-height: fit-content; + + transition: ease-in-out all .5s; + + background-color: $background-highlight; + + &:hover { + background-color: $background-hover; + } +} + +@media only screen { + td { + min-width: 100px; + min-height: 100px; + width: 100px; + height: 100px; + text-align: center; + vertical-align: middle; + border-width: 6px; + transition: ease-in-out all .5s; + } + + .power-grid { + font-size: 23px; + } +} + +@for $i from 0 through 8 { + @media only screen and (max-width:(2000px - ($i * 100))) { + td { + min-width: (75px - ($i * 6)); + min-height: (75px - ($i * 6)); + width: (75px - ($i * 6)); + height: (75px - ($i * 6)); + text-align: center; + vertical-align: middle; + } + + .column-scroll { + font-size: (23px - ($i * 0.5)); + + h4 { + font-size: (32px - ($i * 0.5)); + } + } + + .glass-menu { + width: (40px - ($i * 5)) !important; + height: (40px - ($i * 5)) !important; + border-width: (6px - ($i * .2)) !important; + } + + .bottom-info { + max-width: ((80px - ($i * 5)) * 8 - 10); + } + } +} + +@for $i from 1 through 15 { + @media only screen and (max-width:(1250px - ($i * 50))) { + + td { + min-width: (90px - ($i * 4)); + min-height: (90px - ($i * 4)); + width: (90px - ($i * 4)); + height: (90px - ($i * 4)); + text-align: center; + vertical-align: middle; + border-width: 3px !important; + } + + .column-scroll { + font-size: 27px; + + h4 { + font-size: 32px; + } + } + + + .glass-menu > span { + width: 40px !important; + height: 40px !important; + border-width: 5px !important; + } + } +} + +.glass-menu { + @include row(3, 4); + + grid-template-areas: + '. title .' + 'sky zero steel' + 'skydesc zerodesc steeldesc' + 'cancel use use'; + + .title { + grid-area: title; + margin-top: 15px; + margin-bottom: 10px; + font-size: 23px; + } + + span { + width: 40px; + height: 40px; + + border-radius: 50%; + border-color: gray; + border-width: 5px; + border-style: solid; + + display: inline-block; + align-self: center; + + transition: .9s; + } + + button { + font-size: 25px; + } + + span.sky { + grid-area: sky; + background-color: $sky; + } + + span.zero { + grid-area: zero; + background-color: $zero; + } + + span.steel { + grid-area: steel; + background-color: $steel; + } + + p.sky { + grid-area: skydesc; + } + + p.zero { + grid-area: zerodesc; + } + + + p.steel { + grid-area: steeldesc; + } + + span.empty { + background-color: #fdfcfc !important; + } + + button.cancel { + margin-left: 10px; + min-width: 100%; + grid-area: cancel; + } + + button.use { + margin-right: 10px; + min-width: 100%; + grid-area: use; + } +} + + + +.piece-row { + @include row(3, 3); + + grid-template-areas: + 'name . row' + 'img . row' + 'take . row'; + + h4 { + grid-area: name; + margin-top: 10px; + margin-bottom: 5px; + font-size: 20px; + } + + img { + grid-area: img; + } + + .row { + grid-area: row; + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: 50px; + + button { + height: min-content; + font-size: 20px; + min-width: fit-content; + } + } + + .take { + grid-area: take; + } + +} + +.power-grid { + @include row(5, 4); + + grid-template-areas: + 'title title title . .' + 'desc desc desc img img' + 'desc desc desc img img' + 'desc desc desc . .'; + + img { + position: relative; + max-height: 100px; + min-height: 100px; + } + + h4 { + margin-top: 0px; + margin-bottom: 0px; + } +} \ No newline at end of file diff --git a/src/basePieces.nim b/src/basePieces.nim index de6c93a..82120c1 100644 --- a/src/basePieces.nim +++ b/src/basePieces.nim @@ -2,7 +2,7 @@ import piece, moves #I dont' know why printing any base pieces causes a fatal error, but don't do it I guess -const rookWhenTaken*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = +const rookWhenTaken*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = #castling behavior if taker.item == King and taken.item == Rook and @@ -11,16 +11,16 @@ const rookWhenTaken*: WhenTaken = proc (taken: var Piece, taker: var Piece, boar taken.timesMoved == 0: let kingTile = taker.tile if taken.tile.file == 0: - taker.pieceMove(kingTile.rank, kingTile.file - 2, board) - taken.pieceMove(kingTile.rank, kingTile.file - 1, board) + taker.pieceMove(kingTile.rank, kingTile.file - 2, board, state) + taken.pieceMove(kingTile.rank, kingTile.file - 1, board, state) return ((kingTile.file - 1, kingTile.rank), false) else: - taker.pieceMove(kingTile.rank, kingTile.file + 2, board) - taken.pieceMove(kingTile.rank, kingTile.file + 1, board) + taker.pieceMove(kingTile.rank, kingTile.file + 2, board, state) + taken.pieceMove(kingTile.rank, kingTile.file + 1, board, state) return ((kingTile.file + 1, kingTile.rank), false) else: #if not taken by king (how castling works), it does regular behavior - return defaultWhenTaken(taken, taker, board) + return defaultWhenTaken(taken, taker, board, state) #base pieces, should be copied and not used on their own #its annoying to have to do the defaults here, but I couldn't find another way @@ -57,12 +57,19 @@ const filePath: "bishop.svg") air*: Piece = Piece(item: None, color: white) -const onPawnPromote*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - piece = blackQueen.pieceCopy(piecesTaken=piece.piecesTaken, tile=piece.tile, promoted = true, color = piece.color, filePath = "queen.svg", wallet = piece.wallet) +const onPawnPromote*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + piece = blackQueen.pieceCopy( + index = piece.index, + piecesTaken = piece.piecesTaken, + timesMoved = piece.timesMoved, + tile=piece.tile, + promoted = true, + color = piece.color, + filePath = "queen.svg") -const onPawnEnd*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const onPawnEnd*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.isAtEnd() and not piece.promoted: - piece.promote(board) + piece.promote(board, state) #wierd order is because pawn requires onPawnEnd, which requires whiite queen. I wish Nim had hoisting #edit it turns out you can do hoist like in moves.nim but I can't figure out how to do it here @@ -74,7 +81,7 @@ const whenTaken: defaultWhenTaken, onEndTurn: @[onPawnEnd], onPromote: @[onPawnPromote], filePath: "pawn.svg") -proc startingBoard*(): ChessBoard = +proc startingBoard*(state: var BoardState): ChessBoard = result = [[blackRook, blackKnight, blackBishop, blackQueen, blackKing, blackBishop, blackKnight, blackRook], [blackPawn, blackPawn, blackPawn, blackPawn, blackPawn, blackPawn, blackPawn, blackPawn], [air, air, air, air, air, air, air, air], @@ -84,9 +91,9 @@ proc startingBoard*(): ChessBoard = [whitePawn, whitePawn, whitePawn, whitePawn, whitePawn, whitePawn, whitePawn, whitePawn], [whiteRook, whiteKnight, whiteBishop, whiteQueen, whiteKing, whiteBishop, whiteKnight, whiteRook]] - for j, r in result: - for i, x in r: - result[j][i] = x.pieceCopy(tile = (i, j)) + for i, r in result: + for j, x in r: + result[i][j] = x.pieceCopy(index = newIndex(state), tile = (j, i)) #TESTS when isMainModule: diff --git a/src/board.nim b/src/board.nim index 73a5c5b..4f443f1 100644 --- a/src/board.nim +++ b/src/board.nim @@ -19,7 +19,7 @@ func emptyBoard*(): ChessBoard = for j,x in result: for i,y in x: - result[j][i] = y.pieceCopy(tile=(j, i)) + result[j][i] = y.pieceCopy(0, tile=(j, i)) func `==`*(a: Tile, b: Tile): bool = return a.file == b.file and a.rank == b.rank @@ -28,7 +28,7 @@ func `==`*(a: Tile, b: Tile): bool = #a function which takes a `Tile` and returns a `Tile` # `m` to the right and `n` below #m is annotated with `piece.File` to not confuse it when `syncio.File` -func shooterFactory*(m: piece.File, n: Rank): Shooter = +func shooterFactory*(m: int, n: int): Shooter = result = proc(t: Tile): Tile = (t.file + m, t.rank + n) func tileAbove*(t: Tile): Tile = @@ -43,6 +43,10 @@ func tileLeft*(t: Tile): Tile = func tileRight*(t: Tile): Tile = return (t.file + 1, t.rank) +func forward*(p: Piece): Tile = + if p.color == piece.white: return p.tile.tileAbove + else: return p.tile.tileBelow + #if `t` is a valid tile for the `ChessBoard b`, it returns `Some(p)`, where `p` is the `Piece` at that tile #otherwise, it returns none. #I kind of forgot to use options in the rest of the project, but it's still needed here for diff --git a/src/capitalism.nim b/src/capitalism.nim new file mode 100644 index 0000000..8d7d0d8 --- /dev/null +++ b/src/capitalism.nim @@ -0,0 +1,49 @@ +import piece, std/options +from sugar import `=>` + +#I put this into a new folder because I don't like tons of files in main src + +func hasWallet*(side: Color, s: BoardState): bool = + return s.side[side].wallet.isSome() + +func getMoney*(side: Color, s: BoardState): int = + let wallet = s.side[side].wallet + if wallet.isSome(): + return wallet.get() + else: + return -1 #default value instead of erroring + +proc addMoney*(side: Color, money: int, s: var BoardState) = + assert s.side[side].wallet.isSome() + s.side[side].wallet = s.side[side].wallet.map(x => x + money) + +proc initWallet*(side: Color, s: var BoardState) = + s.side[side].wallet = some(0) + +proc buy*(piece: var Piece, option: BuyOption, b: var ChessBoard, s: var BoardState) = + assert piece.color.hasWallet(s) + assert option.condition(piece, b, s) + + if piece.color.getMoney(s) >= option.cost(piece, b, s): + piece.color.addMoney(-option.cost(piece, b, s), s) + option.action(piece, b, s) + + +proc buyMoveUpgrade*(move: MoveProc): OnPiece = + result = proc (piece: var Piece, board: var ChessBoard, _: var BoardState) = + piece.moves &= move + +proc buyMoveUpgradeCondition*(move: MoveProc): BuyCondition = + result = func (piece: Piece, board: ChessBoard, s: BoardState): bool = + return move notin piece.moves #only allows buy if piece doesn't already have move + +const alwaysTrue*: BuyCondition = func (piece: Piece, b: ChessBoard, s: BoardState): bool = + return true + +proc alwaysCost*(cost: int): BuyCost = + result = func (piece: Piece, b: ChessBoard, s: BoardState): int = + return cost + +proc exceptCost*(normalCost: int, exceptPiece: PieceType, exceptCost: int): BuyCost = + result = func (piece: Piece, b: ChessBoard, s: BoardState): int = + return if piece.item != exceptPiece: normalcost else: exceptCost diff --git a/src/extrapower/glass.nim b/src/extrapower/glass.nim new file mode 100644 index 0000000..f07c271 --- /dev/null +++ b/src/extrapower/glass.nim @@ -0,0 +1,30 @@ +import ../piece +from sequtils import filterIt, mapIt +from strutils import toLower +import std/options + +func toGlassType*(str: string): GlassType = + if str.toLower() == "sky": + return Sky + elif str.toLower() == "zero": + return Zero + elif str.toLower() == "steel": + return Steel + +#I'm plutting the glass stuff here instead of a new file +#since its only like two things +func hasGlass*(side: Color, state: BoardState): bool = + for g in GlassType: + if state.side[side].glass[g].isSome(): return true #kind of ugly, maybe I should rename glass to glasses? + return false + +#TODO clean this function, it's so ugly +#It should take pieces, corresponsingTiles, and a GlassAction (which is just OnAction) +#and return a function which handles if the piece disappears or moves +func packageGlass*(pieces: seq[Piece], tiles: seq[Tile], action: OnAction): BoardAction = + let indexes = pieces.mapIt(it.index) + result = proc (board: var ChessBoard, state: var BoardState) = + for i, j in board.rankAndFile: + for indexIndex, index in indexes: + if index == board[i][j].index: + action(board[i][j], tiles[indexIndex], board, state) \ No newline at end of file diff --git a/src/main.nim b/src/main.nim index d4c791e..5bd41d1 100644 --- a/src/main.nim +++ b/src/main.nim @@ -1,10 +1,12 @@ include karax / prelude import karax/errors -import piece, basePieces, port, power, powers, store #powers import for debug +import piece, basePieces, port, power, powers, store, capitalism #powers import for debug +import extrapower/glass import std/dom, std/strformat #im not sure why dom stuff fails if I don't import the whole package -from strutils import split, parseInt -from sequtils import foldr, mapIt - +import std/options #try to expand use of this, instead of wierd tuple[has: bool stuff +from strutils import split, parseInt, join, toLower +from sequtils import foldr, mapIt, cycle, filterIt +from std/algorithm import reversed {.warning[CStringConv]: off.} #fixing the issue makes the code look bad, so I'm turning it off. Genius, I know @@ -35,22 +37,40 @@ const defaultBaseDrafts: int = 3 const defaultBaseDraftChoices: int = 3 #CSS Classes -const menuButton = "menu-button" +#TODO migrate to these constants +#spaces made concat easy +const + menuButton = " menu-button " + pieceRow = " piece-row " + glassMenu = " glass-menu " + height100 = " height-100 " + width100 = " width-100 " + settingItem = " setting-item " + castingAnimations: array[GlassType, string] = + ["casting-sky", "casting-zero", "casting-steel"] #corresponding css classes for each type type Screen {.pure.} = enum Lobby, CreateRoom, JoinRoom, Game, Options, Draft, Results, Rematch, Disconnect, Settings, Other - Gamemode = enum + Gamemode {.pure.} = enum Normal, RandomTier, TrueRandom, SuperRandom + Tab {.pure.} = enum + My, Opponent, Control, Debug + ActionContext = tuple + name: string + turns: int + group: int + action: BoardAction + cancelable: bool + passthrough: bool + send: proc () #I really went for 2 months changing the values by hand each time -const debug: bool = false +const debug: bool = true const debugScreen: Screen = Game -const myDebugPowers: seq[Power] = @[sacrifice, altEmpress] -const opponentDebugPowers: seq[Power] = @[holy, sleeperAgent, capitalism] - -var screenWidth: int = window.innerWidth +const myDebugPowers: seq[Power] = @[capitalismPower, sell, income, moveUp, upgrade, exponentialGrowth, skyGlass, steelGlass, zeroGlass] +const opponentDebugPowers: seq[Power] = @[developed] var #state for coordination with other player @@ -58,8 +78,8 @@ var peer: tuple[send: proc(data: cstring), destroy: proc()] side: Color = if debug: white else: black turn: bool = if debug: true else: false - myDrafts: seq[Power] = if debug: myDebugPowers else: @[] - opponentDrafts: seq[Power] = if debug: opponentDebugPowers else: @[] + myDrafts: seq[Power] = @[] + opponentDrafts: seq[Power] = @[] #state for draft baseDrafts: int @@ -70,21 +90,42 @@ var #state for game rematch = false - theBoard: ChessBoard = startingBoard() #also for debug + theBoard: ChessBoard #also for debug + theState: BoardState selectedTile: Tile = (file: -1, rank: -1) #negative means unselected possibleMoves: Moves = @[] possibleTakes: Moves = @[] lastMove: Moves = @[] piecesChecking: Moves = @[] - turnNumber: int = 1 #settings decided by player showTechnicalNames: bool = false disableRNGPowers: bool = false + showDebug: bool = false + enableExperimental: bool = false #state for webapp currentScreen: Screen = if debug: debugScreen else: Lobby + currentTab: Tab = My gameMode: Gamemode# = TrueRandom #deubg + screenWidth: int = window.innerWidth + + #for glass stuff + #i'll namespace in a tuple if I feel like there are too many globals + selectedGlass: Option[GlassType] = none(GlassType) + + actionStack: seq[ActionContext] = @[] + nextActionStack: seq[ActionContext] = @[] + toSend: seq[ActionContext] = @[] + promptHistory: seq[string] = @[] + promptStack: seq[string] = @[] + picksLeft: int = 0 + getPickOptions: proc(): seq[Tile] + pickOptions: seq[Tile] + picks: seq[Tile] = @[] + whenCollected: proc() + + proc alert(s: cstring) {.importjs: "alert(#)".} proc onresize(cb: proc()) {.importjs: "window.addEventListener('resize', #)".} @@ -93,38 +134,105 @@ proc resize() = screenWidth = window.innerWidth redraw() -onresize(resize) - proc pieceOf(tile: Tile): var Piece = theBoard[tile.rank][tile.file] proc isSelected(n: int, m: int): bool = return selectedTile.rank == n and selectedTile.file == m -initStorage() +proc busy(): bool = + return actionStack.len != 0 or picksLeft != 0 or not turn proc initGame() = - theBoard = startingBoard() + theState = startingState() + theBoard = startingBoard(theState) + if not debug: theState.shared.randSeed = roomId.value.parseInt() myDrafts = @[] opponentDrafts = @[] lastMove = @[] piecesChecking = @[] - turnNumber = 0 + +proc clear() = + selectedTile = (-1, -1) + possibleMoves = @[] + possibleTakes = @[] + proc endRound() = for i, j in rankAndFile(theBoard): - theBoard[i][j].endTurn(theBoard) + theBoard[i][j].endTurn(theBoard, theState) #this is needed by the random move powers to prevent double moves #It needs to happen after so that all drunkness is cleared after end turn stuff for i, j in rankAndFile(theBoard): - theBoard[i][j].rand.drunk = false + theBoard[i][j].drunk = false piecesChecking = theBoard.getPiecesChecking(side) if gameIsOver(theBoard): if side.alive(theBoard): addWins(myDrafts) currentScreen = Results + #TODO remove after tests + #ensuring that indexes are never duplicated + var test: seq[int] = @[] + for i, j in theBoard.rankAndFile: + assert theBoard[i][j].index notin test, fmt"{theBoard[i][j]} has some issues" + test.add(theBoard[i][j].index) + +proc sendAction(data: string, `end`: bool) = + if `end`: inc theState.shared.turnNumber + if not debug: #skip send whn debugging because peer is undefined + peer.send(fmt"action:{data}") + if `end`: + turn = false #I also want turn to be always true when in debug + echo "send action changing turn" + if `end`: endRound() + +proc updateActionStack() = + echo "as", actionStack + echo "nas", nextActionStack + echo "s", toSend + if actionStack.len == 0: + if nextActionStack.len != 0: + for i, x in nextActionStack: + dec nextActionStack[i].turns + + if not debug: + if toSend.len != 0: + for x in toSend: + x.send() + echo "send, this ends turn if .send does" + else: + #if all of them are not passThough, then pass + if nextActionStack.len != 0 and not nextActionStack.mapIt(it.passthrough).foldr(a and b): + sendAction("pass", true) + + actionStack = nextActionStack + nextActionStack = @[] + toSend = @[] + +proc sendMove(moveType: string, start: Tile, to: Tile) = + sendAction(fmt"{$moveType},{$start.rank},{& $start.file},{$to.rank},{$to.file}", true) + +proc sendBuy(option: BuyOption, tile: Tile) = + sendAction(fmt"buy,{option.name},{$tile.rank},{$tile.file}", false) + +proc createSendGlass(group: int): proc () = + result = proc () = + #I think its easier to send them one at a time, but + #that means that we need a final send, which is just a pass + sendAction(fmt"castingcomplete,{group}", false) + sendAction("pass", true) + +proc otherBuy(d: string) = + let data = d.split(",") + assert data[0] == "buy" + let piece = (parseInt(data[3]), parseInt(data[2])) + assert pieceOf(piece).color.hasWallet(theState) + + for option in theState.side[otherSide(side)].buys: + if option.name == data[1]: + buy(pieceOf(piece), option, theBoard, theState) proc otherMove(d: string) = let data = split(d, ",") @@ -135,42 +243,83 @@ proc otherMove(d: string) = possibleMoves = @[] possibleTakes = @[] - inc turnNumber + inc theState.shared.turnNumber echo d, data[0], mover, moveTo if data[0] == "move": - pieceOf(mover).move(moveTo, theBoard) + pieceOf(mover).move(moveTo, theBoard, theState) elif data[0] == "take": - pieceOf(mover).take(moveTo, theBoard) - turn = not turn - endRound() + pieceOf(mover).take(moveTo, theBoard, theState) -proc sendMove(mode: string, start: Tile, to: Tile) = - if debug and debugScreen == Game: return #returns early to stop send move, since peer would not be defined when debugging - peer.send("move:" & mode & "," & $start.rank & "," & $start.file & "," & $to.rank & "," & $to.file) - turn = not turn - inc turnNumber - - -proc otherBuy(d: string) = +proc otherGlass(d: string) = + let data = split(d, ",") + if data[0] == "castingstart": + theBoard[parseInt(data[1])][parseInt(data[2])].casts.add(( + on: (file: parseInt(data[4]), rank: parseInt(data[3])).Tile, + group: parseInt(data[5]), + glass: data[6].toGlassType() + )) + elif data[0] == "castingcomplete": + turn = true + echo "turn equals true: otherglass" + for i, j in theBoard.rankAndFile: + for c in theBoard[i][j].casts: + if c.group == parseInt(data[1]): + #we filterit out first because it could move away during the action + theBoard[i][j].casts = theBoard[i][j].casts.filterIt(it.group != c.group) + theState.side[otherSide(side)].glass[c.glass].get().action( + theBoard[i][j], c.on, theBoard, theState + ) + + +proc otherAction(d: string) = let data = d.split(",") - let piece = (parseInt(data[2]), parseInt(data[1])) - assert pieceOf(piece).color.hasWallet(theBoard) + if data[0] == "buy": + otherBuy(d) + endRound() + elif data[0] == "move" or data[0] == "take": + turn = true + echo "otheraction of move/take: turn equals true" + otherMove(d) + endRound() + elif data[0].contains("casting"): + otherGlass(d) + elif data[0] == "pass": + turn = true + echo "otheraction of pass: turn equals true" + endRound() + +proc cancelPick() = + if promptHistory.len > 0: + inc picksLeft + discard picks.pop() #remove pick + promptStack.add(promptHistory.pop()) #push back to history + pickOptions = getPickOptions() + +proc cancelPick(_: Event, _: VNode) = + cancelPick() - for option in pieceOf(piece).wallet.options: - if option.name == data[0]: - buy(pieceOf(piece), option, theBoard) +proc cancelAllPicks() = + promptHistory = @[] + promptStack = @[] + picks = @[] + picksLeft = 0 + pickOptions = @[] -proc sendBuy(option: BuyOption, tile: Tile) = - if debug and debugScreen == Game: return #returns early since peer is undefined when debugging - peer.send(fmt"buy:{option.name},{$tile.rank},{$tile.file}") + whenCollected = nil + getPickOptions = nil +proc cancelAllPicks(_: Event, _: VNode) = + cancelAllPicks() + proc draft(allDrafts: seq[Power] = @[], drafter: seq[Power] = @[]) = var disabled: seq[Power] = @[] if disableRNGPowers: disabled &= rngPowers + if not enableExperimental: + disabled &= experimentalPowers if gameMode == TrueRandom: draftOptions = draftRandomPower(allDrafts & disabled, drafter, draftChoices) @@ -180,16 +329,6 @@ proc draft(allDrafts: seq[Power] = @[], drafter: seq[Power] = @[]) = elif gameMode == SuperRandom: draftOptions = draftRandomPower(allDrafts & disabled, drafter, draftChoices, insaneWeights, buffedInsaneWeights) -#also for debugging -if debug and debugScreen == Screen.Draft: - gameMode = TrueRandom - draft() - -for i, j in rankAndFile(theBoard): - theBoard[i][j].rand.seed = 0 -myDrafts.executeOn(white, side, theBoard) -opponentDrafts.executeOn(black, side,theBoard) - proc hostLogic(d: string, m: MessageType) = echo $m, " of ", d, "\n" case m @@ -212,16 +351,10 @@ proc hostLogic(d: string, m: MessageType) = draftTier = randomTier(defaultBuffedWeights) draft(myDrafts & opponentDrafts, myDrafts) else: - myDrafts.executeOn(white, side, theBoard) - opponentDrafts.executeOn(black, side, theBoard) - for i, j in rankAndFile(theBoard): - theBoard[i][j].rand.seed = parseInt(roomId.value) + execute(myDrafts, opponentDrafts, side, theBoard, theState) peer.send("handshake:gamestart") currentScreen = Game - - - of Move: otherMove(d) - of Buy: otherBuy(d) + of Action: otherAction(d) of End: if d == "disconn" or d == "exit": currentScreen = Disconnect @@ -241,10 +374,7 @@ proc joinLogic(d: string, m: MessageType) = turn = false initGame() of Handshake: - myDrafts.executeOn(black, side, theBoard) - opponentDrafts.executeOn(white, side, theBoard) - for i, j in rankAndFile(theBoard): - theBoard[i][j].rand.seed = parseInt(roomId.value) + execute(myDrafts, opponentDrafts, side, theBoard, theState) currentScreen = Game of Rematch: if rematch: @@ -264,8 +394,7 @@ proc joinLogic(d: string, m: MessageType) = draftOptions.add(powers[parseInt(i)]) turn = true - of Move: otherMove(d) - of Buy: otherBuy(d) + of Action: otherAction(d) of End: if d == "disconn" or d == "exit": currentScreen = Disconnect @@ -285,11 +414,22 @@ proc validateNotEmpty(field: kstring): proc () = proc createTile(p: Piece, m: int, n: int): VNode = var class = if (m*7+n) mod 2 == 0: "whiteTile" else: "blackTile" + + for i, j in theBoard.rankAndFile: + for c in theBoard[i][j].casts: + if p.tile == c.on: + class &= " casting-on-" & ($c.glass).toLower() + + for c in p.casts: + class &= " casting-" & ($c.glass).toLower() + if isSelected(m, n) and possibleTakes.contains(p.tile): class &= " can-take" elif isSelected(m,n): class &= " selected" - elif possibleMoves.contains(p.tile): + elif p.tile in picks: + class &= " picking" + elif possibleMoves.contains(p.tile) or p.tile in pickOptions: class &= " can-move" elif possibleTakes.contains(p.tile): class &= " can-take" @@ -304,32 +444,39 @@ proc createTile(p: Piece, m: int, n: int): VNode = result = buildHtml(): td(class=class): - proc onclick(_: Event; _: VNode) = - if possibleMoves.contains(p.tile) and turn and pieceOf(selectedTile).isColor(side): - sendMove("move", selectedTile, p.tile) - pieceOf(selectedTile).move(p.tile, theBoard) - possibleMoves = @[] - selectedTile = (-1,-1) - possibleTakes = @[] - endRound() - elif possibleTakes.contains(p.tile) and turn and pieceOf(selectedTile).isColor(side): - sendMove("take", selectedTile, p.tile) - pieceOf(selectedTile).take(p.tile, theBoard) - possibleTakes = @[] - selectedTile = (-1, -1) - possibleMoves = @[] - endRound() + proc onclick(_: Event; _: VNode) = + if picksLeft != 0 and p.tile in pickOptions: + dec picksLeft + picks.add(p.tile) + promptHistory.add(promptStack.pop()) #moves from stack to history + pickOptions = getPickOptions() + clear() + if picksLeft == 0: + echo "when collected start" + whenCollected() + echo "When Collected" + cancelAllPicks() + echo "Cancel All" + elif possibleMoves.contains(p.tile) and + pieceOf(selectedTile).isColor(side) and not busy(): #picksLeft == 0 stops moves during pick + pieceOf(selectedTile).move(p.tile, theBoard, theState) + sendMove("move", selectedTile, p.tile) + echo "send" + clear() + elif possibleTakes.contains(p.tile) and + pieceOf(selectedTile).isColor(side) and not busy(): #picksLeft == 0 stops moves during pick: + pieceOf(selectedTile).take(p.tile, theBoard, theState) + sendMove("take", selectedTile, p.tile) + clear() elif not isSelected(m, n): selectedTile = (n, m) possibleMoves = p.getMovesOn(theBoard) possibleTakes = p.getTakesOn(theBoard) else: - selectedTile = (-1,-1) - possibleMoves = @[] - possibleTakes = @[] + clear() if p.filePath == "": - text $p + text "" else: let class = if p.rotate: "rotate" else: "" let color = if p.colorable: $p.color else: "" @@ -387,19 +534,20 @@ proc createRoomMenu(): VNode = br() text roomId.value +proc join(_: Event, _: VNode) = + let id = getVNodeById("joincode").getInputText + roomId.value = id + echo getVNodeById("joincode") + if not peer.destroy.isNil(): + peer.destroy() + peer = newJoin(id, joinLogic) + proc createJoinMenu(): VNode = - result = buildHtml(tdiv(class="main cut-down", id = "join")): + result = buildHtml(tdiv(class="main cut-down", id = "join", onkeyupenter = join)): label(`for` = "joincode"): text "Join Code:" input(id = "joincode", onchange = validateNotEmpty("joincode")) - button: - proc onclick(ev: Event; v: VNode) = - let id = getVNodeById("joincode").getInputText - roomId.value = id - echo getVNodeById("joincode") - if not peer.destroy.isNil(): - peer.destroy() - peer = newJoin(id, joinLogic) + button(onclick = join): text "Enter" proc createOptionsMenu(): VNode = @@ -561,22 +709,21 @@ proc createPowerSummary(p: Power, ofSide: Color): VNode = img(class = class, src = iconsPath & "blackbishop.svg") #placeholder proc createBuyButton(option: BuyOption, p: var Piece): VNode = - if not option.condition(p, theBoard): + if not option.condition(p, theBoard, theState): return buildHtml(tdiv()) else: - let disabled = not turn or getWallet(side, theBoard) < option.cost - buildHtml(button(class=menuButton, disabled=disabled)): - text fmt"{option.name}: ${option.cost}" + let cost = option.cost(p, theBoard, theState) + let disabled = not turn or getMoney(side, theState) < cost + #technically, a positive cost means that you pay that much, but that isn't very intuitive + let sign = if cost >= 0: "-" else: "+" + buildHtml(button(disabled=disabled)): + text fmt"{option.name}: {sign}${abs(cost)}" #abs beacuse sign should be infront of dollar sign proc onclick(_: Event; _: VNode) = sendBuy(option, p.tile) - buy(p, option, theBoard) - selectedTile = (-1, -1) #clears since piece could be in a different spot - possibleMoves = @[] #TODO make this clearing a function because its DRY - possibleTakes = @[] + buy(p, option, theBoard, theState) + clear() #clears since piece could be in a different spot proc createPieceProfile(p: var Piece): VNode = - if p.isAir(): - return buildHtml(tdiv()) var imgClass = "" if side != p.color and p.rotate: imgClass &= "rotate " @@ -586,7 +733,7 @@ proc createPieceProfile(p: var Piece): VNode = let name = $p.item - result = buildHtml(tdiv(class="piece-row")): + result = buildHtml(tdiv(class=pieceRow)): h4: text name img(class=imgClass, src=src & p.filePath) @@ -594,47 +741,211 @@ proc createPieceProfile(p: var Piece): VNode = text fmt"Kills: {p.piecesTaken} pieces." if p.isColor(side): #only show buttons when its your piece tdiv(class="row"): - for option in p.wallet.options: + for option in theState.side[p.color].buys: createBuyButton(option, p) -proc createWallet(side: Color): VNode = - result = buildHtml(tdiv): - if hasWallet(side, theBoard): - h1: - text fmt"You have {getWallet(side, theBoard)} dollars." - -proc createGame(): VNode = - echo screenWidth - result = if screenWidth > 1250: - buildHtml(tdiv(class="main")): - tdiv(class="column-scroll"): - if not isSelected(-1, -1): - createPieceProfile(pieceOf(selectedTile)) - for p in myDrafts.replaceAnySynergies(): - createPowerSummary(p, side) +proc createInfo(): VNode = + result = buildHtml(tdiv(class="bottom-info")): + if turn and actionStack.len != 0: + if actionStack[^1].turns == 0: #it has to be your turn, or it has to be passThrough + h3: + if actionStack[^1].passThrough: + text fmt"Execute {actionStack[^1].name} (This will end your turn, after all other actions are resolved): " + else: + text fmt"Execute {actionStack[^1].name}: " + button: + text "Execute!" + proc onclick(_: Event, _: VNode) = + actionStack[^1].action(theBoard, theState) + echo "action complete" + for i, j in theBoard.rankAndFile: + theBoard[i][j].casts = theBoard[i][j].casts.filterIt(it.group != actionStack[^1].group) + toSend.add(actionStack.pop()) + echo "sent" + updateActionStack() + elif actionStack[^1].cancelable: + h3: + if actionStack[^1].passThrough: + text fmt"""{actionStack[^1].name} will complete in {actionStack[^1].turns}. Continuing does not end your turn. """ + else: + text fmt"""{actionStack[^1].name} will complete in {actionStack[^1].turns}. Your turn will end if you continue.""" tdiv(class="column"): - if side == white: createBoard() else: reverseBoard() - createWallet(side) - tdiv(class="column-scroll"): - for p in opponentDrafts.replaceAnySynergies(): - createPowerSummary(p, otherSide(side)) + button: + text "Continue" + proc onclick(_: Event, _: VNode) = + nextActionStack.add(actionStack.pop()) + updateActionStack() + button: + text "Cancel" + proc onclick(_: Event, _: VNode) = + discard actionStack.pop() + updateActionStack() + else: + h3: + if actionStack[^1].passThrough: + text fmt"{actionStack[^1].name} will resolve in {actionStack[^1].turns} turns." + else: + text fmt"""{actionStack[^1].name} will resolve in {actionStack[^1].turns} turns. + This will end your turn, once all other actions are resolved.""" + button: + text "Ok" + proc onclick(_: Event, _: VNode) = + nextActionStack.add(actionStack.pop()) + updateActionStack() + elif promptStack.len == 0: + var text = if turn: "It is your turn. " else: "Opponent is moving. " + if hasWallet(side, theState): + text &= fmt"You have {getMoney(side, theState)} dollars." + h3: + text text + else: + h3: + text promptStack[^1] #last + button(onclick=cancelPick): + text "Undo last" +proc createGlassOnClick(glass: GlassType): proc (_: Event, _: VNode) = + result = proc (_: Event, _: VNode) = + if selectedGlass.isNone() or selectedGlass.get() != glass: + selectedGlass = some(glass) else: - buildHtml(tdiv(class="column height-100")): - for p in opponentDrafts.replaceAnySynergies(): - createPowerSummary(p, otherSide(side)) - if not isSelected(-1, -1) and pieceOf(selectedTile).isColor(otherSide(side)): - createPieceProfile(pieceOf(selectedTile)) + selectedGlass = none(GlassType) + +proc createGlassMenu(): VNode = + result = buildHtml(tdiv(class=glassMenu)): + h4(class="title"): + text "Glasses" - if side == white: createBoard() else: reverseBoard() + for glass in GlassType: + if theState.side[side].glass[glass].isSome(): + span(class = ($glass).toLower(), onclick=createGlassOnClick(glass)) + else: + span(class = fmt"{($glass).toLower()} empty") + p(class = ($glass).toLower()): + text $glass + if selectedGlass.isSome(): + let glass = selectedGlass.get() + if picksLeft != 0: + button(class="cancel", onclick=cancelAllPicks): + text "Cancel" + button(class="use", disabled = busy()): + text fmt"Use {glass}" + proc onclick(_: Event, _: VNode) = + let strength = theState.side[side].glass[glass].get().strength + let group = newGroup(theState) + var newCasting: seq[Casting] + var pieces: seq[Piece] = @[] + var tiles: seq[Tile] = @[] + let action = theState.side[side].glass[glass].get().action + + picksLeft = strength * 2 + promptStack = [ + fmt"Pick a piece to start casting {glass}.", + fmt"Pick a tile to cast {glass} on." + ].cycle(strength).reversed() + whenCollected = proc () = + for piece, tile in byTwo(picks): + echo "piecetile", piece, "tile, ", tile + pieces.add(theBoard[piece]) + tiles.add(tile) + newCasting.add(( + on: tile, + group: group, + glass: glass + )) + + theBoard[piece].casts.add(( + on: tile, + group: group, + glass: glass + )) + + sendAction(fmt"""castingstart,{piece.rank},{piece.file},{tile.rank},{tile.file},{group},{glass}""", false) + echo "adding actionStack" + actionStack.add(( + name: "Casting " & $glass, + turns: 1, + group: group, + action: packageGlass(pieces, tiles, action), + cancelable: true, + passThrough: false, + send: createSendGlass(group) + )) + echo "avtionstack added" + sendAction("pass", true) + getPickOptions = proc (): Moves = + if picksLeft mod 2 == 0: #picking piece + for i, j in theBoard.rankAndFile: + if theBoard[i][j].isColor(side): + result.add(theBoard[i][j].tile) + else: #picking tile + let condition = theState.side[side].glass[glass].get().condition + #theBoard[^1] is the last element, which would be the corresonding piece + result.add(condition(side, theBoard[picks[^1]], theBoard, theState)) + pickOptions = getPickOptions() #we run once so that there are intitial options + clear() - createWallet(side) +proc createGame(): VNode = + let topClass = if screenWidth > 1200: "main" else: "column height-100" + let nextClass = if screenWidth > 1200: "tab-column" else: "tab-column long" + buildHtml(tdiv(class=topClass)): + tdiv(class=nextClass): + tdiv(class="tab-row"): + button: + text "Your Drafts" + proc onclick(_: Event, _: VNode) = + currentTab = My + button: + text "Opponent Drafts" + proc onclick(_: Event, _: VNode) = + currentTab = Opponent + button: + text "Power Control" + proc onclick(_: Event, _: VNode) = + currentTab = Control + if debug or showDebug: + button: + text "Debug" + proc onclick(_: Event, _: VNode) = + currentTab = Debug + + tdiv(class="column-scroll"): + case currentTab + of My: + for p in myDrafts.replaceAnySynergies(): + createPowerSummary(p, side) + tdiv(class="debug"): #cheeky dev button + proc onclick(_: Event, _: VNode) = + showDebug = true + of Opponent: + for p in opponentDrafts.replaceAnySynergies(): + createPowerSummary(p, otherSide(side)) + of Control: + if isSelected(-1, -1) or theBoard[selectedTile].isAir(): + createPieceProfile(theBoard[getKing(side, theBoard)]) #default + else: + createPieceProfile(pieceOf(selectedTile)) + if side.hasGlass(theState): + createGlassMenu() + of Debug: + tdiv(class="main"): + text fmt"Shared: {$theState.shared}" + tdiv(class="main"): + text fmt"White: {$theState.side[white]}" + tdiv(class="main"): + text fmt"Black: {$theState.side[black]}" + if not isSelected(-1, -1): + tdiv(class="main"): + text fmt"Selected piece: {$pieceOf(selectedTile)}" + tdiv(class="main"): + text fmt"Action Stack: {actionStack}" + tdiv(class="main"): + text fmt"Next ActionStack: {nextActionStack}" - if not isSelected(-1, -1) and pieceOf(selectedTile).isColor(side): - createPieceProfile(pieceOf(selectedTile)) - for p in myDrafts.replaceAnySynergies(): - createPowerSummary(p, side) + tdiv(class="column"): + if side == white: createBoard() else: reverseBoard() + createInfo() proc createResults(): VNode = result = buildHtml(tdiv(class="start-column")): @@ -704,30 +1015,41 @@ proc createOther(): VNode = proc onclick(_: Event, _: VNode) = currentScreen = Lobby - - -proc createSettings(): VNode = +#if default option is true, then first change disables it +proc createSetting(setting: var bool, title: string, description: string, defaultOption = false): VNode = result = buildHtml(tdiv(class="start-column")): - tdiv(class="setting-item"): - h5(): - text "Technical Names" + tdiv(class=settingItem): + h4(): + text $title p(): - text "Shows the technical names for synergy powers and powers with multiple variations." + text $description button(): - text if showTechnicalNames: "Disable" else: "Enable" + text if defaultOption: + if not setting: "Disable" else: "Enable" + else: + if setting: "Disable" else: "Enable" proc onclick(_: Event, _: VNode) = - showTechnicalNames = not showTechnicalNames - hr() - tdiv(class="setting-item"): - h5(): - text "Disable RNG Powers" - p(): - text "Removes RNG based powers, like civilians, from the draft pool. Only works when you are the host." - button(): - text if not disableRNGPowers: "Disable" else: "Enable" - proc onclick(_: Event, _: VNode) = - disableRNGPowers = not disableRNGPowers + setting = not setting hr() + +proc createSettings(): VNode = + result = buildHtml(tdiv(class="start-column gap-10")): + createSetting( + showTechnicalNames, + "Technical Names", + "Shows the technical names for synergy powers and powers with multiple variations.", + ) + createSetting( + disableRNGPowers, + "Disable RNG Powers", + "Removes RNG based powers, like civilians, from the draft pool. Only works when you are the host.", + true + ) + createSetting( + enableExperimental, + "Include Experimental Powers", + "Adds the cutting edge of SuperChess. It is likely to break or be unbalanced.", + ) button(class="width-100"): text "Return to Other" proc onclick(_: Event, _: VNode) = @@ -750,4 +1072,22 @@ proc main(): VNode = of Settings: createSettings() +initStorage() +onresize(resize) + + +if debug: + case currentScreen + of Game: + initGame() + theState.shared.randSeed = 0 + myDrafts = myDebugPowers + opponentDrafts = opponentDebugPowers + execute(myDrafts, opponentDrafts, side, theBoard, theState) + of Draft: + gameMode = TrueRandom + draft() + else: discard nil + + setRenderer main \ No newline at end of file diff --git a/src/names.nim b/src/names.nim new file mode 100644 index 0000000..22d8a23 --- /dev/null +++ b/src/names.nim @@ -0,0 +1,10 @@ +from random import randomize, sample +from sequtils import filterIt + +const pawnPool = ["Joe", "John"] + +proc generateName*(pool: openArray[string], seed: int, + excluding: openArray[string] = @[]): string = + randomize(seed) + let cutPool: seq[string] = pool.filterIt(it notin excluding) + return cutPool.sample() \ No newline at end of file diff --git a/src/piece.nim b/src/piece.nim index 127ed37..03bdf8c 100644 --- a/src/piece.nim +++ b/src/piece.nim @@ -1,11 +1,12 @@ #TODO remove Rank and File types since I forgot to use them, or maybe try to use them +#think about unifying GlassMoves and BuyCondition #all the types are defined here, even though their implementations are in other files, to fix cyclical definitons with `Piece` #I could have put it in a new file, but I didn't. The reason remains one of the world's greatest mysteries. +import std/options +from sequtils import filterIt, mapIt type - Tile* = tuple[file: File, rank: Rank] #used for position of all pieces - Rank* = int #chess terminology, though I completely forgot to follow it - File* = int #it probably should have been an enum. Too late. Maybe just change to normal ints + Tile* = tuple[file: int, rank: int] #used for position of all pieces #The main data structure which holds the entire state of the board #It is created in `basePieces.startingBoard.nim` @@ -24,25 +25,41 @@ type #takes the state of the board and a piece, and returns possible `Moves` by that piece #It only needs to return one type of moves (like one row forward), since #`Piece` takes a `seq` of `Moves` - MoveProc* = proc(board: ChessBoard, piece: Piece): Moves {.noSideEffect.} - Shooter* = proc(tile: Tile): Tile {.noSideEffect.} + MoveProc* = proc (board: ChessBoard, piece: Piece): Moves {.noSideEffect.} + Shooter* = proc (tile: Tile): Tile {.noSideEffect.} #`OnAction` is used when `piece` tries to move to `to` #it mutates the piece and the board - OnAction* = proc(piece: var Piece, to: Tile, board: var ChessBoard) + OnAction* = proc (piece: var Piece, to: Tile, board: var ChessBoard, state: var BoardState) #`WhenTaken` is called by the `taker Piece` when it attempts to take `taken Piece` #It can mutate both pieces, so `endTile` should be used to access `taker` after, since `taken` and `taker` will can after this is called #This is one of the sad truths of the code base, but I couldn't find anyway to change the board and not change the object given #`takeSuccess` also returns true if the `taken` piece is killed by `taker` - WhenTaken* = proc(taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] - OnPiece* = proc (piece: var Piece, board: var ChessBoard) + WhenTaken* = proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] + OnPiece* = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) + BoardAction* = proc (board: var ChessBoard, state: var BoardState) - BuyCondition* = proc(piece: Piece, board: ChessBoard): bool {.noSideEffect.} - BuyOption* = tuple[name: string, cost: int, action: OnPiece, condition: BuyCondition] + Casting* = tuple[on: Tile, group: int, glass: GlassType] + + BuyCondition* = proc (piece: Piece, board: ChessBoard, s: BoardState): bool {.noSideEffect.} + BuyCost* = proc (piece: Piece, board: ChessBoard, s: BoardState): int {.noSideEffect.} + BuyOption* = tuple[name: string, cost: BuyCost, action: OnPiece, condition: BuyCondition] + + + GlassType* = enum + Sky, Zero, Steel + GlassMoves* = proc (side: Color, piece: Piece, b: ChessBoard, s: BoardState): Moves {.noSideEffect.} + GlassTile* = proc (side: Color, piece: Piece, castedTile: Tile): Tile {.noSideEffect.}#I am the king of over engineering + GlassAbility* = tuple + strength: int + action: OnAction + condition: GlassMoves + Glasses* = array[GlassType, Option[GlassAbility]] Piece* = object item*: Piecetype color*: Color + index*: int #index is used for equality. if `p1.index == p2.index` then `p1 == p2` timesMoved*: int = 0 piecesTaken*: int = 0 tile*: Tile = (file: -1, rank: -1) @@ -57,33 +74,30 @@ type filePath*: string = "" colorable*: bool = true rotate*: bool = false - rand*: tuple[drunk: bool, seed: int] = (false, 0) #used for some of the powers with rng - wallet*: tuple[money: int, options: seq[BuyOption]] = (-1, @[]) + drunk*: bool = false + casts*: seq[Casting] -#helper templates for `Piece` methods -#since methods are properties of the class, you would usually have to do `Piece.method(Piece)` -#since you need to access it in `Piece` and pass `Piece` -#these templates fix that boilerplate a little bit -template move* (a: var Piece, b: Tile, c: var ChessBoard): untyped = - a.onMove(a, b, c) + BoardState* = tuple[shared: SharedState, side: array[Color, SideState]] + + SharedState* = object + nextIndex: int = 1 #hidden because `newIndex` should be used instead to ensure proper management + nextGroup: int = 1 + randSeed*: int = 0 + turnNumber*: int = 0 -template take* (a: var Piece, b: Tile, c: var ChessBoard): untyped = - a.onTake(a, b, c) + SideState* = object + abilityTakes*: int = 0 #takes from ability. I could put on a piece, but it would cause issues with some powers -template promote* (a: Piece, c: var ChessBoard): untyped = - for p in a.onPromote: - p(a, c) - if a.promoted: break + wallet*: Option[int] = none(int) + buys*: seq[BuyOption] = @[] + piecesSold*: int = 0 -template endTurn* (a: var Piece, c: var ChessBoard): untyped = - for p in a.onEndTurn: - p(a, c) + glass*: Glasses = arrayWith(none(GlassAbility), GlassType.high.ord.succ) #high.ord.succ finds length of enum. I could do high.ord + 1 but .succ looks cooler -template takenBy*(taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - taken.whenTaken(taken, taker, board) -template takenBy*(taken: Tile, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - board[taken.rank][taken.file].whenTaken(board[taken.rank][taken.file], taker, board) +func startingState*(): BoardState = + result.shared = SharedState() + result.side = [SideState(), SideState()] #returns a tuple for each rank file pair of the board #so this @@ -91,32 +105,117 @@ template takenBy*(taken: Tile, taker: var Piece, board: var ChessBoard): tuple[e # for j in 0.. getPiecesChecking(b, otherSide(p.color)).len + func isAtEnd*(piece: Piece): bool = return (piece.tile.rank == 7 and piece.color == black) or (piece.tile.rank == 0 and piece.color == white) -func hasWallet*(side: Color, b: ChessBoard): bool = - for i, j in b.rankAndFile: - if b[i][j].isColor(side) and - b[i][j].item == King and - b[i][j].wallet.money != -1: - return true - -func getWallet*(side: Color, b: ChessBoard): int = - for i, j in b.rankAndFile: - if b[i][j].isColor(side) and - b[i][j].item == King: - return b[i][j].wallet.money +func getKing*(side: Color, board: ChessBoard): Tile = + for i, j in board.rankAndFile: + if board[i][j].item == King and board[i][j].color == side: + return board[i][j].tile -proc buy*(piece: var Piece, option: BuyOption, board: var ChessBoard) = - echo piece, option.name, getWallet(piece.color, board) +func getKingPiece*(side: Color, board: ChessBoard): Piece = for i, j in board.rankAndFile: - if board[i][j].item == King and board[i][j].sameColor(piece): - if board[i][j].wallet.money >= option.cost: - board[i][j].wallet.money -= option.cost - option.action(piece, board) \ No newline at end of file + if board[i][j].item == King and board[i][j].color == side: + return board[i][j] \ No newline at end of file diff --git a/src/port.nim b/src/port.nim index 3549ba5..c15873b 100644 --- a/src/port.nim +++ b/src/port.nim @@ -6,7 +6,7 @@ type Peer = JsObject Connection = JsObject MessageType* = enum - Id, Handshake, Move, Options, Draft, End, Rematch, Buy + Id, Handshake, Options, Draft, End, Rematch, Action var document* {.importc, nodecl.}: JsObject @@ -47,8 +47,6 @@ func messageType(data: cstring): MessageType = return Id elif "handshake:" in str: return Handshake - elif "move:" in str: - return Move elif "options:" in str: return Options elif "draft:" in str: @@ -57,8 +55,8 @@ func messageType(data: cstring): MessageType = return Rematch elif "end:" in str: return End - elif "buy:" in str: - return Buy + elif "action:" in str: + return Action func cutMessage(data: cstring): string = return split($data, ':')[1] diff --git a/src/power.nim b/src/power.nim index cfb5cd6..a44db5e 100644 --- a/src/power.nim +++ b/src/power.nim @@ -1,5 +1,5 @@ import piece -from std/sequtils import foldr, mapIt, filterIt +from std/sequtils import foldr, mapIt, filterIt, concat from std/algorithm import sortedByIt from std/random import randomize, rand @@ -8,6 +8,8 @@ type Common, Uncommon, Rare, UltraRare FilePath* = string + OnStart* = proc (drafterSide: Color, viewerSide: Color, b: var ChessBoard, s: var BoardState) + Power* = object name*: string technicalName*: string = "" @@ -18,7 +20,7 @@ type icon*: FilePath = "" rotatable*: bool = false noColor*: bool = false - onStart*: proc (drafterSide: Color, viewerSide: Color, b: var ChessBoard) + onStart*: OnStart index*: int = -1 priority*: int = 10 @@ -50,7 +52,7 @@ const emptyPower*: Power = Power( description: "This does nothing. Unlucky!", index: 0, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (_: Color, _: Color, _: var ChessBoard, _: var BoardState) = discard nil ) @@ -64,7 +66,7 @@ const holy*: Power = Power( icon: "cross.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (_: Color, _: Color, _: var ChessBoard, _: var BoardState) = discard nil ) @@ -122,14 +124,10 @@ proc secretSynergize(currentPowers: seq[Power], synergies: seq[Synergy]): seq[Po result = currentPowers for s in synergies.sortedByIt(it.power.priority): - if result.filterIt(it.name in s.requirements).len == 1 : - echo s.power.name if result.filterIt(it.name in s.requirements).len == s.requirements.len: if s.replacements.len == 0: - echo "hello?" result &= powers[s.index] else: - echo "hello?" result = result.filterIt(it.name != "Illegal Formation") & powers[s.index] proc seqOf(t: Tier): var seq[Power] = @@ -180,9 +178,19 @@ proc draftRandomPower*(allSelected: seq[Power], drafterSelected: seq[Power], opt for x in 0..options - 1: result.add(randomPower(randomTier(weights), drafterSelected, allSelected & result)) -proc executeOn*(drafts: seq[Power], draftSide: Color, mySide: Color, board: var ChessBoard) = - for d in drafts.secretSynergize(secretSynergies & secretSecretSynergies).sortedByIt(it.priority): - d.onStart(draftSide, mySide, board) +#assumes that there is no intersection between myDrafts and opponentDrafts +proc execute*(myDrafts: seq[Power], opponentDrafts: seq[Power], mySide: Color, board: var ChessBoard, state: var BoardState) = + for x in myDrafts: + assert x notin opponentDrafts, x.name & " is somehow in both pools" + + let mySynergizedDrafts = myDrafts.secretSynergize(secretSynergies & secretSecretSynergies) + let opponentSynergizedDrafts = opponentDrafts.secretSynergize(secretSynergies & secretSecretSynergies) + + for d in concat(mySynergizedDrafts, opponentSynergizedDrafts).sortedByIt(it.priority): + if d in mySynergizedDrafts: + d.onStart(mySide, mySide, board, state) + else: + d.onStart(otherSide(mySide), mySide, board, state) proc replaceAnySynergies*(powers: seq[Power]): seq[Power] = return powers.secretSynergize(secretSynergies) diff --git a/src/powers.nim b/src/powers.nim index df29a7e..8b95256 100644 --- a/src/powers.nim +++ b/src/powers.nim @@ -1,4 +1,5 @@ -import power, moves, piece, basePieces, extraMoves, board +import power, moves, piece, basePieces, extraMoves, board, capitalism +import std/options from sequtils import filterIt from random import sample, rand, randomize @@ -61,7 +62,7 @@ const empress*: Power = Power( description: "Your queen ascends, gaining the movement of a standard knight. ", icon: queenIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].takes &= @[knightTakes] @@ -69,14 +70,15 @@ const empress*: Power = Power( ) const altEmpress*: Power = Power( - name: "Alternative Empress", + name: "Empress", + technicalName: "Alternate Empress", tier: Uncommon, priority: 15, rarity: 4, #slightly less common, cuz description: "Your queen ascends, gaining the movement of a giraffe. ", icon: queenIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].takes &= @[giraffeTakes] @@ -84,7 +86,7 @@ const altEmpress*: Power = Power( ) -const silverGeneralPromote: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const silverGeneralPromote: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = piece.moves = piece.moves.filterIt(it != diagnalMoves) #new technology to remove specific moves, since I apparently piece.takes = piece.takes.filterIt(it != diagnalTakes) #didn't read the wikipedia article properly #also apparently shogi pieces can promote earlier, though I'll probably never add that @@ -99,9 +101,9 @@ const silverGeneralPromote: OnPiece = proc (piece: var Piece, board: var ChessBo piece.promoted = true piece.filePath = "promotedsilvergeneral.svg" -const silverGeneralPromoteConditions*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const silverGeneralPromoteConditions*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.isAtEnd() and not piece.promoted: - piece.promote(board) + piece.promote(board, state) const mysteriousSwordsmanLeft*: Power = Power( name: "Mysterious Swordsman", @@ -116,7 +118,7 @@ const mysteriousSwordsmanLeft*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][1].color == side if side == black: @@ -146,7 +148,7 @@ const mysteriousSwordsmanRight*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][6].color == side if side == black: @@ -172,15 +174,15 @@ const developed*: Power = Power( They can still move up 2 for their first move.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = #TODO: fix hard coded moves to prevent conflict. #fix would just stop move attempt if it would kill a piece if side == black: - b[1][3].pieceMove(2, 3, b) - b[1][4].pieceMove(2, 4, b) + b[1][3].pieceMove(2, 3, b, s) + b[1][4].pieceMove(2, 4, b, s) else: - b[6][3].pieceMove(5, 3, b) - b[6][4].pieceMove(5, 4, b) + b[6][3].pieceMove(5, 3, b, s) + b[6][4].pieceMove(5, 4, b, s) ) const stepOnMe*: Power = Power( @@ -191,7 +193,7 @@ const stepOnMe*: Power = Power( """Your Queen can take your own pieces. It's literally useless, but if that's your thing...""", icon: queenIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].takes &= @[cannibalBishopTakes, cannibalKingTakes, cannibalRookTakes] @@ -207,7 +209,7 @@ const illegalFormationRL: Power = Power( """ILLEGAL FORMATION: YOUR PAWN ABOVE YOUR LEFT ROOK SWAPS PLACES WITH YOUR LEFT ROOK""", icon: rookIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 0 else: 6 pieceSwap(b[rank][0], b[rank + 1][0], b) ) @@ -222,7 +224,7 @@ const illegalFormationRR: Power = Power( """ILLEGAL FORMATION: YOUR PAWN ABOVE YOUR RIGHT ROOK SWAPS PLACES WITH YOUR RIGHT ROOK""", icon: rookIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 0 else: 6 pieceSwap(b[rank][7], b[rank + 1][7], b) ) @@ -237,7 +239,7 @@ const illegalFormationBL*: Power = Power( """ILLEGAL FORMATION: YOUR PAWN ABOVE YOUR LEFT BISHOP SWAPS PLACES WITH YOUR LEFT BISHOP""", icon: bishopIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 0 else: 6 pieceSwap(b[rank][2], b[rank + 1][2], b) ) @@ -252,14 +254,14 @@ const illegalFormationBR: Power = Power( """ILLEGAL FORMATION: YOUR PAWN ABOVE YOUR RIGHT BISHOP SWAPS PLACES WITH YOUR RIGHT BISHOP""", icon: bishopIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 0 else: 6 pieceSwap(b[rank][5], b[rank + 1][5], b) ) -const putInTheWorkCondition: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const putInTheWorkCondition: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.piecesTaken == 3: - piece.promote(board) + piece.promote(board, state) #... #Just don't look at it and it's not that bad @@ -271,7 +273,7 @@ const putInTheWork*: Power = Power( """Get to work son. If any of your pawns take 3 pieces, they automatically promote.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): b[i][j].onEndTurn &= putInTheWorkCondition @@ -291,7 +293,7 @@ const wanderingRoninLeft*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][2].color == side if side == black: @@ -320,7 +322,7 @@ const wanderingRoninRight*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][5].color == side if side == black: @@ -337,11 +339,17 @@ const wanderingRoninRight*: Power = Power( ) -const werewolfPromoteConditions: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - if piece.piecesTaken >= 1 and not piece.rotate: - piece.moves &= @[knightMoves, giraffeMoves] - piece.takes &= @[knightTakes, giraffeTakes] - piece.rotate = true +#this is different than a normal promote, using clojure for transform state +#idk why, but now things are even more spaghetti +proc createWerewolf(): OnPiece = + var transformed = false + + result = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + if piece.piecesTaken >= 1 and not transformed: + piece.moves &= @[knightMoves, giraffeMoves] + piece.takes &= @[knightTakes, giraffeTakes] + piece.rotate = true + transformed = true const werewolves*: Power = Power( name: "Werewolves", @@ -351,10 +359,10 @@ const werewolves*: Power = Power( """Your leftmost and rightmost pawns are secretly werewolves! When they take a piece, they eat it and gain the ability to jump like a knight and giraffe. They do not promote.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 - b[rank][0].onEndTurn &= @[werewolfPromoteConditions] - b[rank][7].onEndTurn &= @[werewolfPromoteConditions] + b[rank][0].onEndTurn &= createWerewolf() + b[rank][7].onEndTurn &= createWerewolf() ) const archBishops: Power = Power( @@ -365,7 +373,7 @@ const archBishops: Power = Power( """Your bishops ascend to archbishops, gaining the movement of a knight.""", icon: bishopIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Bishop and b[i][j].isColor(side): b[i][j].moves &= knightMoves @@ -380,7 +388,7 @@ const giraffe*: Power = Power( """Your knights try riding giraffes. It works surprisingly well. Their leap is improved, moving 3 across instead of 2 across.""", icon: "giraffe.svg", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].isColor(side): assert b[i][j].color == side @@ -398,7 +406,7 @@ const calvary*: Power = Power( They can charge forward up to 2 tiles, but only to take a piece. They cannot jump for this move.""", icon: knightIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].isColor(side): if side == black: @@ -418,11 +426,11 @@ const anime*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewerSide: Color, b: var ChessBoard) = - mysteriousSwordsmanLeft.onStart(side, viewerSide, b) - mysteriousSwordsmanRight.onStart(side, viewerSide, b) - wanderingRoninLeft.onStart(side, viewerSide, b) - wanderingRoninRight.onStart(side, viewerSide, b) + proc (side: Color, viewerSide: Color, b: var ChessBoard, s: var BoardState) = + mysteriousSwordsmanLeft.onStart(side, viewerSide, b, s) + mysteriousSwordsmanRight.onStart(side, viewerSide, b, s) + wanderingRoninLeft.onStart(side, viewerSide, b, s) + wanderingRoninRight.onStart(side, viewerSide, b, s) ) const samuraiSynergy: Synergy = ( @@ -439,7 +447,7 @@ const masochistEmpressPower: Power = Power( rarity: 0, priority: 15, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].takes.add(cannibalKnightTakes) @@ -460,7 +468,7 @@ const masochistAltEmpressPower: Power = Power( rarity: 0, priority: 15, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].takes.add(cannibalGiraffeTakes) @@ -475,15 +483,16 @@ const masochistAltEmpress: Synergy = ( index: -1 ) -const sacrificeWhenTaken*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - if (taken.tile == taker.tile): - for i, j in board.rankAndFile: - if board[i][j].sameColor(taken) and not board[i][j].promoted: - board[i][j].promote(board) - board[taken.tile.rank][taken.tile.file] = Piece(item: None, tile: taken.tile) - return (taken.tile, false) - else: - return defaultWhenTaken(taken, taker, board) +const sacrificeWhenTaken*: WhenTaken = + proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = + if (taken.tile == taker.tile): + for i, j in board.rankAndFile: + if board[i][j].sameColor(taken) and not board[i][j].promoted: + board[i][j].promote(board, state) + board[taken.tile] = air.pieceCopy(index = taken.index, tile = taken.tile) + return (taken.tile, false) + else: + return defaultWhenTaken(taken, taker, board, state) const sacrifice*: Power = Power( @@ -494,25 +503,26 @@ const sacrifice*: Power = Power( description: """SACRIFICE THY MAIDENS TO THE BLOOD GOD""", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].whenTaken = sacrificeWhenTaken b[i][j].takes &= takeSelf ) -const sacrificeWhenTakenEmpress*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - if (taken.tile == taker.tile): - for i, j in board.rankAndFile: - if board[i][j].sameColor(taken): - board[i][j].promote(board) - board[i][j].moves &= knightMoves - board[i][j].takes &= knightTakes +const sacrificeWhenTakenEmpress*: WhenTaken = + proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = + if (taken.tile == taker.tile): + for i, j in board.rankAndFile: + if board[i][j].sameColor(taken): + board[i][j].promote(board, state) + board[i][j].moves &= knightMoves + board[i][j].takes &= knightTakes - taken = air.pieceCopy(tile = taken.tile) - return (taken.tile, true) - else: - return defaultWhenTaken(taken, taker, board) + taken = air.pieceCopy(index = taken.index, tile = taken.tile) + return (taken.tile, true) + else: + return defaultWhenTaken(taken, taker, board, state) const exodiaPower: Power = Power( @@ -523,7 +533,7 @@ const exodiaPower: Power = Power( description: "You had your fun, but the game is over. Too bad right?", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].whenTaken = sacrificeWhenTakenEmpress @@ -538,18 +548,19 @@ const exodia: Synergy = ( index: -1 ) -const sacrificeWhenTakenAltEmpress*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - if (taken.tile == taker.tile): - for i, j in board.rankAndFile: - if board[i][j].sameColor(taken): - board[i][j].promote(board) - board[i][j].moves &= giraffeMoves - board[i][j].takes &= giraffeTakes +const sacrificeWhenTakenAltEmpress*: WhenTaken = + proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = + if (taken.tile == taker.tile): + for i, j in board.rankAndFile: + if board[i][j].sameColor(taken): + board[i][j].promote(board, state) + board[i][j].moves &= giraffeMoves + board[i][j].takes &= giraffeTakes - taken = air.pieceCopy(tile = taken.tile) - return (taken.tile, true) - else: - return defaultWhenTaken(taken, taker, board) + taken = air.pieceCopy(index = taken.index, tile = taken.tile) + return (taken.tile, true) + else: + return defaultWhenTaken(taken, taker, board, state) const altExodiaPower: Power = Power( @@ -560,7 +571,7 @@ const altExodiaPower: Power = Power( description: "You had your fun, but the game is over. Too bad right?", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].whenTaken = sacrificeWhenTakenAltEmpress @@ -582,7 +593,7 @@ const backStep*: Power = Power( description: "Your pawns receive some training. They can move one tile back. They cannot take this way.", icon: pawnIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): if b[i][j].color == black: @@ -598,7 +609,7 @@ const headStart*: Power = Power( description: "Your pawns can always move 2 forward. They still take like normal. It's kind of boring, don't you think?", icon: pawnIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): if b[i][j].color == black: @@ -614,10 +625,10 @@ const queenTrade*: Power = Power( description: "The patriarchy continues. Both queens mysteriously die.", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Queen: - b[i][j] = Piece(item: None, tile: b[i][j].tile) + b[i][j] = air.pieceCopy(index = b[i][j].index, tile = b[i][j].tile) ) const superPawnPower: Power = Power( @@ -628,10 +639,10 @@ const superPawnPower: Power = Power( description: "You have insane pawns. Please don't sacrifice them.", icon: pawnIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = - headStart.onStart(side, viewSide, b) - backStep.onStart(side, viewSide, b) - putInTheWork.onStart(side, viewSide, b) + proc (side: Color, viewSide: Color, b: var ChessBoard, state: var BoardState) = + headStart.onStart(side, viewSide, b, state) + backStep.onStart(side, viewSide, b, state) + putInTheWork.onStart(side, viewSide, b, state) for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): if b[i][j].color == black: @@ -657,13 +668,14 @@ const lesbianPride*: Power = Power( icon: "lesbianprideflag.svg", noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): - b[i][j] = whiteQueen.pieceCopy(color = b[i][j].color, item = King, tile = b[i][j].tile, rotate = true, filePath = queenIcon, wallet = b[i][j].wallet) + b[i][j] = whiteQueen.pieceCopy(index = b[i][j].index, + color = b[i][j].color, item = King, tile = b[i][j].tile, rotate = true, filePath = queenIcon) #`Piece.item` is still king so win/loss works. `Piece.rotate` = true should hopefully suggest this elif b[i][j].item == Bishop and b[i][j].isColor(side): - b[i][j] = Piece(item: None, tile: b[i][j].tile) + b[i][j] = air.pieceCopy(index = b[i][j].index, tile = b[i][j].tile) ) const queensWrathPower: Power = Power( @@ -674,10 +686,10 @@ const queensWrathPower: Power = Power( description: "Why must she die?", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item != Queen and b[i][j].isColor(side): - b[i][j] = Piece(item: None, tile: b[i][j].tile) + b[i][j] = air.pieceCopy(index = b[i][j].index, tile = b[i][j].tile) elif b[i][j].item == Queen and b[i][j].isColor(side): b[i][j].moves &= @[knightMoves, giraffeMoves] b[i][j].takes &= @[knightTakes, giraffeTakes] @@ -696,16 +708,16 @@ const queensWrathSuperPower: Power = Power( They will suffer. They will suffer. They will suffer. They will suffer.""", icon: queenIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item != Queen and b[i][j].isColor(side): - b[i][j] = Piece(item: None, tile: b[i][j].tile) + b[i][j] =air.pieceCopy(index = b[i][j].index, tile = b[i][j].tile) elif b[i][j].item == Queen and b[i][j].isColor(side): - b[i][j].moves &= @[knightMoves, giraffeMoves] - b[i][j].takes &= @[knightTakes, giraffeTakes] + b[i][j].moves &= @[knightMoves, giraffeMoves, whiteForwardTwiceJumpMove, blackForwardTwiceJumpMove] + b[i][j].takes &= @[knightTakes, giraffeTakes, whiteForwardTwiceJumpTake, blackForwardTwiceJumpTake] b[i][j].item = King elif b[i][j].item == Bishop and not b[i][j].isColor(side): - b[i][j] = Piece(item: None, tile: b[i][j].tile) + b[i][j] = air.pieceCopy(index = b[i][j].index, tile = b[i][j].tile) ) const queensWrath: Synergy = ( @@ -740,12 +752,12 @@ const knightChargePower*: Power = Power( description: "CHARGE! Your knights start 3 tiles ahead.", icon: knightIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, s: var BoardState) = let offset = if side == white: -3 else: 3 for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].isColor(side) and b[i][j].timesMoved == 0: inc b[i][j].timesMoved - b[i][j].pieceMove(i + offset, j, b) + b[i][j].pieceMove(i + offset, j, b, s) ) const calvaryCharge: Synergy = ( @@ -764,13 +776,13 @@ const battleFormationPower: Power = Power( description: "Real Estate is going crazy with how developed the board is.", icon: knightIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, s: var BoardState) = if side == black: - b[1][3].pieceMove(3, 3, b) - b[1][4].pieceMove(3, 4, b) + b[1][3].pieceMove(3, 3, b, s) + b[1][4].pieceMove(3, 4, b, s) else: - b[6][3].pieceMove(4, 3, b) - b[6][4].pieceMove(4, 4, b) + b[6][3].pieceMove(4, 3, b, s) + b[6][4].pieceMove(4, 4, b, s) ) const battleFormation: Synergy = ( @@ -789,11 +801,11 @@ const differentGamePower*: Power = Power( description: "I guess the rules didn't get to you. Your pawns above both knights and both rooks swap places with those pieces.", icon: pawnIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = - illegalFormationBL.onStart(side, viewSide, b) - illegalFormationBR.onStart(side, viewSide, b) - illegalFormationRL.onStart(side, viewSide, b) - illegalFormationRR.onStart(side, viewSide, b) + proc (side: Color, viewSide: Color, b: var ChessBoard, state: var BoardState) = + illegalFormationBL.onStart(side, viewSide, b, state) + illegalFormationBR.onStart(side, viewSide, b, state) + illegalFormationRL.onStart(side, viewSide, b, state) + illegalFormationRR.onStart(side, viewSide, b, state) ) const differentGame: Synergy = ( @@ -812,7 +824,7 @@ const lineBackersPower: Power = Power( description: "Your pawns learn to fight like men. They can take one spaces ahead too.", icon: pawnIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): if b[i][j].color == black: @@ -837,7 +849,7 @@ const nightRider: Power = Power( description: "Nightrider.", icon: "nightrider.svg", onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].isColor(side): b[i][j].moves &= nightriderMoves @@ -853,7 +865,7 @@ const desegregation: Power = Power( description: "Your bishops learn to accept their differences. They can move left and right.", icon: bishopIcon, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Bishop and b[i][j].isColor(side): b[i][j].moves &= leftRightMoves @@ -868,7 +880,7 @@ const holyBishopPower*: Power = Power( icon: "cross.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Bishop and b[i][j].isColor(side): b[i][j].moves &= @[knightMoves, blackForwardTwiceJumpMove, whiteForwardTwiceJumpMove] @@ -884,24 +896,25 @@ const holyBishop: Synergy = ( index: -1 ) -const concubineWhenTake = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = - if taker.item == King and - taken.item == Rook and - taken.sameColor(taker) and - taker.timesMoved == 0 and - taken.timesMoved == 0: - taken.promote(board) - let kingTile = taker.tile - if taken.tile.file == 0: - taker.pieceMove(kingTile.rank, kingTile.file - 2, board) - taken.pieceMove(kingTile.rank, kingTile.file - 1, board) - return ((kingTile.file - 1, kingTile.rank), false) - else: - taker.pieceMove(kingTile.rank, kingTile.file + 2, board) - taken.pieceMove(kingTile.rank, kingTile.file + 1, board) - return ((kingTile.file + 1, kingTile.rank), false) - else: - return defaultWhenTaken(taken, taker, board) +const concubineWhenTake = + proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = + if taker.item == King and + taken.item == Rook and + taken.sameColor(taker) and + taker.timesMoved == 0 and + taken.timesMoved == 0: + taken.promote(board, state) + let kingTile = taker.tile + if taken.tile.file == 0: + taker.pieceMove(kingTile.rank, kingTile.file - 2, board, state) + taken.pieceMove(kingTile.rank, kingTile.file - 1, board, state) + return ((kingTile.file - 1, kingTile.rank), false) + else: + taker.pieceMove(kingTile.rank, kingTile.file + 2, board, state) + taken.pieceMove(kingTile.rank, kingTile.file + 1, board, state) + return ((kingTile.file + 1, kingTile.rank), false) + else: + return defaultWhenTaken(taken, taker, board, state) const concubine*: Power = Power( name: "Concubine", @@ -910,16 +923,23 @@ const concubine*: Power = Power( description: "Your rook becomes a queen when it castles.... You're sick.", icon: rookIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - var dna: Piece = if side == white: whiteQueen.pieceCopy() else: blackQueen.pieceCopy() + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + var dna: Piece = + if side == white: whiteQueen.pieceCopy(index = 0) #index not needed because we just use original rooks index + else: blackQueen.pieceCopy(index = 0) for i, j in b.rankAndFile: if b[i][j].item == Queen and b[i][j].isColor(side): dna = b[i][j] break - let concubinePromote: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - piece = dna.pieceCopy(piecesTaken = piece.piecesTaken, tile = piece.tile, promoted = true, wallet = piece.wallet) + let concubinePromote: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + piece = dna.pieceCopy( + index = piece.index, + piecesTaken = piece.piecesTaken, + timesMoved = piece.timesMoved, + tile = piece.tile, + promoted = true) for i, j in b.rankAndFile: if b[i][j].item == Rook and b[i][j].isColor(side): @@ -934,23 +954,25 @@ const reinforcements*: Power = Power( description: "Do you really need more than 8 pawns? Your rooks spawn a pawn for every 2 pieces they takes.", icon: rookIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - var dna: Piece = if side == white: whitePawn.pieceCopy() else: blackPawn.pieceCopy() + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = + var dna: Piece = + if side == white: whitePawn.pieceCopy(index = 0) #index is assigned when piece is created, so default now + else: blackPawn.pieceCopy(index = 0) for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): dna = b[i][j] break - let reinforcementsOntake: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard) = - let takeResults = to.takenBy(piece, board) + let reinforcementsOntake: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard, state: var BoardState) = + let takeResults = to.takenBy(piece, board,state) let originalRookTile = piece.tile - board[takeResults.endTile.rank][takeResults.endTile.file].timesMoved += 1 + board[takeResults.endTile].timesMoved += 1 if takeResults.takeSuccess: - board[takeResults.endTile.rank][takeResults.endTile.file].piecesTaken += 1 - if board[takeResults.endTile.rank][takeResults.endTile.file].piecesTaken mod 2 == 0: - board[originalRookTile.rank][originalRookTile.file] = dna.pieceCopy(tile = originalRookTile, wallet = piece.wallet) + board[takeResults.endTile].piecesTaken += 1 + if board[takeResults.endTile].piecesTaken mod 2 == 0: + board[originalRookTile.rank][originalRookTile.file] = dna.pieceCopy(index = newIndex(state), tile = originalRookTile) for i, j in b.rankAndFile: if b[i][j].item == Rook and b[i][j].isColor(side): @@ -958,17 +980,17 @@ const reinforcements*: Power = Power( ) -const shotgunKingOnTake*: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard) = +const shotgunKingOnTake*: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard, state: var BoardState) = let originalKingTile = piece.tile - let takeResult = to.takenBy(piece, board) + let takeResult = to.takenBy(piece, board, state) piece.timesMoved += 1 if takeResult.takeSuccess: piece.piecesTaken += 1 if (originalKingTile.rank + 2 == takeResult.endTile.rank): - takeResult.endTile.pieceMove(originalKingTile, board) + takeResult.endTile.pieceMove(originalKingTile, board, state) elif (originalKingTile.rank - 2 == takeResult.endTile.rank): - takeResult.endTile.pieceMove(originalKingTile, board) + takeResult.endTile.pieceMove(originalKingTile, board, state) const shotgunKing*: Power = Power( name: "Shotgun King", @@ -978,7 +1000,7 @@ const shotgunKing*: Power = Power( If it does this take, it does not move from its initial tile.""", icon: kingIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): assert b[i][j].color == side @@ -986,12 +1008,12 @@ const shotgunKing*: Power = Power( b[i][j].takes &= @[blackForwardTwiceJumpTake, whiteForwardTwiceJumpTake] ) -const bountyHunterOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const bountyHunterOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.piecesTaken == 3: for i, j in board.rankAndFile: #searches for enemy king and deletes is if board[i][j].item == King and not board[i][j].sameColor(piece): - board[i][j] = Piece(item: None, tile: board[i][j].tile) + board[i][j] = air.pieceCopy(index = board[i][j].index, tile = board[i][j].tile) const bountyHunterPower*: Power = Power( name: "Bounty Hunter", @@ -1001,7 +1023,7 @@ const bountyHunterPower*: Power = Power( description: "It's hard to make a living these days. If your king takes 3 pieces, you automatically win.", icon: kingIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): b[i][j].onEndTurn &= bountyHunterOnEndTurn @@ -1022,7 +1044,7 @@ const coward: Power = Power( description: "You coward. Your king swaps pieces with the king's side knight.", icon: kingIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): if b[i][j].timesMoved == 0: @@ -1030,12 +1052,12 @@ const coward: Power = Power( pieceSwap(b[i][j], b[i][j + 2], b) ) -const bombardOnTake*: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard) = +const bombardOnTake*: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard, state: var BoardState) = let originalTile = piece.tile - let takeResult = rookWhenTaken(piece, board[to.rank][to.file], board) + let takeResult = rookWhenTaken(piece, board[to.rank][to.file], board, state) if takeResult.takeSuccess: if ((originalTile.rank - takeResult.endTile.rank != 0) and (originalTile.file - takeResult.endTile.file) != 0): - takeResult.endTile.pieceMove(originalTile, board) + takeResult.endTile.pieceMove(originalTile, board, state) const bombard: Power = Power( name: "Bombard", @@ -1044,7 +1066,7 @@ const bombard: Power = Power( description: "Your rooks get upgraded with some new cannons. They can shoot up to two tiles diagnal in each direction.", icon: "bombard.svg", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Rook and b[i][j].isColor(side): b[i][j].takes &= rookBombard @@ -1059,38 +1081,40 @@ const bombardWithReinforcements: Power = Power( description: "Your rooks get upgraded with some new cannons. They can shoot up to two tiles diangal in each direction.", icon: "bombard.svg", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - var dna: Piece = if side == white: whitePawn.pieceCopy() else: blackPawn.pieceCopy() + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = + var dna: Piece = + if side == white: whitePawn.pieceCopy(index = 0) + else: blackPawn.pieceCopy(index = 0) for i, j in b.rankAndFile: if b[i][j].item == Rook and b[i][j].isColor(side): dna = b[i][j] break - let reinforcementsOntake: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard) = - let takeResults = to.takenBy(piece, board) + let reinforcementsOntake: OnAction = proc (piece: var Piece, to: Tile, board: var ChessBoard, state: var BoardState) = + let takeResults = to.takenBy(piece, board, state) let originalRookTile = piece.tile - board[takeResults.endTile.rank][takeResults.endTile.file].timesMoved += 1 + board[takeResults.endTile].timesMoved += 1 if takeResults.takeSuccess: - board[takeResults.endTile.rank][takeResults.endTile.file].piecesTaken += 1 - if board[takeResults.endTile.rank][takeResults.endTile.file].piecesTaken mod 2 == 0: - board[originalRookTile.rank][originalRookTile.file] = dna.pieceCopy(tile = originalRookTile, wallet = piece.wallet) + board[takeResults.endTile].piecesTaken += 1 + if board[takeResults.endTile].piecesTaken mod 2 == 0: + board[originalRookTile.rank][originalRookTile.file] = dna.pieceCopy(index = newIndex(state), tile = originalRookTile) for i, j in b.rankAndFile: if b[i][j].item == Rook and b[i][j].isColor(side): b[i][j].onTake = reinforcementsOntake ) -const lancePromote*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const lancePromote*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = piece.moves = @[leftRightMoves, diagnalMoves, blackForwardMoves, whiteForwardMoves] piece.takes = @[leftRightTakes, diagnalTakes, blackForwardTakes, whiteForwardTakes] piece.promoted = true piece.filePath = "promotedlance.svg" -const lancePromoteConditions*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const lancePromoteConditions*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.isAtEnd() and not piece.promoted: - piece.promote(board) + piece.promote(board, state) const lanceRight*: Power = Power( name: "Kamikaze", @@ -1105,7 +1129,7 @@ const lanceRight*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][0].color == side if side == black: @@ -1135,7 +1159,7 @@ const lanceLeft*: Power = Power( rotatable: true, noColor: true, onStart: - proc (side: Color, viewSide: Color, b: var ChessBoard) = + proc (side: Color, viewSide: Color, b: var ChessBoard, _: var BoardState) = let rank = if side == black: 1 else: 6 assert b[rank][7].color == side if side == black: @@ -1153,14 +1177,14 @@ const lanceLeft*: Power = Power( ) -const drunkOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - if not piece.rand.drunk: - piece.rand.drunk = true #after move, piece is different, so we drunk now +const drunkOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + if not piece.drunk: + piece.drunk = true #after move, piece is different, so we drunk now #random seed is linked to location and `Piece.rand.seed`, which is made from id #this ensures that both sides generate same move, even though they do it seperately #it would be ideal to just send move over, but it's too late to add such a system #also maybe research if the location *10 *100 is nesscary - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let takes = piece.getTakesOn(board) let moves = piece.getMovesOn(board) if len(moves) == 0: return # I don't really like how this looks @@ -1170,16 +1194,16 @@ const drunkOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard) #it prioritizes takes to avoid potentially moving into another piece if attempt in moves: - piece.move(attempt, board) + piece.move(attempt, board, state) -const drunkVirus*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - if not piece.rand.drunk: - piece.rand.drunk = true #after move, piece is different, so we drunk now +const drunkVirus*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + if not piece.drunk: + piece.drunk = true #after move, piece is different, so we drunk now #random seed is linked to location and `Piece.rand.seed`, which is made from id #this ensures that both sides generate same move, even though they do it seperately #it would be ideal to just send move over, but it's too late to add such a system #also maybe research if the location *10 *100 is nesscary - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let takes = piece.getTakesOn(board) let moves = piece.getMovesOn(board) if len(moves & takes) == 0: return # I don't really like how this looks @@ -1189,9 +1213,9 @@ const drunkVirus*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = #it prioritizes takes to avoid potentially moving into another piece if randomAction in takes: - piece.take(randomAction, board) + piece.take(randomAction, board, state) elif randomAction in moves: - piece.move(randomAction, board) + piece.move(randomAction, board, state) const drunkKnights: Power = Power( name: "Drunk Knights", @@ -1202,7 +1226,7 @@ const drunkKnights: Power = Power( After every other turn, they randomly move.""", icon: knightIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].isColor(side): b[i][j].onEndTurn &= drunkOnEndTurn @@ -1216,7 +1240,7 @@ const alcoholism*: Power = Power( description: """You're families and friends miss you. The real you.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].isColor(side): b[i][j].onEndTurn &= drunkOnEndTurn @@ -1231,7 +1255,7 @@ const virusPower*: Power = Power( rarity: 0, icon: "", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].isColor(side): b[i][j].onEndTurn &= drunkVirus @@ -1297,10 +1321,10 @@ const virus7: Synergy = ( ) #moves for civilian are put here so that it can't be moved normally -const randomCivilianEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - if not piece.rand.drunk: - piece.rand.drunk = true - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) +const randomCivilianEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + if not piece.drunk: + piece.drunk = true + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) piece.moves &= kingMoves let moves = kingMoves(board, piece) @@ -1308,10 +1332,10 @@ const randomCivilianEndTurn*: OnPiece = proc (piece: var Piece, board: var Chess var attempt = moves.filterIt(it notin takes) #remove takes to prevent conflict if attempt.len == 0: return - else: piece.move(attempt.sample(), board) + else: piece.move(attempt.sample(), board, state) #TODO: SEE IF I CAN KILL THE PIECE WHEN THIS HAPPENS. WHY CAPS LOCK -const attemptedWarCrimes*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard): tuple[endTile: Tile, takeSuccess: bool] = +const attemptedWarCrimes*: WhenTaken = proc (taken: var Piece, taker: var Piece, board: var ChessBoard, state: var BoardState): tuple[endTile: Tile, takeSuccess: bool] = return (taker.tile, false) const civilians*: Power = Power( @@ -1322,8 +1346,8 @@ const civilians*: Power = Power( 3 civillians spawn on the enemy side. They randomly move and cannot be taken.""", icon: "civilian.svg", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - randomize(b[0][0].rand.seed)#dirty way to pass in random seed + proc (side: Color, _: Color, b: var ChessBoard, state: var BoardState) = + randomize(state.shared.randSeed) let rank: int = if side == black: 5 else: 2 let commoner = Piece(item: Fairy, color: side, moves: @[kingMoves], takes: @[], onMove: defaultOnMove, onTake: defaultOnTake, whenTaken: attemptedWarCrimes, onEndTurn: @[randomCivilianEndTurn], onPromote: @[defaultOnEndTurn], @@ -1335,7 +1359,7 @@ const civilians*: Power = Power( while spawns != 3 and failSafe != 0: if b[rank][attempt].isAir: let tile = b[rank][attempt].tile - b[rank][attempt] = commoner.pieceCopy(tile = tile) + b[rank][attempt] = commoner.pieceCopy(index = newIndex(state), tile = tile) inc spawns else: dec failSafe @@ -1352,14 +1376,14 @@ const calvaryGiraffePower: Power = Power( so I'm making the giraffes start one tile back. Sorry.""", icon: "giraffe.svg", onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Knight and b[i][j].iscolor(side) and b[i][j].timesMoved == 1: # `== 1` because it was already incremented in knightCharge. Prevents double activation let back = if side == black: -1 else: 1 inc b[i][j].timesMoved - b[i][j].pieceMove(b[i][j].tile.rank + back, b[i][j].tile.file, b) + b[i][j].pieceMove(b[i][j].tile.rank + back, b[i][j].tile.file, b, s) ) @@ -1371,12 +1395,12 @@ const calvaryGiraffe: Synergy = ( index: -1 ) -const lesbianBountyHunterOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const lesbianBountyHunterOnEndTurn*: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.piecesTaken == 7: for i, j in board.rankAndFile: #searches for enemy king and deletes is if board[i][j].item == King and not board[i][j].sameColor(piece): - board[i][j] = Piece(item: None, tile: board[i][j].tile) + board[i][j] = air.pieceCopy(index = board[i][j].index, tile = board[i][j].tile) const lesbianBountyHunterPower*: Power = Power( name: "Bounty Hunter Nerf", @@ -1386,7 +1410,7 @@ const lesbianBountyHunterPower*: Power = Power( description: "Yeah, 3 pieces is way too easy for our lesbian queens, so now it's 7 pieces. You got this!", icon: kingIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): b[i][j].onEndTurn &= lesbianBountyHunterOnEndTurn @@ -1407,12 +1431,12 @@ proc createLottery(): OnPiece = #to better modularize the power's state, I think #`Piece.rand` powers can't do this because it needs the seed, and a global clear of drunkenness #which has to happen after all `Piece.onEndTurn` stuff, not during - result = proc (piece: var Piece, board: var ChessBoard) = + result = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.timesMoved != lastTimesMoved: - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let ticket = rand(100) - if ticket == 42 or ticket == 17: #arbitrary - piece.promote(board) + if ticket == 42: #arbitrary + piece.promote(board, state) lastTimesMoved = piece.timesMoved @@ -1421,18 +1445,18 @@ const slumdogMillionaire*: Power = Power( tier: Common, priority: 15, description: """Have you seen the movie Slumdog Millionaire? It's kind of like that. - Your pawns have a 2% chance of promoting whenever they move.""", + Your pawns have a 1% chance of promoting whenever they move.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): b[i][j].onEndTurn &= createLottery() ) -const stupidOnEndTurn: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) +const stupidOnEndTurn: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let ticket = rand(1000) if ticket == 42: #arbitrary for i, j in board.rankAndFile: @@ -1447,24 +1471,25 @@ const stupidPower*: Power = Power( description: """You have a 0.1% chance to automatically win each turn. Yeah, I'm out of ideas. I'm sorry.""", icon: kingIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == King and b[i][j].isColor(side): b[i][j].onEndTurn &= stupidOnEndTurn ) -const convertingTake: OnAction = proc (piece: var Piece, taking: Tile, board: var ChessBoard) = - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) +const convertingTake: OnAction = proc (piece: var Piece, taking: Tile, board: var ChessBoard, state: var BoardState) = + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let dice = rand(20) inc piece.timesMoved if dice <= 3: #creates odds of 3/20 or 15% - board[taking.rank][taking.file].color = piece.color - pieceSwap(piece, board[taking.rank][taking.file], board) + board[taking].color = piece.color + board[taking].index = newIndex(state) + pieceSwap(piece, board[taking], board) else: - let takeResult = taking.takenBy(piece, board) + let takeResult = taking.takenBy(piece, board, state) if takeResult.takeSuccess: - board[takeResult.endTile.rank][takeResult.endTile.file].piecesTaken += 1 + board[takeResult.endTile].piecesTaken += 1 const conversion: Power = Power( name: "Conversion", @@ -1474,24 +1499,25 @@ const conversion: Power = Power( When this happens, your bishop swaps places with it instead of taking it.""", icon: bishopIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Bishop and b[i][j].isColor(side): b[i][j].onTake = convertingTake ) -const holyConvertingTake: OnAction = proc (piece: var Piece, taking: Tile, board: var ChessBoard) = - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) +const holyConvertingTake: OnAction = proc (piece: var Piece, taking: Tile, board: var ChessBoard, state: var BoardState) = + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let dice = rand(20) inc piece.timesMoved if dice <= 6: #creates odds of 6/20 or 30% - board[taking.rank][taking.file].color = piece.color - pieceSwap(piece, board[taking.rank][taking.file], board) + board[taking].color = piece.color + board[taking].index = newIndex(state) + pieceSwap(piece, board[taking], board) else: - let takeResult = taking.takenBy(piece, board) + let takeResult = taking.takenBy(piece, board, state) if takeResult.takeSuccess: - board[takeResult.endTile.rank][takeResult.endTile.file].piecesTaken += 1 + board[takeResult.endTile].piecesTaken += 1 const holyConversionPower: Power = Power( name: "God's Disciple", @@ -1501,7 +1527,7 @@ const holyConversionPower: Power = Power( When this happens, your bishop swaps places with it instead of taking it.""", icon: bishopIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Bishop and b[i][j].isColor(side): b[i][j].onTake = holyConvertingTake @@ -1517,10 +1543,10 @@ const holyConversion: Synergy = ( #since end turn stuff now runs at the end of every turn, we have new #tech like global powers -const killPromoted: OnPiece = proc (piece: var Piece, board: var ChessBoard) = +const killPromoted: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = for i, j in board.rankAndFile: if board[i][j].promoted: - board[i][j] = air.pieceCopy(tile = board[i][j].tile) + board[i][j] = air.pieceCopy(index = newIndex(state), tile = board[i][j].tile) const americanDream: Power = Power( name: "American Dream", @@ -1530,7 +1556,7 @@ const americanDream: Power = Power( icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: #added to the king so that it stops when the game ends if b[i][j].item == King and b[i][j].isColor(side): @@ -1545,9 +1571,9 @@ const sleeperAgent*: Power = Power( One of your pawns is a sleeper agent. They can take forward.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - randomize(b[0][0].rand.seed) - var sleeper = rand(b.len) + proc (side: Color, _: Color, b: var ChessBoard, state: var BoardState) = + randomize(state.shared.randSeed) + var sleeper = rand(b.len - 1) #I don't know why I don't just hardcode it var failsafe = b.len + 1 let rank = if side == black: 1 else: 6 @@ -1568,12 +1594,12 @@ const sleeperAgent*: Power = Power( ) -const promoteBuying: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - piece.promote(board) +const promoteBuying: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + piece.promote(board, state) piece.promoted = true -const promoteBuyingCondition: BuyCondition = func (piece: Piece, board: ChessBoard): bool = - return not piece.promoted +const promoteBuyingCondition: BuyCondition = func (piece: Piece, board: ChessBoard, s: BoardState): bool = + return not piece.promoted and piece.onPromote != @[defaultOnEndTurn] #this is attatched to the King, which tracks all piecesTaken #I originally had it on each piece, but then I would have to add it to each new piece @@ -1582,19 +1608,17 @@ proc moneyForTake(): OnPiece = #closure is used to hold state #this is preferable when state does not need to interact with the rest of the game's systems #to better modularize the power's state, I think - result = proc (piece: var Piece, b: var ChessBoard) = + result = proc (piece: var Piece, b: var ChessBoard, state: var BoardState) = var allPiecesTaken = 0 for i, j in b.rankAndFile: if b[i][j].sameColor(piece): allPiecesTaken += b[i][j].piecesTaken if allPiecesTaken > lastPiecesTaken: - for i, j in b.rankAndFile: - if b[i][j].item == King and b[i][j].sameColor(piece): - b[i][j].wallet.money += 3 * (allPiecesTaken - lastPiecesTaken) + addMoney(piece.color, 3, state) lastPiecesTaken = allPiecesTaken -const capitalism*: Power = Power( +const capitalismPower*: Power = Power( name: "Capitalism", tier: Uncommon, rarity: 24, @@ -1602,34 +1626,32 @@ const capitalism*: Power = Power( description: """The power of the free market is unmatched. All of your pieces get the ability to buy upgrades. You get 3 dollars for taking a piece. - With 21 dollars, you can promote one piece.""", + With 30 dollars, you can promote one piece.""", icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + s.side[side].buys &= (name: "Promote", cost: alwaysCost(30), action: promoteBuying, condition: promoteBuyingCondition) + side.initWallet(s) for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].onPromote != @[defaultOnEndTurn]: #only if it can promote - b[i][j].wallet.options &= (name: "Promote", cost: 21, action: promoteBuying, condition: promoteBuyingCondition) - b[i][j].wallet.money = 0 #activates wallet by changing from -1 - if b[i][j].item == King: - b[i][j].onEndTurn &= moneyForTake() + if b[i][j].item == King and b[i][j].color == side: + b[i][j].onEndTurn &= moneyForTake() ) -const whiteMoveUp: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - piece.move(tileAbove(piece.tile), board) - board[piece.tile.tileAbove.rank][piece.tile.file].endTurn(board) #piece changes after move, so we onEndTurn on where it should be +const whiteMoveUp: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + piece.move(tileAbove(piece.tile), board, state) + board[piece.tile.tileAbove.rank][piece.tile.file].endTurn(board, state) #piece changes after move, so we onEndTurn on where it should be -const whiteMoveUpCondition: BuyCondition = func (piece: Piece, board: ChessBoard): bool = +const whiteMoveUpCondition: BuyCondition = func (piece: Piece, board: ChessBoard, s: BoardState): bool = return piece.tile.rank != 0 and board[piece.tile.tileAbove.rank][piece.tile.file].isAir -const blackMoveUp: OnPiece = proc (piece: var Piece, board: var ChessBoard) = - piece.move(tileBelow(piece.tile), board) - board[piece.tile.tileBelow.rank][piece.tile.file].endTurn(board) #piece changes after move, so we onEndTurn on where it should be +const blackMoveUp: OnPiece = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = + piece.move(tileBelow(piece.tile), board, state) + board[piece.tile.tileBelow.rank][piece.tile.file].endTurn(board, state) #piece changes after move, so we onEndTurn on where it should be -const blackMoveUpCondition: BuyCondition = func (piece: Piece, board: ChessBoard): bool = +const blackMoveUpCondition: BuyCondition = func (piece: Piece, board: ChessBoard, s: BoardState): bool = return piece.tile.rank != 7 and board[piece.tile.tileBelow.rank][piece.tile.file].isAir const moveUp*: Power = Power( @@ -1638,23 +1660,21 @@ const moveUp*: Power = Power( tier: Common, rarity: 0, priority: 15, - description: """Money is pretty neat right? You can spend 5 dollars to move a piece one tile forward. It cannot take with this action.""", + description: """Money is pretty neat right? You can spend 8 dollars to move a piece one tile forward. It cannot take with this action.""", icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].color == white: - b[i][j].wallet.options &= (name: "Move Up", cost: 5, action: whiteMoveUp, condition: whiteMoveUpCondition) - else: - b[i][j].wallet.options &= (name: "Move Up", cost: 5, action: blackMoveUp, condition: blackMoveUpCondition) + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + if side == black: + s.side[side].buys &= (name: "Move Up", cost: alwaysCost(7), action: blackMoveUp, condition: blackMoveUpCondition) + else: + s.side[side].buys &= (name: "Move Up", cost: alwaysCost(7), action: whiteMoveUp, condition: whiteMoveUpCondition) ) const capitalismTwo1: Synergy = ( power: moveUp, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) @@ -1672,23 +1692,21 @@ const moveBack*: Power = Power( tier: Common, rarity: 0, priority: 15, - description: """Money is pretty neat right? You can spend 4 dollars to move a piece one tile backwards. It cannot take with this action.""", + description: """Money is pretty neat right? You can spend 7 dollars to move a piece one tile backwards. It cannot take with this action.""", icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].color == white: - b[i][j].wallet.options &= (name: "Move Back", cost: 4, action: whiteMoveBack, condition: whiteMoveBackConditions) - else: - b[i][j].wallet.options &= (name: "Move Back", cost: 4, action: blackMoveBack, condition: blackMoveBackCondition) + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + if side == black: + s.side[side].buys &= (name: "Move Back", cost: alwaysCost(7), action: blackMoveBack, condition: blackMoveBackCondition) + else: + s.side[side].buys &= (name: "Move Back", cost: alwaysCost(7), action: whiteMoveBack, condition: whiteMoveBackConditions) ) const capitalismTwo2: Synergy = ( power: moveBack, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) @@ -1703,54 +1721,39 @@ const income*: Power = Power( icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - for i, j in b.rankAndFile: - if b[i][j].item == King and b[i][j].isColor(side): - b[i][j].wallet.money += 10 + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + addMoney(side, 10, s) ) const capitalismTwo3: Synergy = ( power: income, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) -proc buyMoveUpgrade(move: MoveProc): OnPiece = - result = proc (piece: var Piece, board: var ChessBoard) = - piece.moves &= move - -proc buyMoveUpgradeCondition(move: MoveProc): BuyCondition = - result = func (piece: Piece, board: ChessBoard): bool = - return move notin piece.moves #only allows buy if piece doesn't already have move - const upgrade*: Power = Power( name: "Capitalism III", technicalName: "Capitalism: Upgrade Knight", tier: Uncommon, rarity: 0, #rarity 0 because it should only be gotten through synergy priority: 15, - description: """Money can be used in exchange for goods and services. You can spend 7 dollars to give a piece the movement of a knight. - It still cannot take like a knight.""", + description: """Money can be used in exchange for goods and services. You can spend 8 dollars to give a piece the movement of a knight. + This upgrade is 30 dollars more expensive for the king. The upgraded piece still cannot take like a knight.""", icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = let action = buyMoveUpgrade(knightMoves) let condition = buyMoveUpgradeCondition(knightMoves) - for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].item != King: #king has higher cost so it's not too strong - b[i][j].wallet.options &= (name: "Upgrade", cost: 7, action: action, condition: condition) - else: - b[i][j].wallet.options &= (name: "Upgrade", cost: 15, action: action, condition: condition) + s.side[side].buys &= (name: "Upgrade", cost: exceptCost(8, King, 38), action: action, condition: condition) ) const capitalismThree1: Synergy = ( power: upgrade, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) @@ -1761,57 +1764,63 @@ const upgrade2*: Power = Power( tier: Uncommon, rarity: 0, #rarity 0 because it should only be gotten through synergy priority: 15, - description: """Money can be used in exchange for goods and services. You can spend 7 dollars to give a piece the movement of a knight. - This upgrade is 8 dollars more expensive for the king. It still cannot take like a giraffe.""", + description: """Money can be used in exchange for goods and services. You can spend 8 dollars to give a piece the movement of a knight. + This upgrade is 30 dollars more expensive for the king. The upgraded piece still cannot take like a giraffe.""", icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = let action = buyMoveUpgrade(giraffeMoves) let condition = buyMoveUpgradeCondition(giraffeMoves) - for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].item != King: - b[i][j].wallet.options &= (name: "Upgrade", cost: 7, action: action, condition: condition) - else: - b[i][j].wallet.options &= (name: "Upgrade", cost: 15, action: action, condition: condition) + s.side[side].buys &= (name: "Upgrade", cost: exceptCost(8, King, 38), action: action, condition: condition) ) const capitalismThree2: Synergy = ( power: upgrade2, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) -const sellPiece: OnPiece = proc (piece: var Piece, b: var ChessBoard) = - b[piece.tile.rank][piece.tile.file] = air.pieceCopy(tile = piece.tile) +const sellPiece: OnPiece = proc (piece: var Piece, b: var ChessBoard, state: var BoardState) = + b[piece.tile.rank][piece.tile.file] = air.pieceCopy(index = b[piece.tile.rank][piece.tile.file].index, tile = piece.tile) + inc state.side[piece.color].piecesSold + +const notKing: BuyCondition = func (piece: Piece, board: ChessBoard, s: BoardState): bool = + return piece.item != King -const alwaysTrue: BuyCondition = func (piece: Piece, b: ChessBoard): bool = - return true +proc createPieceMarket(cost: int, rate: int): BuyCost = + var lastTurnSold = -1 + var lastPiecesSold = 0 + result = func (piece: Piece, b: ChessBoard, s: BoardState): int = + let piecesSold = s.side[piece.color].piecesSold + if s.shared.turnNumber != lastTurnSold: + lastTurnSold = s.shared.turnNumber + lastPiecesSold = piecesSold + + result = cost + (rate * (lastPiecesSold - piecesSold)) + +#TODO constraint const sell*: Power = Power( name: "Capitalism IV", technicalName: "Capitalism: Sell", tier: Uncommon, rarity: 0, #rarity 0 because it should only be gotten through synergy priority: 15, - description: """Who needs these pieces? AFUERA! You can sell a piece for 3 dollars.""", + description: """Who needs these pieces? AFUERA! You can sell a piece for 3 dollars. Each subsequent piece sold gives one less. """, icon: "usflag.svg", noColor: true, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = - for i, j in b.rankAndFile: - if b[i][j].isColor(side): - if b[i][j].item != King: - b[i][j].wallet.options &= (name: "Sell", cost: -3, action: sellPiece, condition: alwaysTrue) + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + s.side[side].buys &= (name: "Sell", cost: createPieceMarket(-3, -1), action: sellPiece, condition: notKing) ) const capitalismFour1: Synergy = ( power: sell, rarity: 16, - requirements: @[capitalism.name], + requirements: @[capitalismPower.name], replacements: @[], index: -1 ) @@ -1824,15 +1833,13 @@ proc createSuperLottery(): OnPiece = #to better modularize the power's state, I think #`Piece.rand` powers can't do this because it needs the seed, and a global clear of drunkenness #which has to happen after all `Piece.onEndTurn` stuff, not during - result = proc (piece: var Piece, board: var ChessBoard) = + result = proc (piece: var Piece, board: var ChessBoard, state: var BoardState) = if piece.timesMoved != lastTimesMoved: - randomize(10 * piece.tile.rank + 100 * piece.tile.file + piece.rand.seed) + randomize(10 * piece.tile.rank + 100 * piece.tile.file + state.shared.randSeed) let ticket = rand(100) - if ticket == 42 or ticket == 17: #arbitrary - for i, j in board.rankAndFile: - if board[i][j].item == King and board[i][j].sameColor(piece): - board[i][j].wallet.money += 10 - piece.promote(board) + if ticket == 42: #arbitrary + addMoney(piece.color, 10, state) + piece.promote(board, state) lastTimesMoved = piece.timesMoved const slumdogBillionairePower*: Power = Power( @@ -1844,7 +1851,7 @@ const slumdogBillionairePower*: Power = Power( Your pawns have a 2% chance of promoting whenever they move. When this happens, you get 10 dollars.""", icon: pawnIcon, onStart: - proc (side: Color, _: Color, b: var ChessBoard) = + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = for i, j in b.rankAndFile: if b[i][j].item == Pawn and b[i][j].isColor(side): b[i][j].onEndTurn &= createSuperLottery() @@ -1853,11 +1860,170 @@ const slumdogBillionairePower*: Power = Power( const slumdogBillionaire: Synergy = ( power: slumdogBillionairePower, rarity: 8, - requirements: @[capitalism.name, slumdogMillionaire.name], + requirements: @[capitalismPower.name, slumdogMillionaire.name], replacements: @[slumdogMillionaire.name], index: -1 ) +const exponentialGrowthOnEndTurn: OnPiece = proc (piece: var Piece, _: var ChessBoard, state: var BoardState) = + let currentMoney = getMoney(piece.color, state) + let next = currentMoney * 2 - currentMoney #I want it to double, but not sum of doubling. + addMoney(piece.color, next, state) + +const exponentialGrowth*: Power = Power( + name: "Capitalism MM", + tier: UltraRare, + rarity: 0, + priority: 15, + description: "TO THE MOON!!!!", + icon: "usflag.svg", + noColor: true, + onStart: + proc (side: Color, _: Color, b: var ChessBoard, _: var BoardState) = + for i, j in b.rankAndFile: + if b[i][j].item == King and b[i][j].isColor(side): + b[i][j].onEndTurn &= exponentialGrowthOnEndTurn +) + +const capitalismTwoThousand: Synergy = ( + power: sell, + rarity: 16, + requirements: @[capitalismPower.name, capitalismTwo2.power.name, capitalismThree1.power.name, capitalismFour1.power.name], + replacements: @[], + index: -1 +) + +const canSkyGlass: GlassMoves = + func (side: Color, piece: Piece, b: ChessBoard, _: BoardState): Moves = + if piece.color != side: return @[] + else: + for tile in b.rankAndFile: + if b[tile].item == None and not piece.wouldCheckAt(tile, b): + result.add(tile) + + +const skyGlassAction: OnAction = proc (piece: var Piece, to: Tile, b: var ChessBoard, s: var BoardState) = + #this is not in the condition because it can change after + #but it should still be a viable attempt before + if b[to.rank][to.file].item != None: return + piece.move(to, b, s) + +const canZeroGlass: GlassMoves = + func (side: Color, piece: Piece, b: ChessBoard, _: BoardState): Moves = + for i, j in b.rankAndFile: + if b[i][j].item != King: + result.add(b[i][j].tile) + +#we use a proc creator because we need to pass the side that has the ability +#since I want it to work on all pieces (which means we can't assume color) +#I could just make it not count towards taking, but I love overcomplicated systems +proc createZeroGlassAction(side: Color): OnAction = + result = proc (_: var Piece, to: Tile, b: var ChessBoard, s: var BoardState) = + if b[to.rank][to.file].item == None: return + b[to.rank][to.file] = air.pieceCopy(index = b[to].index, tile = to) + inc s.side[side].abilityTakes + +const canSteelGlass: GlassMoves = + func (side: Color, piece: Piece, b: ChessBoard, _: BoardState): Moves = + if not piece.isAtEnd(): + if piece.color == white: + return @[piece.tile.tileAbove] + else: + return @[piece.tile.tileBelow] + else: return @[] + +const steelGlassAction: OnAction = proc (piece: var Piece, to: Tile, b: var ChessBoard, s: var BoardState) = + #this is not in the condition because it can change after + #but it should still be a viable attempt before + if b[to.rank][to.file].item == None: return + piece.take(to, b, s) + +#helper function to create the "On Glass Powers" part +#so that I can just update it here +#which i will need to do because it doesn't make sense +#strength indicates how many pieces the power works for +proc createGlassDescription(strength: int): string = + let quantity = if strength == 1: "1 piece" else: $strength & " pieces" + return " On Glass Powers: Instead of moving, you can select " & + quantity & + """ to start casting. + Pieces then spend one turn casting, during which you cannot do anything, unless + if you cancel all casts. If the piece is still alive the following turn, the + cast completes and its ability occurs.""" + + + + +const skyGlass*: Power = Power( + name: "Glass: Sky", + tier: Common, + rarity: 24, #while new + priority: 15, + description: """You unlock the Glass of Sky ability, which allows you to move up to 2 of your + pieces to any tile which does not put the king in check.""" & createGlassDescription(2), + icon: "skyglass.svg", + noColor: true, + onStart: + proc (side: Color, _: Color, _: var ChessBoard, s: var BoardState) = + s.side[side].glass[Sky] = some(( + strength: 2, + action: skyGlassAction, + condition: canSkyGlass, + )) +) + + +const zeroGlass*: Power = Power( + name: "Glass: Zero", + tier: Rare, + rarity: 24, #while new + priority: 15, + description: """You unlock the Glass of Zero ability, which allows you to mark + any 2 non-king tiles. Any piece on these tiles will die if the cast completes. """ & + createGlassDescription(2), + icon: "zeroglass.svg", + noColor: true, + onStart: + proc (side: Color, _: Color, _: var ChessBoard, s: var BoardState) = + s.side[side].glass[Zero] = some(( + strength: 2, + action: createZeroGlassAction(side), + condition: canZeroGlass, + )) +) + +const steelMove*: OnPiece = proc (piece: var Piece, _: var ChessBoard, state: var BoardState) = + #i'm not sure how to iterate a variable + for i, c in piece.casts: + if c.glass == Steel: + piece.casts[i].on = piece.forward() + +const steelGlass*: Power = Power( + name: "Glass: Steel", + tier: Common, + rarity: 24, + priority: 15, + description: """You unlock the Glass of Steel ability, which allows you to mark up to 3 of your pieces. + If there is an enemy one tile in front of them when the cast completes, they take forward.""" & + createGlassDescription(3), + icon: "steelglass.svg", + noColor: true, + onStart: + proc (side: Color, _: Color, b: var ChessBoard, s: var BoardState) = + s.side[side].glass[Steel] = some(( + strength: 3, + action: steelGlassAction, + condition: canSteelGlass, + )) + + for i, j in b.rankAndFile: + if b[i][j].isColor(side): + b[i][j].onEndTurn &= steelMove +) + + + +registerPower(empress) registerPower(altEmpress) registerPower(mysteriousSwordsmanLeft) registerPower(mysteriousSwordsmanRight) @@ -1894,9 +2060,14 @@ registerPower(alcoholism) registerPower(civilians) registerPower(slumdogMillionaire) registerPower(stupidPower) +registerPower(conversion) registerPower(americanDream) registerPower(sleeperAgent) -registerPower(capitalism) +registerPower(capitalismPower) + +registerPower(skyGlass) +registerPower(zeroGlass) +registerPower(steelGlass) registerSynergy(samuraiSynergy) registerSynergy(calvaryCharge) @@ -1921,6 +2092,7 @@ registerSynergy(capitalismTwo3) registerSynergy(capitalismThree1) registerSynergy(capitalismThree2) registerSynergy(capitalismFour1) +registerSynergy(capitalismTwoThousand, true) registerSynergy(slumdogBillionaire, true) registerSynergy(virus, true) @@ -1936,4 +2108,5 @@ registerSynergy(masochistAltEmpress, true, true) #All powers with rng involved #so user can disable them if they want -const rngPowers* = @[alcoholism, drunkKnights, civilians, slumdogMillionaire, stupidPower, sleeperAgent, conversion] \ No newline at end of file +const rngPowers* = @[alcoholism, drunkKnights, civilians, slumdogMillionaire, stupidPower, sleeperAgent, conversion] +const experimentalPowers* = @[skyGlass, zeroGlass, steelGlass] \ No newline at end of file diff --git a/styles.css b/styles.css deleted file mode 100644 index 6918278..0000000 --- a/styles.css +++ /dev/null @@ -1,480 +0,0 @@ -:root { - --border-width: 4px; - --background-highlight: #F8F7F7; - --background-hover: #DCDCDC; -} - -td { - transition: ease-in-out all .5s; -} - -@media only screen { - td { - min-width: 100px; - min-height: 100px; - width: 100px; - height: 100px; - text-align: center; - vertical-align: middle; - } - - .power-grid { - font-size: 23px; - } -} - -@media only screen and (max-width: 2000px) { - td { - min-width: 90px; - min-height: 90px; - width: 90px; - height: 90px; - text-align: center; - vertical-align: middle; - } - - .power-grid { - font-size: 21px; - } -} - - -@media only screen and (max-width: 1750px) { - td { - min-width: 80px; - min-height: 80px; - width: 80px; - height: 80px; - text-align: center; - vertical-align: middle; - } - - .power-grid { - font-size: 18px; - } -} - - -@media only screen and (max-width: 1500px) { - td { - min-width: 70px; - min-height: 70px; - width: 70px; - height: 70px; - text-align: center; - vertical-align: middle; - } - - .power-grid { - font-size: 16px; - } -} - -@media only screen and (max-width: 1250px) { - td { - min-width: 70px; - min-height: 70px; - width: 70px; - height: 70px; - text-align: center; - vertical-align: middle; - border-width: 2px !important; - } - - .power-grid { - font-size: 24px; - } -} - - -@media only screen and (max-width: 1000px) { - td { - min-width: 65px; - min-height: 65px; - width: 65px; - height: 65px; - text-align: center; - vertical-align: middle; - border-width: 2px !important; - } - - .power-grid { - font-size: 22px; - } -} - -@media only screen and (max-width: 750px) { - td { - min-width: 55px; - min-height: 55px; - width: 55px; - height: 55px; - text-align: center; - vertical-align: middle; - border-width: 2px !important; - } - - .power-grid { - font-size: 20px; - } -} - -@media only screen and (max-width: 500px) { - td { - min-width: 37px; - min-height: 37px; - width: 37px; - height: 37px; - text-align: center; - vertical-align: middle; - border-width: 2px !important; - } -} - - -html, body{ - height: 100%; - width: 100%; - min-height: 100%; - min-width: 100%; -} - -img { - width: 100%; - height: 100%; - max-height: inherit; - object-fit: contain; -} - -.height-100 { - min-height: 100%; - height: 100%; -} - -.width-100 { - min-width: 100%; - width: 100%; -} - -.main { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - gap: 50px; - height: 100%; -} - -.gap-10 { - gap: 10px !important; -} - -.wrap { - flex-wrap: wrap; -} - -.cut-down { - max-height: 80%; -} - -.column { - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; - align-self: center; - gap: 20px; - text-align: center; -} - -hr { - min-width: 100%; - max-width: 100%; - width: 100%; - /**one of these do something*/ - border-style: solid; - border-width: 0px 0px 4px 0px; - border-color: black; -} - -.start-column { - display: flex; - min-height: 50%; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 50px; - text-align: center; - padding: 35px; -} - -.small-column { - max-height: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 5px; - text-align: center -} - -.power-menu { - flex-wrap: wrap; -} - -.power { - padding: 20px; - min-height: 90%; - width: 180px; - min-width: 180px; - - display: flex; - flex-direction: column; - align-items: center; - text-align: center; - - background-color: var(--background-highlight); - transition: .9s; -} - -.power:hover { - background-color: var(--background-hover); -} - -.column-scroll { - display: flex; - flex-direction: column; - align-items: center; - gap: 20px; - text-align: center; - padding: 35px; - - overflow-y: scroll; - overflow-x: scroll; - max-height: 70%; - min-height: 70%; - height: 70%; - max-width: 33%; - width: 33%; - transform: translateY(-5%); -} - -::-webkit-scrollbar { - -webkit-appearance: none; - height: 0px; - width: 7px; -} - -::-webkit-scrollbar-thumb { - border-radius: 4px; - background-color: rgba(0, 0, 0, .1); -} - -.power-grid { - display: grid; - grid-template-areas: - 'title title title . .' - 'desc desc desc img img' - 'desc desc desc img img' - 'desc desc desc . .'; - - gap: 10px; - padding: 5px; - background-color: var(--background-highlight); - justify-content: center; - height: auto; - min-width: 100%; - max-width: 100%; - text-wrap: wrap; - transition: 0.9s; -} - -.setting-item { - display: grid; - grid-template-areas: - 'title title title' - 'desc desc desc' - 'desc desc desc' - 'button button button'; - - padding: 5px; - justify-content: center; - height: auto; - min-width: 100%; - max-width: 100%; - text-wrap: wrap; - transition: 0.9s; -} - -.setting-item > h5 { - font-size: 22px; - grid-area: title; - margin-bottom: 0px; -} - -.setting-item > p { - grid-area: desc; -} - -.setting-item > button { - grid-area: button; -} - -.piece-row { - display: grid; - grid-template-columns: repeat(3, .5fr); - grid-template-areas: - 'name . .' - 'img . row' - 'take . row'; - justify-content: left; - text-wrap: wrap; - padding: 10px; - - min-width: 50%; - - background-color: var(--background-highlight); - transition: 0.9s; -} - -.piece-row:hover { - background-color: var(--background-hover); -} - -.piece-row > h4 { - grid-area: name; - margin-top: 10px; - margin-bottom: 5px; - font-size: 20px; -} - -.piece-row > img { - grid-area: img; -} - -.piece-row > .row { - grid-area: row; - display: flex; - flex-direction: row; - flex-wrap: wrap; - gap: 10px; -} - -.piece-row > .row > button { - height: min-content; - font-size: 20px; -} - -.column-scroll > .piece-row{ - min-width: 100%; -} - -/*If you close your eyes its not too bad*/ -.column-scroll > .piece-row > .row > button { - font-size: 16px; - max-width: min-content -} - -.piece-row > .take { - grid-area: take; -} - -.wrap > .power-grid { - padding: 5px; - background-color: var(--background-highlight); - height: auto; - text-wrap: wrap; - max-width: 33%; - display: inline-block; - transition: 0.9s; -} - -.power-grid > img { - position: relative; - max-height: 100px; - min-height: 100px; -} - -.power-grid:hover { - background-color: var(--background-hover); -} - -.power-grid > h4 { - margin-top: 0px; - margin-bottom: 0px; -} - -.title { - grid-area: title; -} - -.desc { - grid-area: desc; -} - -.image { - grid-area: img; - max-width: 100%; - max-height: 100%; -} - -.power > h1 { - text-align: center; - flex-basis: 90px; -} - -.unselected { - border-width: var(--border-width); - border-color: rgba(0, 0, 0, 0); - border-style: solid; -} - -.selected { - border-width: var(--border-width); - border-color: blue !important; - border-style: solid; -} - -.can-move { - border-width: var(--border-width); - border-color: green !important; - border-style: solid; -} - -.can-take { - border-width: var(--border-width); - border-color: yellow !important; - border-style: solid; -} - -.last-move { - border-width: var(--border-width); - border-color: purple; - border-style: solid; -} - -.checking { - border-width: var(--border-width); - border-color: red; - border-style: solid; -} - -.blackTile{ - background-color: darkgrey; -} - -.whiteTile { - background-color: whitesmoke; -} - -.rotate { - transform: rotate(180deg); -} - -.menu-button { - min-width: 120px; -} - -.scroll { - overflow: scroll; -} diff --git a/styles.scss b/styles.scss new file mode 100644 index 0000000..a9d07d9 --- /dev/null +++ b/styles.scss @@ -0,0 +1,413 @@ +@use 'rows'; +@use 'sass:string'; +@use 'sass:list'; +@use 'sass:math'; + +/* +WARNING: Due to the graphic nature of the following, we require you to sign +a Non Dicslosure Agreenebt (NDA) before acessing the content. Such a contract waives your +write to report on the following, to any other person, or entity, for perpetuity. Violating this agreement +will result in fines up to 5000 dollares and up to 3 years of jail time. +*/ + +html, +body { + height: 100%; + width: 100%; + min-height: 100%; + min-width: 100%; +} + +h3 { + font-size: 25px; +} + +img { + width: 100%; + height: 100%; + max-height: inherit; + object-fit: contain; +} + +::-webkit-scrollbar { + -webkit-appearance: none; + height: 0px; + width: 7px; +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: rgba(0, 0, 0, .1); +} + +.height-100 { + min-height: 100%; + height: 100%; +} + +.width-100 { + min-width: 100%; + width: 100%; +} + +.main { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + gap: 90px; + height: 100%; +} + +.cut-down { + max-height: 80%; +} + +.column { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + align-self: center; + gap: 20px; + text-align: center; +} + +hr { + min-width: 100%; + max-width: 100%; + width: 100%; + /**one of these do something*/ + border-style: solid; + border-width: 0px 0px 4px 0px; + border-color: black; +} + +.start-column { + display: flex; + min-height: 50%; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 50px; + text-align: center; + padding: 35px; +} + +.power-menu { + flex-wrap: wrap; +} + +.power { + padding: 20px; + min-height: 90%; + width: 180px; + min-width: 180px; + + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + + background-color: rows.$background-highlight; + transition: .9s; +} + +.power:hover { + background-color: rows.$background-hover; +} + +.column-scroll { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + text-align: center; + + border-width: 3px; + border-color: black; + border-style: solid; + + overflow-y: scroll; + overflow-x: scroll; + max-height: 100%; + height: 100%; + max-width: 95%; + min-width: 95%; + width: 95%; + + padding-top: 20px; + padding-bottom: 20px; +} + +/*If you close your eyes its not too bad*/ +.column-scroll>.piece-row>.row>button { + font-size: 16px; + max-width: min-content +} + +.setting-item { + display: grid; + grid-template-areas: + 'title title title' + 'desc desc desc' + 'desc desc desc' + 'button button button'; + + padding: 5px; + justify-content: center; + height: auto; + min-width: 100%; + max-width: 100%; + text-wrap: wrap; + transition: 0.9s; +} + +.setting-item>h4 { + font-size: 22px; + grid-area: title; + margin-bottom: 0px; +} + +.setting-item>p { + grid-area: desc; +} + +.setting-item>button { + grid-area: button; +} + +.title { + grid-area: title; +} + +.desc { + grid-area: desc; +} + + +.image { + grid-area: img; + max-width: 100%; + max-height: 100%; +} + +.power>h1 { + text-align: center; + flex-basis: 90px; +} + +.tab-row { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: 0px; + + min-width: 100%; + margin-top: -10px; + height: auto; + + transform: translateX(2.5%); + + button { + border-top-left-radius: 10px; + border-top-right-radius: 10px; + } + + /*Moves every other element to the right + to make an overlap effect*/ + button:not(first-child) { + margin-right: -6px; + } +} + +.tab-column { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + align-self: center; + + max-height: 78%; + min-height: 78%; + height: 78%; + + width: min-content; + min-width: 70%; + max-width: 70%; +} + +.long { + max-height: 40% !important; + min-height: 40% !important; + height: 40% !important; + width: 90% !important; + min-width: 90% !important; + max-width: 90% !important; + + transform: translateY(10px); +} + + + +.debug { + min-width: 10px; + min-height: 10px; + background-color: lightyellow; +} + +.unselected { + border-color: rgba(0, 0, 0, 0); + border-style: solid; +} + +.selected { + border-color: blue !important; + border-style: solid; +} + +.can-move { + border-color: green !important; + border-style: solid; +} + +.can-take { + border-color: yellow !important; + border-style: solid; +} + +.last-move { + border-color: purple; + border-style: solid; +} + +.checking { + border-color: red; + border-style: solid; +} + +.picking { + border-color: orange; + border-style: solid; +} + +@mixin casting($color) { + $id: string.unique-id(); + + content: ''; + position: absolute; + min-width: inherit; + min-height: inherit; + padding-bottom: 5px; + + border-radius: 50%; + + outline-width: 2px; + outline-style: solid; + animation: castingAnimation-#{$id} 4s ease-in-out infinite; + + @keyframes castingAnimation-#{$id} { + 0% { + outline-width: 3px; + outline-offset: 50px; + outline-color: $color; + } + + 100% { + outline-width: 20px; + outline-offset: -25px; + outline-color: rgba(0, 0, 0, 0); + } + } +} + +@mixin castingOn($color) { + $id: string.unique-id(); + + outline-width: 1px; + outline-color: $color; + outline-style: solid; + animation: animateOutline#{$id} 2s ease infinite; + + @keyframes animateOutline#{$id} { + 0% { + outline-width: 2px; + outline-offset: 0px; + outline-color: $color; + } + + 50% { + outline-width: 8px; + outline-offset: 0px; + outline-color: rgba(0, 0, 0, 0); + } + + 100% { + outline-width: 2px; + outline-offset: 0px; + outline-color: $color; + } + + } +} + +.casting-on-sky { + @include castingOn(rows.$sky) +} + +.casting-on-steel { + @include castingOn(rows.$steel) +} + +.casting-on-zero { + @include castingOn(rows.$zero) +} + +.casting-sky::before { + @include casting(rows.$sky) +} + +.casting-steel::before { + @include casting(rows.$steel) +} + +.casting-zero::before { + @include casting(rows.$zero) +} + +.blackTile { + background-color: darkgrey; +} + +.whiteTile { + background-color: whitesmoke; +} + +.rotate { + transform: rotate(180deg); +} + +.menu-button { + min-width: 120px; +} + +.scroll { + overflow: scroll; +} + +.bottom-info { + margin-bottom: -10px; + margin-top: -10px; + + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + gap: 90px; + height: 100%; +} + +.gap-10 { + gap: 10px; +} \ No newline at end of file