Author | Alphazone |
Submission date | 2018-07-12 03:30:43.627130 |
Rating | 4087 |
Matches played | 281 |
Win rate | 40.93 |
Use rpsrunner.py to play unranked matches on your computer.
HARDCODED = True
if input == "":
import random
import uuid
import pickle
nvm = 10
nops = 6
naddr = 10
if not 'vms' in locals():
if HARDCODED:
vms = [
b'(dp0\nVpc\np1\nL2L\nsVdp\np2\nL0L\nsVid\np3\nccopy_reg\n_reconstructor\np4\n(cuuid\nUUID\np5\nc__builtin__\nobject\np6\nNtp7\nRp8\n(dp9\nVint\np10\nL129390736575596381986267599841831810647L\nsbsVd\np11\n(lp12\nL-1L\naL-3L\naL2L\naL-5L\naL1L\naL0L\naL1L\naL0L\naL1L\naL-1L\nasVrounds\np13\nL399600L\nsVscore\np14\nL-38L\nsVfitness\np15\nL811472L\nsVmove\np16\nVR\np17\nsVp\np18\n(lp19\n(lp20\nF0.0005806454482681917\naF0.09098916616084943\naF0.287129095163024\naF0.3210954582701333\naF0.11486251547575423\naF0.1853431194819708\naa(lp21\nF0.07409278202170229\naF0.30922252381285714\naF0.026690646995325536\naF0.35963679866011544\naF0.17237138529902024\naF0.05798586321097945\naa(lp22\nF0.04028437604131292\naF0.08933307755594624\naF0.24724096030487194\naF0.2681403026859284\naF0.30195280613716197\naF0.053048477274778356\naa(lp23\nF0.005587408259619328\naF0.3179441128976322\naF0.18227230209610426\naF0.1732896894440833\naF0.2477344285033076\naF0.07317205879925336\naa(lp24\nF0.0374646710287102\naF0.1759327084707446\naF0.17552207712734716\naF0.2365427486057089\naF0.2477608273409674\naF0.12677696742652173\naa(lp25\nF0.04616325925615098\naF0.20100686134692958\naF0.32625136520126424\naF0.19193036819653503\naF0.004781672938065363\naF0.2298664730610549\naa(lp26\nF0.02903291123670676\naF0.15914622777407678\naF0.1601089081052142\naF0.06615732338913301\naF0.18475869698443245\naF0.40079593251043677\naa(lp27\nF0.19237585061289839\naF0.10191652440473033\naF0.24398537220989475\naF0.0021972623738917025\naF0.1417889104168915\naF0.31773607998169345\naa(lp28\nF0.09919904633862084\naF0.004036563798223947\naF0.16848771025283574\naF0.10369995714778335\naF0.2813903510378025\naF0.3431863714247337\naa(lp29\nF0.04401625570013945\naF0.34069940666934945\naF0.012461903399378093\naF0.1559059326997964\naF0.09509156243276357\naF0.351824939098573\naas.'
,
b'(dp0\nVpc\np1\nL4L\nsVdp\np2\nL5L\nsVid\np3\nccopy_reg\n_reconstructor\np4\n(cuuid\nUUID\np5\nc__builtin__\nobject\np6\nNtp7\nRp8\n(dp9\nVint\np10\nL297899465266232116547721711694326989510L\nsbsVd\np11\n(lp12\nL1L\naL0L\naL0L\naL1L\naL0L\naL2L\naL0L\naL0L\naL1L\naL0L\nasVrounds\np13\nL749250L\nsVscore\np14\nL-60L\nsVfitness\np15\nL220597L\nsVmove\np16\nVR\np17\nsVp\np18\n(lp19\n(lp20\nF0.09431251435997354\naF0.1940955361145886\naF0.18439619341513794\naF0.1987053638387837\naF0.2292949640051209\naF0.09919542826639528\naa(lp21\nF0.017483725571263948\naF0.30032156926345427\naF0.21711401290345475\naF0.1592553826108125\naF0.10072022838524002\naF0.2051050812657744\naa(lp22\nF0.0300027453250374\naF0.22011038062315516\naF0.1627287791922577\naF0.23063423943761732\naF0.12676936086962096\naF0.22975449455231142\naa(lp23\nF0.12831670852425572\naF0.10258454713745577\naF0.06909059319178242\naF0.21548248535114983\naF0.18432116420839678\naF0.30020450158695955\naa(lp24\nF0.008828343024477617\naF0.3147594350781936\naF0.007632059961322445\naF0.1894644057768564\naF0.15926353662734874\naF0.3200522195318013\naa(lp25\nF0.05374865582870269\naF0.02063799865708408\naF0.23394626083142064\naF0.05570267332742717\naF0.5028151386270387\naF0.13314927272832658\naa(lp26\nF0.07305974483057852\naF0.1504375849226691\naF0.4076956664070518\naF0.1617082445423214\naF0.11654435042862309\naF0.09055440886875614\naa(lp27\nF0.15632357852497406\naF0.300247765253863\naF0.011779449343997436\naF0.22570558531081267\naF0.07188632812490768\naF0.23405729344144527\naa(lp28\nF0.006554146809749313\naF0.2552175213986048\naF0.02324510647422212\naF0.13965474556731325\naF0.22338374843240097\naF0.35194473131770954\naa(lp29\nF0.17991701032886812\naF0.23384022124990594\naF0.20963629101846912\naF0.015630488138995608\naF0.2719360881528613\naF0.08903990111089982\naas.'
,
b'(dp0\nVpc\np1\nL1L\nsVdp\np2\nL3L\nsVid\np3\nccopy_reg\n_reconstructor\np4\n(cuuid\nUUID\np5\nc__builtin__\nobject\np6\nNtp7\nRp8\n(dp9\nVint\np10\nL313142413520555105929978949473519112087L\nsbsVd\np11\n(lp12\nL0L\naL0L\naL1L\naL0L\naL1L\naL1L\naL1L\naL0L\naL0L\naL1L\nasVrounds\np13\nL449550L\nsVscore\np14\nL-39L\nsVfitness\np15\nL114765L\nsVmove\np16\nVS\np17\nsVp\np18\n(lp19\n(lp20\nF0.10034522741154378\naF0.025309803414408683\naF0.4040826780309822\naF0.043136862311070195\naF0.09858970362232188\naF0.3285357252096733\naa(lp21\nF0.002279290447832452\naF0.3257118040653451\naF0.2357599486499663\naF0.31281289883862856\naF0.10221554231231479\naF0.021220515685912843\naa(lp22\nF0.020590184214158095\naF0.1814925188423481\naF0.16063540312585692\naF0.259502025614171\naF0.3374414245399658\naF0.04033844366350013\naa(lp23\nF0.18136837162697417\naF0.1894492673308533\naF0.17383117550965624\naF0.19985982624235582\naF0.08528835956222643\naF0.1702029997279339\naa(lp24\nF0.15714214308414012\naF0.16723569653227283\naF0.12664046540229387\naF0.16105693195501042\naF0.1725198596205356\naF0.21540490340574714\naa(lp25\nF0.31509887338353665\naF0.2374205960088722\naF0.046928360940089654\naF0.038058543153589294\naF0.095106378817476\naF0.2673872476964363\naa(lp26\nF0.025843300491130247\naF0.0708973760772749\naF0.1467128162808919\naF0.3665266138626817\naF0.25709366105700165\naF0.13292623223101965\naa(lp27\nF0.2265324717436944\naF0.26138589973996557\naF0.11458176950906081\naF0.13895859050401146\naF0.04358952049787364\naF0.21495174800539427\naa(lp28\nF0.2750997017210757\naF0.1077228007836091\naF0.055045599346191576\naF0.200558240088326\naF0.1680138253685258\naF0.19355983269227187\naa(lp29\nF0.09117314712475535\naF0.2560183773514142\naF0.13727451777299907\naF0.2768917250149464\naF0.11989855541106323\naF0.11874367732482156\naas.'
,
b'(dp0\nVpc\np1\nL1L\nsVdp\np2\nL3L\nsVp\np3\n(lp4\n(lp5\nF0.2289171208901997\naF0.17449233080377227\naF0.15638628296832646\naF0.0767284366257768\naF0.13768890476223553\naF0.22578692394968905\naa(lp6\nF0.22780711866002398\naF0.2026157944294835\naF0.13295302670917664\naF0.20248627989857976\naF0.030250418976764636\naF0.20388736132597157\naa(lp7\nF0.2404067343199124\naF0.014993910924230556\naF0.26508771977822476\naF0.029877725726345165\naF0.14696650653289559\naF0.3026674027183916\naa(lp8\nF0.08048963637152629\naF0.09442997112431131\naF0.0843592828444918\naF0.36235478789566683\naF0.009488505770134516\naF0.3688778159938693\naa(lp9\nF0.0594658311811781\naF0.4969508345468998\naF0.14978089544540038\naF0.1150750984736964\naF0.025405763222254574\naF0.15332157713057076\naa(lp10\nF0.23852285491076686\naF0.001289611543805103\naF0.045693943437871185\naF0.2803879651368372\naF0.2901865806483833\naF0.14391904432233638\naa(lp11\nF0.0421383840231099\naF0.2046804054501554\naF0.3028417819466109\naF0.24325131443007575\naF0.04952260911188427\naF0.1575655050381638\naa(lp12\nF0.04574977681583891\naF0.21911247328500247\naF0.2254269728930714\naF0.19982211980057366\naF0.236928695202595\naF0.07295996200291861\naa(lp13\nF0.12045204594805863\naF0.0934286304498346\naF0.18183742832416883\naF0.11090791474420682\naF0.32321649381963524\naF0.17015748671409592\naa(lp14\nF0.11551983721401425\naF0.2633205131506396\naF0.218162740363706\naF0.20215390215234566\naF0.11574937724905933\naF0.08509362987023525\naasVd\np15\n(lp16\nL1L\naL2L\naL3L\naL1L\naL2L\naL1L\naL2L\naL1L\naL0L\naL-1L\nasVrounds\np17\nL99900L\nsVscore\np18\nL-39L\nsVfitness\np19\nL94183L\nsVmove\np20\nVP\np21\nsVid\np22\nccopy_reg\n_reconstructor\np23\n(cuuid\nUUID\np24\nc__builtin__\nobject\np25\nNtp26\nRp27\n(dp28\nVint\np29\nL128128284500284899857419449533619050142L\nsbs.'
,
b'(dp0\nVpc\np1\nL7L\nsVp\np2\n(lp3\n(lp4\nF0.2318406449930666\naF0.3608341973891789\naF0.09531410917252732\naF0.242511912734487\naF0.0011798725918133767\naF0.0683192631189267\naa(lp5\nF0.0372270747719273\naF0.22590423787657699\naF0.17933679954451487\naF0.29433427666284234\naF0.17559688767846815\naF0.08760072346567045\naa(lp6\nF0.06378684949755357\naF0.28665238877796606\naF0.22827819025146745\naF0.25120364169762244\naF0.12176375984586112\naF0.04831516992952948\naa(lp7\nF0.05519780942479603\naF0.1438550689324896\naF0.11142142042151436\naF0.24467061093866857\naF0.29247451893023196\naF0.1523805713522995\naa(lp8\nF0.2477386380726282\naF0.1575541622812164\naF0.3092325393089146\naF0.011311297005815771\naF0.15598795817537806\naF0.11817540515604702\naa(lp9\nF0.18627946112233065\naF0.23121503671784469\naF0.20405980524592493\naF0.19696467274168888\naF0.15339297815398145\naF0.02808804601822941\naa(lp10\nF0.06647762406511747\naF0.0946485090181965\naF0.23617766872022647\naF0.01970970104701416\naF0.48537753924144017\naF0.09760895790800518\naa(lp11\nF0.17195400315931833\naF0.11555597948746761\naF0.1279959176749018\naF0.23554373773693604\naF0.19171983822828037\naF0.15723052371309573\naa(lp12\nF0.11491070278379499\naF0.0815923130387064\naF0.2323048115409106\naF0.2312170701091623\naF0.08884138468570511\naF0.2511337178417205\naa(lp13\nF0.1898800038998159\naF0.21604152713596603\naF0.3622099663429111\naF0.007120488756372401\naF0.06167459680020232\naF0.16307341706473233\naasVdp\np14\nL1L\nsVid\np15\nccopy_reg\n_reconstructor\np16\n(cuuid\nUUID\np17\nc__builtin__\nobject\np18\nNtp19\nRp20\n(dp21\nVint\np22\nL19959098566703746689518334615208484592L\nsbsVd\np23\n(lp24\nL0L\naL1L\naL2L\naL2L\naL-2L\naL-2L\naL-1L\naL-3L\naL0L\naL1L\nasVrounds\np25\nL99900L\nsVscore\np26\nL-10L\nsVmove\np27\nVP\np28\nsVfitness\np29\nL-58973L\ns.'
,
b'(dp0\nVpc\np1\nL2L\nsVp\np2\n(lp3\n(lp4\nF0.03299756114892239\naF0.09046784966331922\naF0.1253985214814517\naF0.2214832530884508\naF0.23717647104569956\naF0.2924763435721564\naa(lp5\nF0.03175101252327594\naF0.29943715904580254\naF0.1311989514034359\naF0.03301335425059749\naF0.4726068164963592\naF0.03199270628052894\naa(lp6\nF0.25835023273232954\naF0.015973136880635064\naF0.14503149662593467\naF0.20097339700320713\naF0.27734736135767163\naF0.10232437540022175\naa(lp7\nF0.1485063860575631\naF0.2732203349042779\naF0.25288420165419373\naF0.15452429759246042\naF0.034716460912947736\naF0.13614831887855725\naa(lp8\nF0.23411500513948438\naF0.0346511817606076\naF0.07690007403386792\naF0.2584997098912545\naF0.011531164017737428\naF0.38430286515704826\naa(lp9\nF0.15246782922835755\naF0.3567068689790958\naF0.07606334809736318\naF0.30868259249298596\naF0.011957972335174578\naF0.09412138886702287\naa(lp10\nF0.15009479373236156\naF0.19741576939432967\naF0.07121068519423927\naF0.06283828979747065\naF0.13863246416080668\naF0.37980799772079205\naa(lp11\nF0.10223174873751076\naF0.15606336953695368\naF0.11703853581453667\naF0.23566079483918892\naF0.10033305855575608\naF0.2886724925160538\naa(lp12\nF0.012534673590244537\naF0.22086890512431984\naF0.161835194635132\naF0.23611167542662673\naF0.3296737074105015\naF0.038975843813175315\naa(lp13\nF0.10068006968781734\naF0.284004027191616\naF0.13057187434358733\naF0.28510938931931995\naF0.008674352566449575\naF0.1909602868912099\naasVdp\np14\nL5L\nsVid\np15\nccopy_reg\n_reconstructor\np16\n(cuuid\nUUID\np17\nc__builtin__\nobject\np18\nNtp19\nRp20\n(dp21\nVint\np22\nL65056741708127847942427601464830404016L\nsbsVd\np23\n(lp24\nL4L\naL-1L\naL0L\naL2L\naL1L\naL2L\naL-2L\naL2L\naL2L\naL-1L\nasVrounds\np25\nL249750L\nsVscore\np26\nL-49L\nsVmove\np27\nVR\np28\nsVfitness\np29\nL-98589L\ns.'
,
b'(dp0\nVid\np1\nccopy_reg\n_reconstructor\np2\n(cuuid\nUUID\np3\nc__builtin__\nobject\np4\nNtp5\nRp6\n(dp7\nVint\np8\nL112938317739200420823796628717163793717L\nsbsVpc\np9\nL2L\nsVdp\np10\nL8L\nsVp\np11\n(lp12\n(lp13\nF0.09676191628858406\naF0.17206794030596603\naF0.2068954586674071\naF0.231966344635814\naF0.2572102750346184\naF0.03509806506761034\naa(lp14\nF0.17108971635123188\naF0.3066127971681964\naF0.04195023282809449\naF0.09099701270182001\naF0.2812478505046585\naF0.10810239044599855\naa(lp15\nF0.08934965424616176\naF0.2526311371159242\naF0.1200683290225696\naF0.13963448612315602\naF0.174934193320242\naF0.22338220017194646\naa(lp16\nF0.1837182694932485\naF0.1360788856026009\naF0.15120283825171146\naF0.18347994258456699\naF0.217566175114234\naF0.12795388895363802\naa(lp17\nF0.14909956245582828\naF0.083518314974405\naF0.22014019779903\naF0.1836921370782162\naF0.22041998866294926\naF0.1431297990295713\naa(lp18\nF0.13671293291540235\naF0.2549052795843807\naF0.2340194098484543\naF0.00710553748632629\naF0.2889860454787131\naF0.07827079468672345\naa(lp19\nF0.0680381030541186\naF0.06335641280997903\naF0.31761134733117263\naF0.00276114571278173\naF0.4235793477972571\naF0.12465364329469086\naa(lp20\nF0.28695899711762757\naF0.09604967604739234\naF0.1474814056427745\naF0.19567708426462063\naF0.1097535586777419\naF0.164079278249843\naa(lp21\nF0.14108084393403533\naF0.3170477645912786\naF0.17825756434681952\naF0.029809584800737227\naF0.11458685689894577\naF0.21921738542818345\naa(lp22\nF0.020211212152396008\naF0.25078929372727515\naF0.2524845112030463\naF0.17009684807872058\naF0.13110859135954325\naF0.17530954347901867\naasVd\np23\n(lp24\nL1L\naL-1L\naL-1L\naL-2L\naL0L\naL0L\naL0L\naL0L\naL0L\naL-1L\nasVrounds\np25\nL49950L\nsVscore\np26\nL-60L\nsVmove\np27\nVS\np28\nsVfitness\np29\nL-102365L\ns.'
,
b'(dp0\nVpc\np1\nL10L\nsVp\np2\n(lp3\n(lp4\nF0.24392278400624792\naF0.02783087363717282\naF0.13924103877480534\naF0.2296390808940177\naF0.2598251304748991\naF0.09954109221285713\naa(lp5\nF0.20732700389459388\naF0.21305473486722604\naF0.21294382781217727\naF0.06865680944747446\naF0.10725831237107765\naF0.19075931160745077\naa(lp6\nF0.2297954228867666\naF0.2367485635487856\naF0.15052260523607736\naF0.1956077166617999\naF0.043656174236902184\naF0.1436695174296682\naa(lp7\nF0.10326168250090581\naF0.17400379417907183\naF0.2844900923545086\naF0.09369976527764753\naF0.23608636647241193\naF0.10845829921545436\naa(lp8\nF0.12451368080850421\naF0.21613940705636925\naF0.06307561503790944\naF0.24343981959715938\naF0.26580848625842945\naF0.0870229912416284\naa(lp9\nF0.1124591216832763\naF0.45399925626430065\naF0.23866315833576915\naF0.05090150774521849\naF0.13029398124131109\naF0.013682974730124352\naa(lp10\nF0.15387343389410107\naF0.19487846884127388\naF0.04081793880415149\naF0.18279199540532248\naF0.25860837608557224\naF0.1690297869695788\naa(lp11\nF0.19979578986496394\naF0.2440484059011639\naF0.07958889415219378\naF0.13004815738340778\naF0.20737100837014763\naF0.13914774432812288\naa(lp12\nF0.1898320147636066\naF0.26820464225214563\naF0.05070900101209785\naF0.15425692261379695\naF0.021148939497455305\naF0.31584847986089787\naa(lp13\nF0.10222949874718773\naF0.3946424916758177\naF0.07104509530277214\naF0.24233277028474867\naF0.0023788230064161063\naF0.18737132098305753\naasVdp\np14\nL5L\nsVid\np15\nccopy_reg\n_reconstructor\np16\n(cuuid\nUUID\np17\nc__builtin__\nobject\np18\nNtp19\nRp20\n(dp21\nVint\np22\nL337049673695725434307862774255817132647L\nsbsVd\np23\n(lp24\nL1L\naL-2L\naL2L\naL0L\naL2L\naL2L\naL1L\naL2L\naL1L\naL-1L\nasVrounds\np25\nL49950L\nsVscore\np26\nL-51L\nsVmove\np27\nVS\np28\nsVfitness\np29\nL-122304L\ns.'
,
b'(dp0\nVpc\np1\nL10L\nsVp\np2\n(lp3\n(lp4\nF0.2390113831005089\naF0.031013404586131676\naF0.17697973121325333\naF0.11320717580337347\naF0.10106279821251411\naF0.3387255070842185\naa(lp5\nF0.04358663907296538\naF0.3437140248407732\naF0.05257450348367596\naF0.1827512983883102\naF0.2123837812509382\naF0.16498975296333715\naa(lp6\nF0.03714055500902965\naF0.1821284452140362\naF0.28515309259966126\naF0.11191449821396128\naF0.09814215416566685\naF0.2855212547976447\naa(lp7\nF0.0707852469653016\naF0.26773077042926224\naF0.02925892843451494\naF0.46942844742851003\naF0.13115683015728127\naF0.03163977658512977\naa(lp8\nF0.08164920946932762\naF0.12126065918940977\naF0.3110211428535677\naF0.1958043126973618\naF0.2875715093749334\naF0.0026931664153996113\naa(lp9\nF0.23842805618483234\naF0.15603441277463923\naF0.11264285663022724\naF0.2262714954657378\naF0.20692489705715011\naF0.05969828188741321\naa(lp10\nF0.03164670964027899\naF0.31684380433820397\naF0.2741378385889028\naF0.11196473220552693\naF0.06607080911817038\naF0.1993361061089169\naa(lp11\nF0.16056831069931213\naF0.15839125936084344\naF0.1491272649703556\naF0.1424198201704794\naF0.30624688706469005\naF0.08324645773431932\naa(lp12\nF0.26822134707914647\naF0.011460392564964055\naF0.06416793062777634\naF0.14039251803323988\naF0.3037049310472038\naF0.21205288064766945\naa(lp13\nF0.20706130318976318\naF0.1071116175577477\naF0.3062328866280631\naF0.1740019251990169\naF0.09970092984174167\naF0.10589133758366735\naasVdp\np14\nL4L\nsVid\np15\nccopy_reg\n_reconstructor\np16\n(cuuid\nUUID\np17\nc__builtin__\nobject\np18\nNtp19\nRp20\n(dp21\nVint\np22\nL145239516378497778712649111806775153386L\nsbsVd\np23\n(lp24\nL-2L\naL1L\naL0L\naL1L\naL-3L\naL-1L\naL0L\naL3L\naL-1L\naL1L\nasVrounds\np25\nL49950L\nsVscore\np26\nL-38L\nsVmove\np27\nVP\np28\nsVfitness\np29\nL-136160L\ns.'
,
b'(dp0\nVpc\np1\nL10L\nsVdp\np2\nL7L\nsVp\np3\n(lp4\n(lp5\nF0.22875688393634808\naF0.15406657542239663\naF0.05291260802019634\naF0.17905137275604155\naF0.11113131970874375\naF0.27408124015627366\naa(lp6\nF0.024649739358508574\naF0.16301502578600932\naF0.29499292161995583\naF0.31176691742878204\naF0.16788645770107158\naF0.037688938105672434\naa(lp7\nF0.007362834459776361\naF0.21432402654524674\naF0.15195198629884074\naF0.20166429175119438\naF0.22033117635417362\naF0.20436568459076807\naa(lp8\nF0.10174888275496076\naF0.29432178648997365\naF0.26982678619782025\naF0.0170282509809243\naF0.2823588609969678\naF0.03471543257935339\naa(lp9\nF0.1049256806159501\naF0.14725528700542503\naF0.20044333795825722\naF0.17697530171850584\naF0.10111759285410844\naF0.26928279984775344\naa(lp10\nF0.14488038183024368\naF0.09459146992166147\naF0.24348689290299075\naF0.22946675367250396\naF0.11905881817862259\naF0.16851568349397758\naa(lp11\nF0.17064144817937762\naF0.2922067266659806\naF0.12993895332951325\naF0.23065145771299647\naF0.016999646334190256\naF0.15956176777794182\naa(lp12\nF0.13869874164346357\naF0.07959406836571101\naF0.22229339080853794\naF0.20858984532521646\naF0.16934376481311986\naF0.18148018904395116\naa(lp13\nF0.18197424730376693\naF0.06405011560346739\naF0.29788570030640454\naF0.05785866864090056\naF0.05222843504363028\naF0.34600283310183033\naa(lp14\nF0.2013616715244791\naF0.25136441261077264\naF0.006555872830203151\naF0.24672594840032352\naF0.21313719120511485\naF0.0808549034291068\naasVd\np15\n(lp16\nL0L\naL1L\naL1L\naL2L\naL2L\naL0L\naL1L\naL1L\naL-4L\naL1L\nasVrounds\np17\nL49950L\nsVscore\np18\nL-38L\nsVfitness\np19\nL-143251L\nsVmove\np20\nVR\np21\nsVid\np22\nccopy_reg\n_reconstructor\np23\n(cuuid\nUUID\np24\nc__builtin__\nobject\np25\nNtp26\nRp27\n(dp28\nVint\np29\nL78725300103735981782263754543973335162L\nsbs.'
]
vms = list(map(lambda code: pickle.loads(code), vms))
else:
def make():
pspace = [[random.random() for _ in range(nops)] for _ in range(naddr)]
for cell in pspace:
s = sum(cell)
for i in range(nops):
cell[i] /= s
return {
"p": pspace,
"pc": 0,
"dp": 0,
"score": 0,
"fitness": 0,
"rounds": 0,
"move": "S",
"id": uuid.uuid4(),
}
vms = [make() for _ in range(nvm)]
for vm in vms:
vm["score"] = 0
vm["d"] = [0 for _ in range(naddr)]
def randselect(P):
r = random.random()
for i in range(len(P)):
p = P[i]
if r < p:
return i
r -= p
return len(P) - 1
def encode(x):
if x == "S":
return 0
elif x == "P":
return 1
return 2
def decode(x):
x = x % 3
if x == 0:
return "S"
elif x == 1:
return "P"
else:
return "R"
def payoff(mymove, opponents):
if mymove == "R":
if opponents == "R":
return 0
elif opponents == "P":
return -1
else: #S
return 1
elif mymove == "P":
if opponents == "R":
return 1
elif opponents == "P":
return 0
else: #S
return -1
elif mymove == "S":
if opponents == "R":
return -1
elif opponents == "P":
return 1
else: #S
return 0
def step(vm):
def halt():
return vm["move"]
pspace = vm["p"]
pc = vm["pc"]
if pc >= len(pspace):
return halt()
dp = vm["dp"]
dspace = vm["d"]
data = dspace[dp]
opcode = randselect(pspace[pc])
vm["pc"] += 1
if opcode == 0:
dspace[dp] += 1
elif opcode == 1:
dspace[dp] -= 1
elif opcode == 2:
vm["dp"] = min(dp + 1, len(pspace) - 1)
elif opcode == 3:
vm["dp"] = max(dp - 1, 0)
elif opcode == 4:
return decode(data)
elif opcode == 5:
dspace[dp] = encode(input)
return None
def run():
for vm in vms:
if input != "":
vm["score"] += payoff(vm["move"], input)
vm["fitness"] += vm["score"]
vm["rounds"] += 1
vm["pc"] = 0
res = None
while res is None:
res = step(vm)
vm["move"] = res
return max(vms, key = lambda x: x["score"])["move"]
output = run()