samedi 31 mars 2018

Not sure how to implement this interface

So I'm a little confused about how to implement this interface the right way:

A MasterMind computer player must, at a minimum, return a valid Guess:

public interface MasterMindAI
{
   public Guess nextGuess();
}

MasterMindAIRandom The simplest way to implement the interface is to populate the List of color ids with four random integers from 1 to 7 and to return the associated Guess. This is actually a useful class as it allows you to find bugs related to incorporating the AI into the MasterMind game rather than bugs in the AI itself.

So I understand everything about the list and how to populate it. I'm just confused about how to implement the interface the right way. So my MasterMindAIRandom class has to have a method called Guess nextGuess that creates a List of random numbers, yes? But the return type is of type Guess and the List is a list of ints. How exactly am I suppose to return the Guess?

Aucun commentaire:

Enregistrer un commentaire