From 5d468f820c210c514d63097e0b3b27710bc74183 Mon Sep 17 00:00:00 2001 From: elolugo Date: Tue, 9 May 2017 11:31:20 -0400 Subject: [PATCH 1/4] segunda prueba --- game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.py b/game.py index 0a2b99b..c731a4b 100644 --- a/game.py +++ b/game.py @@ -6,7 +6,7 @@ from generala import get_random_dice, valid_play, play_value -class Player():#segundo comentario de prueba +class Player():#asdasdasdasdprob def __init__(self, name): self.name = name From 960cad0eceebd091d773ec5f5e3c1ec24980bb70 Mon Sep 17 00:00:00 2001 From: elolugo Date: Tue, 9 May 2017 11:36:52 -0400 Subject: [PATCH 2/4] more branching tests --- game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.py b/game.py index c731a4b..c65848a 100644 --- a/game.py +++ b/game.py @@ -6,7 +6,7 @@ from generala import get_random_dice, valid_play, play_value -class Player():#asdasdasdasdprob +class Player():#more branching tests def __init__(self, name): self.name = name From e2aed91e87801c54466cab0265ce1324d9a8f943 Mon Sep 17 00:00:00 2001 From: elolugo Date: Tue, 9 May 2017 11:42:22 -0400 Subject: [PATCH 3/4] last branch test --- game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.py b/game.py index c65848a..3a55f44 100644 --- a/game.py +++ b/game.py @@ -6,7 +6,7 @@ from generala import get_random_dice, valid_play, play_value -class Player():#more branching tests +class Player():#last branching test def __init__(self, name): self.name = name From ea915d400906a83e96c60811ed347c1c08fb341a Mon Sep 17 00:00:00 2001 From: elolugo Date: Sat, 1 Jul 2017 11:11:14 -0400 Subject: [PATCH 4/4] terminado el proyecto SE --- .idea/generai.iml | 11 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 743 +++++++++++++++++++++++++++++++++++++++ game.py | 128 +++++-- game.pyc | Bin 0 -> 5573 bytes generai.py | 28 +- generala.pyc | Bin 0 -> 3539 bytes helper.pyc | Bin 0 -> 2826 bytes plugins/__init__.pyc | Bin 0 -> 148 bytes plugins/console.py | 6 +- plugins/console.pyc | Bin 0 -> 1287 bytes plugins/random_dicer.py | 2 +- plugins/random_dicer.pyc | Bin 0 -> 668 bytes plugins/se1.py | 26 ++ plugins/se2.py | 29 ++ plugins/serial_dicer.pyc | Bin 0 -> 1044 bytes plugins/while1.py | 10 + sandbox.py | 62 ++++ sandboxing.py | 32 ++ sandboxing.pyc | Bin 0 -> 1616 bytes 22 files changed, 1040 insertions(+), 55 deletions(-) create mode 100644 .idea/generai.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 game.pyc create mode 100644 generala.pyc create mode 100644 helper.pyc create mode 100644 plugins/__init__.pyc create mode 100644 plugins/console.pyc create mode 100644 plugins/random_dicer.pyc create mode 100644 plugins/se1.py create mode 100644 plugins/se2.py create mode 100644 plugins/serial_dicer.pyc create mode 100644 plugins/while1.py create mode 100644 sandbox.py create mode 100644 sandboxing.py create mode 100644 sandboxing.pyc diff --git a/.idea/generai.iml b/.idea/generai.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/generai.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..acc5f7d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..158a43c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..a3167f2 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,743 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + list + TIME_AVAILABLE + operator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496945152529 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/../../Info 2/sandbox.py + 62 + + + file://$PROJECT_DIR$/../../Info 2/sandbox.py + 67 + + + file://$PROJECT_DIR$/game.py + 102 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/game.py b/game.py index 3a55f44..c2b131d 100644 --- a/game.py +++ b/game.py @@ -1,12 +1,38 @@ -# -import sys import traceback from helper import print_scoresheets - from generala import get_random_dice, valid_play, play_value +"""Library necessary to copy the list "scoresheets" to pass by value to the plugin""" +from copy import deepcopy +"""Libraries necessary for timing the plugin's response""" +import signal +"""Library for displaying the winner""" +import operator +"""Libraries for sandboxing""" +from sandboxing import getPlay#for the sandboxing +TIME_AVAILABLE = 1#time available to compute the plugin's response + +class Timeout(): + """Timeout class using ALARM signal.""" + + class Timeout(Exception): + pass + + def __init__(self, sec): + self.sec = sec + + def __enter__(self): + signal.signal(signal.SIGALRM, self.raise_timeout) + signal.alarm(self.sec) + + def __exit__(self, *args): + signal.alarm(0) # disable alarm + + def raise_timeout(self, *args): + raise Timeout.Timeout() -class Player():#last branching test + +class Player():# def __init__(self, name): self.name = name @@ -31,18 +57,17 @@ class Game(): def __init__(self, nscoresheets): self.nscoresheets = nscoresheets self.nplayers = 0 - self.players_plugins = {} - self.players = [] + self.players_plugins = {} #the name of the file of the plugins + self.players = [] #the name() of the plugins self.scoresheets = [] for i in range(nscoresheets): self.scoresheets.append({}) - def add_player(self, player): - name = player.name() - self.players_plugins[name] = player - self.players.append(name) + def add_player(self, namePlayer,plugin): + self.players_plugins[namePlayer] = plugin + self.players.append(namePlayer) for i in range(self.nscoresheets): - self.scoresheets[i][name] = {} + self.scoresheets[i][namePlayer] = {} self.nplayers = self.nplayers + 1 def start(self): @@ -61,38 +86,65 @@ def start(self): def results(self): print_scoresheets(self.scoresheets) + """calculating the winner""" + total = {} + for player in self.players: + total[player] = 0 + for scoresheet in self.scoresheets: + for player in scoresheet: + for play, score in scoresheet[player].items(): + total[player] += score + print "The winner is!:",max(total.iteritems(),key=operator.itemgetter(1))[0] def turn(self, player): - plugin = self.players_plugins[player] - r = get_random_dice(5) + plugin = self.players_plugins[player]#name of the module + print "turn", plugin + r = get_random_dice(5)#obtain the dices as a list eg: [2,1,4,4,6] nroll = 5 - for i in range(3): + for i in range(3):#ith opportunity of the current player try: - bonus = (nroll == 5) - roll, decision, scoresheet = plugin.play(i, r, bonus, self.players, self.scoresheets) - decision = decision.upper() if decision else None - nroll = len(roll) - if nroll > 0: - r0 = get_random_dice(nroll) - i = 0 - for new_r in roll: - r[new_r] = r0[i] - i = i+1 - else: - if not valid_play(decision): - raise Exception('Play [{0}] is invalid'.format(decision)) - scoresheet = self.scoresheets[scoresheet][player] - if decision not in scoresheet: - scoresheet[decision] = play_value(decision, r, bonus) - else: - raise Exception('Decision [{0}] is already taken'.format(decision)) - break - - + """It executes the corresponding turn for the plugin with TIME_AVAILABLE seconds to decide""" + with Timeout(TIME_AVAILABLE): + bonus = (nroll == 5) + """ + The return parameters of the play function of the plugin should be: + roll: which dices should be re-rolled referencing the indexes of the r list + decision: the final decision of the turn as a string. The avalaible decisions are stated in helper.py + scorsheet: which scoresheet should the play be applied + """ + copyScoresheets = deepcopy(self.scoresheets)#make a copy of the scoresheets because we want to send them by value not by reference for safety + """getPlay from the sandboxing.py with the parameters + plugin: name of the file's plugin eg: serial_dicer.py + i: ith opportunity to throw again the dice + r: the dices itself + bonus: if that throw contains a bonus + player: the current players playing the game + Scoresheets: the poins currently assigned + """ + roll, decision, scoresheet = getPlay(plugin,i, r, bonus, self.players, copyScoresheets) + #roll, decision, scoresheet = plugin.play(i, r, bonus, self.players, copyScoresheets)<--reemplazado + decision = decision.upper() if decision else None + nroll = len(roll)#how many dices should be re-roll + if nroll > 0:#the player has decided re-roll again at least one dice + r0 = get_random_dice(nroll)#it obtains "nroll" new dices + i = 0 + for new_r in roll:#it updates the new dices list + r[new_r] = r0[i] + i = i+1 + else:#the player has decided that no dice shoul be re-rolled + if not valid_play(decision):#the player has not stated a valid play in the format stated in generala.py + raise Exception('Play [{0}] is invalid'.format(decision)) + scoresheet = self.scoresheets[scoresheet][player]#retrieve the plays that player has already played in that scoresheet + if decision not in scoresheet: + #The player adds a new play in that scoresheet + scoresheet[decision] = play_value(decision, r, bonus) + else: + raise Exception('Decision [{0}] is already taken'.format(decision)) + break + except Timeout.Timeout:#Times up for the ith opportunity + print "Plugin Timeout",plugin + break except Exception as e: print(traceback.format_exc()) print("Error inesperadamente inesperado: {0}".format(e)) # NOTIFY - - - diff --git a/game.pyc b/game.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a7dc9b184d54c77d598c711055cf2ad8c546e53 GIT binary patch literal 5573 zcmb_gO>Y~=8GdI;QKC%Aa^){2j>9x|&AN@{qHtX}LK-;|Bm=hLu3XDuEiBgLT3Ttj zOYJ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ky$n3R_vMGpQPAew+~P1zbDP(@^(^d1X|HY* z+p`GFdgEnW9M&^CNWzW|-LCIvSP<3+>0p?IMV$7vv^5*lSBts^wiBdh79zZ0n#P6A ziZsQoflDFNhDE_j)J*$UKQ9{YH)8Wv>d zf(G}V?(i7gIL`vm3wuWUvtG)Rcl)JTPbq9B5w`uspYLvZML!yTX?Tw|EVPFHH!P>-B0ENyxyg>|n@`y3Aq`?a w0Y@bs^wMaU*lqeY=N?Nqg_laTN-e0B@Ko^xwKDihfUK&bt$NFNR)bpb7wMg$wEzGB literal 0 HcmV?d00001 diff --git a/helper.pyc b/helper.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b55e32b0ee1de984001a445becbb67ffed40358 GIT binary patch literal 2826 zcmb_eUr!rH5T8B!&VRs=M6?Z0ZBisYKqG0C;4W06~;p8zhATb4nY+=>h;u-7jP1g5d8$B`e}IX)x97L#wTIDq5F{^hmjxF_q?GO^@3jgLUc$Oj-W9xyI$}T68#W_)S@c?Lz8H;Q*63K`*RE~A966Bzr9Bj z#o?=1w1+<~>N&RG)WbW@`2Z z7-Y!Q*p-Pvi9u(IjsKZwf+Cf&aHl{woEzc`YiMaczU!yY)*nqYZ+rbn#@FkU)HenN z-Y{m^aTuNVVw-nImVo$i;K>XEKK69X3esWs_&koez-6p>^ARHR2~?($(fu&;^r`2? z-M}AuCzudlNZnJ*N=|nfGPZM<=UyOi0O44f8bS*~i$YDIme7(=6mEdi$P%Z)3ddN2 zy~^AK1s$qT%@s`+=<=HK+GIsDAr=mK}>;IIpk}B zSaT3dAf+6#FObq4q$H4X4jBlfJO?QYq>@8^5lH1W1gQl3&a5m{39t*ajfU6qGsN}c zhF)E`xPJ>s+!)U)VprreR&FhmAYizsknl7@V@w(7mXwznxNA;l;25^d*1(0*lz{9~`wCa(fOB zerz}b+H14`Y3@j&m0S4T^d}2n9PRBqKX4jtnUv>3h-R&8YcCI8?ljldY~IjW0FjE+ z3Ww?C)L|5RuE+-7m6i+J8;!i7D-~Fe&mFFx&V3M@{fb$~?0#t^Gf{UV?KabHOK$fl z=v{e{mK!Lpc)H&UP^HD}<8ct2hGXrCzoT&AMFL9echJLWVY4vC3N7PIoy5<*J literal 0 HcmV?d00001 diff --git a/plugins/console.py b/plugins/console.py index f874508..17a102d 100644 --- a/plugins/console.py +++ b/plugins/console.py @@ -8,7 +8,7 @@ def name(): # this plugin uses console I/O to make plays def roll_dice_eval(roll_dice): - return [int(x) - 1 for x in roll_dice if x in string.digits] + return [int(x) - 1 for x in list(roll_dice)] def play(roll_no, dice, bonus, players, scoresheets): print_scoresheets(scoresheets) @@ -18,6 +18,6 @@ def play(roll_no, dice, bonus, players, scoresheets): if roll_dice: return roll_dice_eval(roll_dice), None, None else: - decision = input("jugada? ") - scoresheet = int(input("casilla {0}? ".format(str(list(range(len(scoresheets))))))) + decision = raw_input("jugada? ") + scoresheet = int(raw_input("casilla {0}? ".format(str(list(range(len(scoresheets))))))) return ([], decision, scoresheet) diff --git a/plugins/console.pyc b/plugins/console.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29905a48a7102ebc381ff36a5326261a4f85ffdd GIT binary patch literal 1287 zcmbtTO>Yx15FPL4qX}&VMM6CwlpA|uk+@Y=iv*}3p;X$O8VMq^Yf=}l9o7y|k(}TM z@HhB<`~Z04q>bpct6lGS?3sD*jh+74>Hpe0JS%DaB=|qa=T9(Hcm)}vTF_WfozOU; zI;C++g4YrjlWba0J!`H8Zskw)gzXy|-~9oqW5bk;kgp3E)-SF^HK{P$duM9EOtWM72z7{(MN zi55gZ1igIsfR=)SpoQQ$;O@Uq==07MYRxGkfmpz39|Fq+eOBHcCXF*@r55l0wxM== zRxJN@`iX-4+@C9cEa}$zi~N3L!sJ>^Mu5!)m_?>1uS2pXDd0ipKOyr0fej7_c3T)k z%Qh|A)SMC81%oBQW}=TNjRH=kS@%VU7TuT& zDOV?N=vl!63LXr;KV52Wm%oeQEy&s+n?WTj=Z^=TiC)a7vXYqWU{Xr2jgcI7Jjk}; zDL5LqfY&v(3m;rf92HyZLsM`_jBBKws^~V#W()z$ z*DbLwCXCmF13oxA_i=e<2pENgOD UyJ~LK5!a8+ekit+UZ {0} [{1}]".format(1, dice)) return (1, 2, 3) diff --git a/plugins/random_dicer.pyc b/plugins/random_dicer.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a175d46a1f4400c5048bc7b32706bcc824f0921d GIT binary patch literal 668 zcmb_Z!A=4(5S_Auit%8Ko>xy?pm6a-h{hPaxChi2G{!XB3f0{$w#7(rPx{CHfHMt| z$eB(0_GLOV@69y&*{wHEy2BI}AH)AC9(RZ!0loq5k+47*$O>FHBE0%na83mqRKW1M zf+TVKh*lKRs7XkZkf!!wEvqp~@zmzo*j)Gq zQBS7))D|XKCjXxFoU-p)n!qQSm?`W04#iVrl^ZMNou__cxxO`SjudHwZVLfe#OiF1 dCE+m#6d6!_sT|mvK^asV0ZC-|Me8Q$Ho3JHgkZc#J>Xy zpmJdBK;^>Nh024m2M#e8ln-McN)OHe#sQQ*J3T^q6yOr_7e0}Pp4~;$YFXP!DW}3- z|0|rlFO=QC7&6mF3o{qOn$d+e2k{{`YQwud%Pv**b$LJ$5iCc&|I-c%wM zs!_{X6Q^dXrERoq;v-QDU8o|Su_NOaXUN*bMrc_mma6ZzD@!@+q7u{_$_vhvHn@Y0 z##q=7bWqqPfDhkb?ZcBdUtrUNbq_4SM}S+KkV>--VG)9U2s19?I)HZ`pB name() or play(). In the case of play we send the corresponding values needed +""" +def getName(plugin): + modulo = "plugins/" + plugin + try: + output = (subprocess.check_output(["python","sandbox.py",modulo,"name"], stderr=subprocess.STDOUT)).strip("\n") + return output + except subprocess.CalledProcessError as e: + print "Ocurrio un error en el sandboxing" + print "El error es el sgte:\n", e.output + +def getPlay(plugin,roll_no,dice,bonus,players,scoresheets): + modulo = "plugins/" + plugin + try: + output = (subprocess.check_output(["python","sandbox.py",modulo,"play",str(roll_no),str(dice),str(bonus),str(players),str(scoresheets)], stderr=subprocess.STDOUT)).strip("\n") + #parsing the output + variable = output[1:-1] + variable = variable.replace(" ", "") + nueva = variable.split(",") + roll=ast.literal_eval(nueva[0]) + decision=ast.literal_eval(nueva[1]) + scoresheet=ast.literal_eval(nueva[2]) + return list(roll), str(decision), int(scoresheet) + except subprocess.CalledProcessError as e: + print "Ocurrio un error en el sandboxing" + print "El error es el sgte:\n", e.output diff --git a/sandboxing.pyc b/sandboxing.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4667c7e527cdb98c343b84cb888f1e46455391d GIT binary patch literal 1616 zcmb_cOKuZE5Uuvu@h3Jxe1t$O3@q>huvj1@gb-4Q!YZH%-)u&cnZ|B2p0>Js5RvQ^ z+=ydv4Q{{z;8l$cL1G6^y7E$8Rb8J~j=m3iU%$M1o6-8yz~9F>ejg&oucCtJ=oeOW zq$qFDXDAz#M*mDgEb{}OgG>Q7aauULIDQU+N0vmF zR*FvUQ6QSh69~QpXwn41TcU3uteQoXZ*lxpgO&|Cd|lq8CVL@)9=R#0RYWRp)Be-E zL;K5!W-Z`S(Hj(WIO^iX1K)vM6xGC(ejGT##Yvdj()R#;TIR?0;~l6t*D{@JG4UbS z&Uvn(=dVFN%PQxL9aiNK7uF3mKrvkVn{whW!fLPB+*ghcBKyd-)=8$9!;R5zYbarbVIi=e6G+zb&@4+laHSi;@Zj&TU>5 zHs-nmSD;4_B*NbZ8c*$9k9A?;V#j+vb0%06H{RE!c4?80Cj!j)cX`~QHhd>K9H2=N zpg#jas;44#TXobq)lwO^m(|-iGW4rRU^DbBI{EhJ(6@N#0mD^1Wd=NV0nr9DH$a#+ z>24Up1`14AGo($+Hh~Ht!nIY0mL29o4(lF$YS3DP_qI9Qs!OP51~VA+=`yQ&r&R4) zwS7u8s8xLmU0Nb$oux#>Y?po3yo*k8bXz!jNvYKU96iGv-2q1jH0z({=vj2?PmadW z(BIg(DAJRd*S6-R;n~Wv$&`m!jP<~88HPqo|CPK0M2dObu~1D0A6(2Fjd|L_3a61< zrfcRd3KIg`r9KGH@juf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