@Test public void testNextSmallBlind() { assertEquals(20, TournamentTools.getNextSmallBlind(10)); assertEquals(200, TournamentTools.getNextSmallBlind(100)); assertEquals(500, TournamentTools.getNextSmallBlind(200)); assertEquals(1000, TournamentTools.getNextSmallBlind(500)); assertEquals(2000, TournamentTools.getNextSmallBlind(1000)); }
public static int getNextSmallBlind(int maxSmallBlind) { if (maxSmallBlind == 0) { return 100; } int result = maxSmallBlind; int exp = 0; while(result % 10 == 0) { exp++; result /= 10; } if (result == 2) { result = 5; } else { result *= 2; } while(exp > 0) { exp--; result *= 10; } return result; }
TournamentTools { public static int getNextSmallBlind(int maxSmallBlind) { if (maxSmallBlind == 0) { return 100; } int result = maxSmallBlind; int exp = 0; while(result % 10 == 0) { exp++; result /= 10; } if (result == 2) { result = 5; } else { result *= 2; } while(exp > 0) { exp--; result *= 10; } return result; } }
TournamentTools { public static int getNextSmallBlind(int maxSmallBlind) { if (maxSmallBlind == 0) { return 100; } int result = maxSmallBlind; int exp = 0; while(result % 10 == 0) { exp++; result /= 10; } if (result == 2) { result = 5; } else { result *= 2; } while(exp > 0) { exp--; result *= 10; } return result; } private  TournamentTools(); }
TournamentTools { public static int getNextSmallBlind(int maxSmallBlind) { if (maxSmallBlind == 0) { return 100; } int result = maxSmallBlind; int exp = 0; while(result % 10 == 0) { exp++; result /= 10; } if (result == 2) { result = 5; } else { result *= 2; } while(exp > 0) { exp--; result *= 10; } return result; } private  TournamentTools(); static int getBigBlind(int smallBlind); static int getNextSmallBlind(int maxSmallBlind); }
TournamentTools { public static int getNextSmallBlind(int maxSmallBlind) { if (maxSmallBlind == 0) { return 100; } int result = maxSmallBlind; int exp = 0; while(result % 10 == 0) { exp++; result /= 10; } if (result == 2) { result = 5; } else { result *= 2; } while(exp > 0) { exp--; result *= 10; } return result; } private  TournamentTools(); static int getBigBlind(int smallBlind); static int getNextSmallBlind(int maxSmallBlind);  }