Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ITERATIVE PRISONER’S DILEMMA.pdf
Binary file not shown.
Binary file added __pycache__/bad_guy.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/grudger.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/mainly_bad.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/mainly_nice.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/nice_guy.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/prisoners_dilemma.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/tit_for_2_tats.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/tit_for_tat.cpython-37.pyc
Binary file not shown.
14 changes: 14 additions & 0 deletions bad_guy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####

team_name = 'A2'
strategy_name = 'Bad guy'
strategy_description = 'Always betray.'

def move(my_history, their_history, my_score, their_score):
return 'b'
Binary file added bad_guy.pyc
Binary file not shown.
12 changes: 12 additions & 0 deletions grudger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
team_name = 'A2'
strategy_name = 'Grudger'
strategy_description = 'Starts with cooperation and once if the opponent betrays then always grudger betrays irrespective of the opponent move.'

def move(my_history, their_history, my_score, their_score):
if(len(my_history) == 0 and len(their_history) == 0):
return 'c'
if(my_history[-1] == 'c' and their_history[-1] == 'c'):
return 'c'
if(my_history[-1] == 'b' or their_history[-1] == 'b'):
return 'b'

Binary file added grudger.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions mainly_bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####

team_name = 'A5'
strategy_name = 'Mainly bad'
strategy_description = 'Mainly bad.'

def move(my_history, their_history, my_score, their_score):

if len(my_history) < 5:
return 'b'
else:
if len(my_history) % 2 == 0:
return 'c'
else:
return 'b'
Binary file added mainly_bad.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions mainly_nice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####

team_name = 'A4'
strategy_name = 'Mainly nice'
strategy_description = 'Mainly nice.'

def move(my_history, their_history, my_score, their_score):

if len(my_history) < 5:
return 'c'
else:
if len(my_history) % 2 == 0:
return 'c'
else:
return 'b'
Binary file added mainly_nice.pyc
Binary file not shown.
14 changes: 14 additions & 0 deletions nice_guy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
####
# Each team's file must define four tokens:
# team_name: a string
# strategy_name: a string
# strategy_description: a string
# move: A function that returns 'c' or 'b'
####

team_name = 'A1'
strategy_name = 'Nice guy'
strategy_description = 'Always co-operate.'

def move(my_history, their_history, my_score, their_score):
return 'c'
Binary file added nice_guy.pyc
Binary file not shown.
Binary file added outputs/all_startegy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/all_strategies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/bad_guy_and_tit_for_two_tats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/first.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/mainly_bad_grudger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/task_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/task_1_tournament.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/task_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/task_3_user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/tit_for_tat_grudger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading