@smarty_pants group things by what they are related to, not by the type they are. i.e. don't create a package for all exceptions, don't create a package for all services, etc. rather create a package for your application-specific things and one for the more generic Chutes and Ladders domain model
ladderMap and chuteMap could be just a single map. Source and destination. If destination > source, it's a ladder, if destination < source, it's a chute.
@smarty_pants Only make constants and loggers static (and final). That's it.
@smarty_pants I would recommend considering maybe make it a property on the player instead of the board. As multiple players can be on a chute/ladder at the same time(?)
or.... errr... the player is teleported directly to their destination... hrrm...
Yeah true, but at the end of the day all i need is the position before they got on the ladder or chute, position they were on, and the next position they got teleported to
so i thought having a gameboard would be a better bet to hold these values rather than putting this on the player
@smarty_pants but for how long do you need the information about if a ladder/chute was used, and from where? Does it need to be persisted in the game state, or can it be passed between methods?
I would recommend passing it around instead of persisting it. If nothing else, to get more practice in passing data around. And to reduce the confusion when looking at the GameBoard class (because it really did look like it was only supporting one chute and one ladder)
@IvenBach @Summer TIL: The TV-children-show Raggy Dolls was not a Swedish invention. I see now though that it was British, but I wonder... Have you heard about it in the U.S.?
@smarty_pants The difference is that you will be using memory on the stack instead of on the heap
@smarty_pants When a move has been performed, then you can create an object with the information about what move was performed, and if it was a ladder/chute being used, from where and to where, etc. then you return that move object, and make sure that it is passed to the method printing the players.
@smarty_pants Only recursive calls I can see is when you are re-rolling dice for players, and that should not be deep enough to cause a stack overflow error
I will once i get more and more comfortable with java. i am definitely getting there but i want to get really good at the language first from a oop design perspective
I feel like i am little bit behind the curve when it comes to someone with 3.5 years of xp so im just trying to close the gap.
thank you so much for doing this. i appreciate it.
what did you think about the reroll logic or the logic of the game in general? was it easy to follow and undertand?
@smarty_pants Worst part was that it was so spread out in multiple different classes. I would have preferred having mainly a Player class and a GameBoard class.