Jump to content

Quick Java Help.

PaincakesX
Go to solution Solved by madknight3,

Store the result in a variable and add 8 to the variable each time you roll an even number?

What can I use if I was to add 8 with 8 etc. For example, if a dice is rolled and gets an even number, then I want Java to add 8, and if the second time the dice gets another even number then add 8 again (8+8+8+8+8+etc.)

 

I was going to do 8++, but that is the same as 8+1.

 

Thanks for the help.

Link to comment
Share on other sites

Link to post
Share on other sites

if

number rolled = even

add 8

 

and you'd have to have even and number rolled defined of course 

 

idk do something like that i dont know java

1010011010/29A

Link to comment
Share on other sites

Link to post
Share on other sites

What can I use if I was to add 8 with 8 etc. For example, if a dice is rolled and gets an even number, then I want Java to add 8, and if the second time the dice gets another even number then add 8 again (8+8+8+8+8+etc.)

 

I was going to do 8++, but that is the same as 8+1.

 

Thanks for the help.

I think 8++ means add 8 every time.

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

8 += 8 ; ?

or

 

int x;

 

x = x+8;

CPU: Intel i5-4590 | Motherboard: Asus H97M-E | GPU: Sapphire Nitro R9 390 | RAM: 2x4Gb Kingston HyperX Fury Black | SSD: Sandisk Plus 240Gb HDD: Seagate 250Gb  | PSU: Seasonic G650 80+ Gold | Case: NZXT S340

I am who I am.

Link to comment
Share on other sites

Link to post
Share on other sites

I think 8++ means add 8 every time.

 

Nope. 8++ is 8+1.

CPU: Intel i5-4590 | Motherboard: Asus H97M-E | GPU: Sapphire Nitro R9 390 | RAM: 2x4Gb Kingston HyperX Fury Black | SSD: Sandisk Plus 240Gb HDD: Seagate 250Gb  | PSU: Seasonic G650 80+ Gold | Case: NZXT S340

I am who I am.

Link to comment
Share on other sites

Link to post
Share on other sites

Nope. 8++ is 8+1.

Ah. 

Judge a product on its own merits AND the company that made it.

How to setup MSI Afterburner OSD | How to make your AMD Radeon GPU more efficient with Radeon Chill | (Probably) Why LMG Merch shipping to the EU is expensive

Oneplus 6 (Early 2023 to present) | HP Envy 15" x360 R7 5700U (Mid 2021 to present) | Steam Deck (Late 2022 to present)

 

Mid 2023 AlTech Desktop Refresh - AMD R7 5800X (Mid 2023), XFX Radeon RX 6700XT MBA (Mid 2021), MSI X370 Gaming Pro Carbon (Early 2018), 32GB DDR4-3200 (16GB x2) (Mid 2022

Noctua NH-D15 (Early 2021), Corsair MP510 1.92TB NVMe SSD (Mid 2020), beQuiet Pure Wings 2 140mm x2 & 120mm x1 (Mid 2023),

Link to comment
Share on other sites

Link to post
Share on other sites

Store the result in a variable and add 8 to the variable each time you roll an even number?

 

 

8 += 8 ; ?
or
 
int x;
 
x = x+8;

 

 

Thanks! Both of you guys were right.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×