From 863835c851f831ededff10ed8978e2e1cbd0c72f Mon Sep 17 00:00:00 2001 From: taxicomics <168220579+taxicomics@users.noreply.github.com> Date: Fri, 26 Apr 2024 20:56:46 +0000 Subject: [PATCH] added lil_devil --- __pycache__/contenders.cpython-310.pyc | Bin 966 -> 1201 bytes contenders.py | 27 ++++++++++++++++++++++++- main.py | 4 ++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/__pycache__/contenders.cpython-310.pyc b/__pycache__/contenders.cpython-310.pyc index 3aea42e7a7fca6f55014d8e86c087be4853889e8..835021dbc525a2e03bcd86c38de908cdecc79985 100644 GIT binary patch delta 277 zcmX@czLAqJpO=@50SNL$bka=tCi2NJ+Dz0o;pIxe!pA&Wnn|+0 z*axUGg|UWFf}xfvg{hXggrSC^nK6Yqo25vph9QMTlA(r4lA&0kgmD2=3UdnULZ%e9 zY=$B^klGsNV1^WSC=KOna`+W70nKzPVg!;e{{ul0ACOhV40: + #what to do if this is NOT the first round + if not game_data[-1][opponent_nr]: + if random.randint(0,10)<6: + choice=False + else: + choice=True + #this example always does the opposite of what the opponent did last round + else: + #what to do in the first round + choice=False + #this example starts with a cooperation + + #your cool code ended here + return choice diff --git a/main.py b/main.py index f3c4e68..7c29127 100644 --- a/main.py +++ b/main.py @@ -18,8 +18,8 @@ nr_of_games=300#int(input("How many games should be played?")) #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Put YOUR functions down below #XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -function1=contenders.random_positive_leaner -function2=contenders.random_negative_leaner +function1=contenders.lil_devil +function2=contenders.lil_devil for i in range(nr_of_games): helper_functions.play_game( games,function1,function2,nr_of_rounds)