Milos Milosavljevic

Greenhorn
+ Follow
since Aug 16, 2022
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Milos Milosavljevic

This is literally my first OOP exercise and I have no prior experience with proper programming. So I don't even know most of the syntax.
I used the code given in HFJ and the solution in this thread.

I pulled the int scanner from another exercise to try it out here.
So, would be great if you could explain what you meant in more detail. I'll research it in any case

Thank you

Campbell Ritchie wrote:Welcome to the Ranch, MM

I don't like while (true) ... I would prefer to see a predicate used in the loop.

2 years ago
This was useful.

I tweaked the Player class so that a user can input the guessed numbers.


And I moved the printout of the target number after user entry, so that people can't see the number until it's guessed correct

         

It's also fun to move the int primitive into the while loop, so that you get a different number to guess after every failed attempt by the players.

2 years ago