import cs1.Keyboard; import inlupp3.*; public class QuestionGame{ private int antalspelare=0; //antalet spelare från start 0 private int[] antalraett; //räkna antal rätt i en array private fragesamling saml; //känner till frågesamlingen public QuestionGame(fragesamling saml){ this.saml=saml; //anropar sig själv för att deffa saml } //konstruktorn public void spela(int as,int af) //ej returneras { antalspelare=as; antalraett = new int[as]; //lägger in antalraett i arrayen for (int s=0;s max)) max = antalraett[i]; } String str= ""; boolean first = false; for (int z=0;z < antalspelare; z++){ if (antalraett[z] == max) if(!first){ str+= "Spelare " +(z+1) + " mest rätt \n"; first = true; } else str+= "& även spelare " + (z+1) + "\n"; }//for return str; }//vemvann }//qgame