MntungwaXT 0 Newbie Poster

Hey guys.

I hope you are well. I a a newbie programer just started a few months ago. I need help with mu project. We are supposed to code an Ai player for the game Oware on python. There was a player given to us which we can adit to make the logic of the player better.
The code given to us is as follows...

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 26 18:18:07 2011

STUDENT AI PLAYER:
------------------
Edit this file to create your AI player
    - do not change the file name or function name
    - you may include additional functions in the ai_player1.py file
    - only 1 file can be uploaded, so keep all your functions in this file
    - remember to add your group's information in the meta data section of
      this file
    - test your AI player properly before uploading it to Click-UP

Do not edit the ai_player2.py file
Also do not edit any other files
"""
# ------------------ META DATA ---------------------------
__group_name__ = "Add your group name here"
#Edit the following list and add all team names
__authors__ = ["John Doe", "Jane Doe"]
#Edit the following list and add all student numbers
__student_ids__ = ["u12345678", "u12345678"]
#edit the following version number for each version of ur AI
__version__ = "v1.0"
# --------------------------------------------------------

import random


def ai_player(pots, scoring_pits, turn, valid_moves):
    """
    Input:
        pots: list of pot values for each player, e.g:
              [[4, 4, 4, 4, 4, 4],   <-- always current player
               [4, 4, 4, 4, 4, 4]]   <-- always opponent
        scoring_pits: list of scoring pit values - [0, 0]
        turn: integer turn counter (starts from 1)
        valid_moves: list of valid moves (indexes), e.g:
                     [0, 1, 2, 3, 4, 5]

    Return:
        pot index --> 0 to 5
                  --> pot value can't be zero
                  --> must be an integer object
    """

    # choose a random move to make from the valid_moves list
    ind = random.choice(valid_moves)
    return ind

Help with this will be greatly apreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.