Hello all, so my Professor has set an assignment for me to complete. Here are the details on it:
He wants me to produce a game with tiles numbered 1 to N = 9 inclusive. Two players take turns, picking one tile at a time, and the first to make T = 15 from q = 3 tiles is the winner. If neither can make T, the game is a draw.
I must produce functions (requirements described below) which accept a list of integers n (1 ≤ n ≤ N) representing the tiles picked so far, and returns a valid tile (i.e not already picked).
The layout of the function is illustrated by agent_cat, which first makes a list of remaining tiles and then picks one at random:
q,N,T = 3,9,15
from random import choice
def agent_cat(nums):
remaining = list()
for n in range(1,N+1):
if not n in nums:
remaining.append(n)
return choice(remaining)
player1: Valid code which defeats "cat" strategy most of the time.
Extensive look-up tables, or accessing any external resource, is not allowed.
Thinking time limited to 10s per move. Please use the function names specified.
Now, I don't want the answers - I don't want it at all.
I am just looking for advice on how I could tackle this type of challenge. Like, where to start really... Hoping that the advice I get from here will act as a domino effect for me figuring out how to tackle this assignment.
Thank you for all the help in advance guys!
He wants me to produce a game with tiles numbered 1 to N = 9 inclusive. Two players take turns, picking one tile at a time, and the first to make T = 15 from q = 3 tiles is the winner. If neither can make T, the game is a draw.
I must produce functions (requirements described below) which accept a list of integers n (1 ≤ n ≤ N) representing the tiles picked so far, and returns a valid tile (i.e not already picked).
The layout of the function is illustrated by agent_cat, which first makes a list of remaining tiles and then picks one at random:
q,N,T = 3,9,15
from random import choice
def agent_cat(nums):
remaining = list()
for n in range(1,N+1):
if not n in nums:
remaining.append(n)
return choice(remaining)
player1: Valid code which defeats "cat" strategy most of the time.
Extensive look-up tables, or accessing any external resource, is not allowed.
Thinking time limited to 10s per move. Please use the function names specified.
Now, I don't want the answers - I don't want it at all.
I am just looking for advice on how I could tackle this type of challenge. Like, where to start really... Hoping that the advice I get from here will act as a domino effect for me figuring out how to tackle this assignment.
Thank you for all the help in advance guys!