Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void addWin(String s)
- {
- boolean nameExists = false;
- int nameKey = 0;
- for(int i=0; i < playerName.length; i++)
- {
- if (s.equals(playerName[i]))
- {
- nameExists = true;
- nameKey = i;
- }
- }
- if (nameExists==true)
- {
- gamesWon[nameKey] = gamesWon[nameKey] + 1;
- gamesPlayed[nameKey] = gamesPlayed[nameKey] + 1;
- System.out.println ("Is equal fires");
- sort();
- }
- else
- {
- playerName[playersAdded] = s;
- gamesWon[playersAdded] = 1;
- gamesPlayed[playersAdded] = 1;
- playersAdded++;
- System.out.println ("Is not equal fires");
- sort();
- }
- }
Add Comment
Please, Sign In to add comment