diff --git a/src/main/java/org/bitbiome/classes/BlackJack.java b/src/main/java/org/bitbiome/classes/BlackJack.java index 60c33ec..9df3478 100644 --- a/src/main/java/org/bitbiome/classes/BlackJack.java +++ b/src/main/java/org/bitbiome/classes/BlackJack.java @@ -1,5 +1,7 @@ package org.bitbiome.classes; +import java.util.Random; + public class BlackJack { public enum Entity { @@ -66,4 +68,25 @@ public class BlackJack { if (entity == Entity.BOT) botPoints += points; if (entity == Entity.PLAYER) playerPoints += points; } + + public boolean botWantsToPlay() { + if (botIn) { + if (botPoints <= 10) { + return true; + } else if (botPoints <= 17) { + int r = new Random().nextInt(1, 9); + if (r <= 3) { + botIn = false; + return false; + } else { + return true; + } + } else { + botIn = false; + return false; + } + } else { + return false; + } + } }