r/programminghelp • • Mar 30 '25

Answered Anything im doing wrong here?

Im trying to learn kotlin (to make Minecarft mods on fabric) and i've learnt some stuff but something doesnt work. heres my code:

fun main() {

var customers1 = 10

var customers2 = 15

var customers3 = 20

customers1 *=2 //20

customers2 *=4 //60

customers3 *=6 //120

customers1.plus(customers2) //80

customers2.plus(customers3) //200

println(customers3)

}

(It says 120 instead of 200, I'll take any advise)

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/iwanttosharestuff Apr 04 '25

Thank you very much! i probably sounded dum (since im a begginer) but you made it make sense.

So i just have to put the customersTotal var in println and thats what it should show

Edit: It worked, Thanks again to you and hardcorehtmlist. :D

1

u/kjerk Apr 05 '25

Not at all, these things don't necessarily make much sense until you've done them a few times. I'm glad it worked out for you, good luck with the modding that's a cool way to learn 🙂👍