-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[다리건너니] 김성한 미션 제출합니다. #10
Open
Happy-ryan
wants to merge
8
commits into
bark20:main
Choose a base branch
from
Happy-ryan:Happy-ryan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implemented the core functionality of the game, allowing users to input bridge length and move through the bridge, checking if the user can successfully cross the bridge based on their move choices. Also, added restart/quit options. - Implemented InputView class for bridge length and player move input - Validated if the input is a number - Validated if the number is between 3 and 20 (inclusive) - Partially implemented OutputView class - Displays game start message - Displays instructions for choosing move direction - Implemented basic structure for Game class - Includes properties for restart/quit - Implemented Bridge class - Includes property for bridge length - Generates random values (0 or 1) to represent valid move directions - Implemented User class - Includes property for move direction (U/D) - Implemented move functionality with validation - Allows moving to a valid direction (U/D) - Prevents moving to an invalid direction - Handles not choosing a direction gracefully - Displays current progress on the bridge - Added initial documentation in the readme file.
- Added readBridgeSize for user input, continuously prompting until valid - Utilized inputBridgeSize to handle input and validation - Implemented validateNumber for input validation - Accepts only numeric characters (0-9) - Throws IllegalArgumentException for non-natural numbers or values outside the range 3 to 20.
…andling - Added methods for continuous user input of move direction (U/D) and game commands (R/Q) - Utilized input handling methods with validation for a more user-friendly experience.
- Added methods to print game start, end, and try messages - Introduced constants for consistent message strings - Defined success and fail messages for game results.
- Added BridgeMaker class responsible for generating bridges based on the specified length - Utilized BridgeNumberGenerator for random number generation - Implemented makeBridge method to create a bridge with U (up) and D (down) positions - Introduced judgeUpDown method for determining whether a bridge section is U or D.
- Added BridgeGame class representing a single game session - Implemented move method for user movements on the bridge - Updates upBridge and downBridge lists based on the user's move - Handles successful and unsuccessful moves with O and X - Implemented isPossibleMove method to check if the user's move is valid - Added retry method (currently empty) for game restart functionality - Introduced upBridge and downBridge lists to track the user's progress on the bridge.
- Added BridgeGameController class responsible for controlling the bridge game flow - Implemented run method for running the game loop until completion or user quits - Utilized BridgeGame class for managing a single game session - Implemented play method for executing the main game logic - Uses InputView to read user inputs for moving and game commands - Updates and prints the game state through OutputView - Handles game end conditions and prints final results.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.