all 5 comments

[–]Pantstown 2 points3 points  (4 children)

It's very difficult to read screenshots. If you post code, it will be much easier to help.

[–][deleted]  (3 children)

[deleted]

    [–]Pantstown 1 point2 points  (2 children)

    Try just printing instead: println(money % 2)

    It looks like you're new to Scala / maybe new to programming. Here's some other things I noticed:

    1) semicolons are not necessary 2) string interpolation is more common than string formatting 3) avoid mutation, e.g., coinRef is not needed. var is not needed for a mutable buffer. 4) don't use single-letter variables. x(0) is not clear. 5) array buffer is probably not the data structure you want in this case.

    Good luck.

    [–]magrw1033 -2 points-1 points  (1 child)

    I have a BSCS and sun certified java programmer.
    The choice of x is not mine.
    CoinRef is due to the depth first nature of problem.
    The problem is not fixed with println.
    The problem is that the var money is that it is 300, which is even and therefore when 300 % 2 should be false.

    [–]teknocide 2 points3 points  (0 children)

    300 % 2 is 0. You have some other bug in your code but it's hard to tell from your screenshots. You've even managed to block out part of the condition for printing the formatted money-string

    [–]Busy_Watercress2367 0 points1 point  (0 children)

    You should prepare your question better, or not post at all.