package elo;
import java.util.Random;
import javax.swing.JOptionPane;
public class Main {
public static void main(String [] args){
double playerA = 1000;
double playerB = 1000;
while(Integer.parseInt(JOptionPane.showInputDialog("1 oder 0")) != 0){
Random rm = new Random();
int a = rm.nextInt(2);
int b = 0;
if(a == 0){
System.out.println("Player B won!");
b = 1;
}else{
System.out.println("Player A won!");
}
double Ea = 1/(1+Math.pow(10,((playerB - playerA)/400)));
int Ra = (int) (playerA + 10*(a-Ea));
int Rb = (int) (playerB + 10*(b-(1-Ea)));
System.out.println("Player A: " + Ra);
System.out.println("Player B: " + Rb);
playerA = Ra;
playerB = Rb;
}
}
}