@Korkin/

Board game investor

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.*;

class Main {
  public static void main(String[] args) {
    int investA = 10000;
    int investB = 10000;
    Random r = new Random();
    int cycles = 1000000;
    for(int i = 0; i<cycles; i++){
      int thisroll = r.nextInt(6)+1;
      investA*=1.01;
      if(thisroll==1)investB*=0.98;
      else if(thisroll==2)investB*=0.98;
      else if(thisroll==3)investB*=1;
      else if(thisroll==4)investB*=1.03;
      else if(thisroll==5)investB*=1.04;
      else if(thisroll==6)investB*=1.1;
      else{System.out.println("Error");}
    }
    System.out.println(investA);
    System.out.println(investB);
  }
}