Skip to content
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
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Happy-ryan
Copy link

No description provided.

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant