Okay, legit answer this time:
I am a school student, and I don't have a PC, what I do have is a school-administrated, Google Chromebook.
These laptops are completely useless while administrated.
It's not I don't like the hassle of setting up a compiler and build system, it's that I literally can't, even if I wanted to!
Repl allows access to a VM that almost feels just like a normal machine. Yes, it has plenty of restrictions, and plenty of arbitrary decisions have been made, but it's a machine, one that I can install software on, and execute code on.
Repl has provided salvation to anyone in this situation, especially during the recent pandemic.
Currently, you are using C++'s comma operator, which is... practicially useless.
(x, y)
evaluates toy
, therefore,(XP, coins) == coins
; you're just returningcoins
, notXP
.Also,
XP
andcoins
are only mutated within the scope of the function, maybe you wanted to pass by reference?I'd suggest using a std::pair to return
XP
andcoins
at once.Example:
But more likely, you'd want a global player struct, and you'd mutate
experience
andcoins
as globals instead.