好的,所以我先显示我的代码,然后我会解释我需要帮助的内容.
Random isServerChance = new Random();
Random isGood = new Random();
Random isBad = new Random();
// Some IDs which are considered "Good"
int isGoodTable[] =
{ 1038, 1040, 1042, 1044 };
// Some IDs which are considered "Bad"
int isBadTable[] =
{ 6570, 6585, 952, 969 };
// Based on this roll, will pick which cat is used. Good, or Bad.
int isServerRoll = isServerChance.nextInt(6);
// If it's > 3 it's going to be a "Good" item, if it's …Run Code Online (Sandbox Code Playgroud) 我想知道是否有可能编造一个命令,让我们说我们有一个Scanner.
这是一个例子:
Scanner INPUT = new Scanner(System.in);
int IsPoints = 0;
String isValue = INPUT.nextLine();
if (isValue.equalsIgnoreCase("give"){
isPoints += The int value you want here;
}
Run Code Online (Sandbox Code Playgroud)
所以我真正的问题是,是否可以int通过String命令增加点的值?
输出,如果有效,将给出X(你想要的点数= x)
所以,如果我确实给了5000我5000得分,那可能吗?
谢谢