few suggestions:- 1 - We can use a Queue for the players. That would look cleaner. 2 - We can first take all the input and then call a static method like initializeBoard() or something instead of first initializing the board and then setting the pieces, 3 - We can use a common abstract base class like BoardEntity(containing a pair for the coordinates and maybe an abstract method isValid() which could check if the cooridinates given for the snake and ladders is valid or not. It will be the opposite check for snake and ladders so they can take care of its implementation. ). This way, if the user provides an invalid input for either the snake or the ladder, then we can directly throw an exception even before we initialize the board(if we also use step 2 mentioned above). 4 - We could maybe use strategy pattern for the dice roll incase we want to add some variations im generating a random number or maybe use some bias for the outcome for the dice.
Where and how have you handled the following rule? There could be another snake/ladder at the tail of the snake or the end position of the ladder and the piece should go up/down accordingly.
No that is not possible. It's not proper snake and ladder design. At tail of the snake or up of the ladder should be ideal. Till now I didn't see such snake and ladder game 😅
@@LegitGamer2345 I didnt even realized till now anyway we can do this one. only difference what ever logic we written checking if snake is present or not in PlaySnakeAndLadder java file at line 39 we should make move to recursive function and we need to keep track last end position and keep on check till map values null either ladder or snake. But its just a type of problem but i never seen such game/ Thanks for pointing out
hi lava,where is your trello LLD video? Could find it, if there is not a video on it can you please create it in some 15-20mins of time, will be really helpful🙏🙏
Bhai Sahab pata nahi kaha se itna tada suggestion aa gya TH-cam se. Playlist dekh ke hi subscribe maar diya.
Thank you 😊😊
few suggestions:-
1 - We can use a Queue for the players. That would look cleaner.
2 - We can first take all the input and then call a static method like initializeBoard() or something instead of first initializing the board and then setting the pieces,
3 - We can use a common abstract base class like BoardEntity(containing a pair for the coordinates and maybe an abstract method isValid() which could check if the cooridinates given for the snake and ladders is valid or not. It will be the opposite check for snake and ladders so they can take care of its implementation. ). This way, if the user provides an invalid input for either the snake or the ladder, then we can directly throw an exception even before we initialize the board(if we also use step 2 mentioned above).
4 - We could maybe use strategy pattern for the dice roll incase we want to add some variations im generating a random number or maybe use some bias for the outcome for the dice.
Thank you will work on this 🙂
Great, if you use a queue and did in a BFS way then it will look more clean
@riddles4013, can you give little ideo on how you plan to do it with queue and BFS?
good video, easy to understand
Thank you 😄.. pls subscribe
Awesome !! Thanks
Great explanation bro.
Thank u
If you want it to be singletone, make sure your constructor in Entities is private.
Yes correct
Excellent Video Bro
Glad you enjoyed
Where and how have you handled the following rule?
There could be another snake/ladder at the tail of the snake or the end position of the ladder and the piece should go up/down accordingly.
No that is not possible.
It's not proper snake and ladder design.
At tail of the snake or up of the ladder should be ideal.
Till now I didn't see such snake and ladder game 😅
@@lavakumar_techie Actually it is there in the rules in the problem statement
@@LegitGamer2345 I didnt even realized till now anyway we can do this one.
only difference what ever logic we written checking if snake is present or not in PlaySnakeAndLadder java file at line 39 we should make move to recursive function and we need to keep track last end position and keep on check till map values null either ladder or snake.
But its just a type of problem but i never seen such game/
Thanks for pointing out
but this static singleton entities will not work if multiple games are getting played simultaneously , playername specifically
Yes this use case is not for Multi game
hi lava,where is your trello LLD video? Could find it, if there is not a video on it can you please create it in some 15-20mins of time, will be really helpful🙏🙏
Hi Trello is not asked mostly i didnt see anywhere thats the reason i didnt shared video
for a SDE1 Machine Coding round interview fresher what should be enough from system design point of view
Please ans
Basics of System design . high level stuff should be sufficient.
Can anyone tell me about MEESHO machine coding round for sde1 backend... NEED A URGENT HELP.
I have already uploading in the playlist you can see
Questions will be similar
@@lavakumar_techie Okay brother. Thanks a lot for your reply brother.
Video is nice, would've been even better if your english was better
Ok. I will try to improve next time. Pls subscribe 😃