Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create avgTFT.py #96

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions code/exampleStrats/avgTFT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tit for tat, but averages history instead of just copying whatever was last.
# Just like normal TFT, cooperates on first round
#
# Created by Aquateraneal

def strategy(history, memory):
choice = 1
if history.shape[1]:
choice = round(sum(history[1])/len(history[1]))
return choice, None
14 changes: 14 additions & 0 deletions code/exampleStrats/investigator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import random
import numpy as np

# Investigator strategy
# On the first twenty-four turns, goes through the eight possible trios of moves.
# Then, for each twenty-four turns after that, plays those moves in a random order.
# The best strat from the previous go-through gets boosted by 1, and the worst gets removed.
#
# By Aquateraneal

def strategy(history, memory):
gamelen = history.shape[1]
if not gamelen % 24:
pass