-
Notifications
You must be signed in to change notification settings - Fork 0
✨[FEAT]: 필수 구현 과제 1 #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
324 changes: 324 additions & 0 deletions
324
SpartBaseBallGame/SpartBaseBallGame.xcodeproj/project.pbxproj
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,324 @@ | ||
| // !$*UTF8*$! | ||
| { | ||
| archiveVersion = 1; | ||
| classes = { | ||
| }; | ||
| objectVersion = 77; | ||
| objects = { | ||
|
|
||
| /* Begin PBXBuildFile section */ | ||
| 7F29CF472E5D71FE006ACFC9 /* LogMacro in Frameworks */ = {isa = PBXBuildFile; productRef = 7F29CF462E5D71FE006ACFC9 /* LogMacro */; }; | ||
| /* End PBXBuildFile section */ | ||
|
|
||
| /* Begin PBXCopyFilesBuildPhase section */ | ||
| 7F29CF002E5D71D0006ACFC9 /* CopyFiles */ = { | ||
| isa = PBXCopyFilesBuildPhase; | ||
| buildActionMask = 2147483647; | ||
| dstPath = /usr/share/man/man1/; | ||
| dstSubfolderSpec = 0; | ||
| files = ( | ||
| ); | ||
| runOnlyForDeploymentPostprocessing = 1; | ||
| }; | ||
| /* End PBXCopyFilesBuildPhase section */ | ||
|
|
||
| /* Begin PBXFileReference section */ | ||
| 7F29CF022E5D71D0006ACFC9 /* SpartBaseBallGame */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SpartBaseBallGame; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| /* End PBXFileReference section */ | ||
|
|
||
| /* Begin PBXFileSystemSynchronizedRootGroup section */ | ||
| 7F29CF042E5D71D0006ACFC9 /* SpartBaseBallGame */ = { | ||
| isa = PBXFileSystemSynchronizedRootGroup; | ||
| path = SpartBaseBallGame; | ||
| sourceTree = "<group>"; | ||
| }; | ||
| /* End PBXFileSystemSynchronizedRootGroup section */ | ||
|
|
||
| /* Begin PBXFrameworksBuildPhase section */ | ||
| 7F29CEFF2E5D71D0006ACFC9 /* Frameworks */ = { | ||
| isa = PBXFrameworksBuildPhase; | ||
| buildActionMask = 2147483647; | ||
| files = ( | ||
| 7F29CF472E5D71FE006ACFC9 /* LogMacro in Frameworks */, | ||
| ); | ||
| runOnlyForDeploymentPostprocessing = 0; | ||
| }; | ||
| /* End PBXFrameworksBuildPhase section */ | ||
|
|
||
| /* Begin PBXGroup section */ | ||
| 7F29CEF92E5D71D0006ACFC9 = { | ||
| isa = PBXGroup; | ||
| children = ( | ||
| 7F29CF042E5D71D0006ACFC9 /* SpartBaseBallGame */, | ||
| 7F29CF032E5D71D0006ACFC9 /* Products */, | ||
| ); | ||
| sourceTree = "<group>"; | ||
| }; | ||
| 7F29CF032E5D71D0006ACFC9 /* Products */ = { | ||
| isa = PBXGroup; | ||
| children = ( | ||
| 7F29CF022E5D71D0006ACFC9 /* SpartBaseBallGame */, | ||
| ); | ||
| name = Products; | ||
| sourceTree = "<group>"; | ||
| }; | ||
| /* End PBXGroup section */ | ||
|
|
||
| /* Begin PBXNativeTarget section */ | ||
| 7F29CF012E5D71D0006ACFC9 /* SpartBaseBallGame */ = { | ||
| isa = PBXNativeTarget; | ||
| buildConfigurationList = 7F29CF092E5D71D0006ACFC9 /* Build configuration list for PBXNativeTarget "SpartBaseBallGame" */; | ||
| buildPhases = ( | ||
| 7F29CEFE2E5D71D0006ACFC9 /* Sources */, | ||
| 7F29CEFF2E5D71D0006ACFC9 /* Frameworks */, | ||
| 7F29CF002E5D71D0006ACFC9 /* CopyFiles */, | ||
| ); | ||
| buildRules = ( | ||
| ); | ||
| dependencies = ( | ||
| ); | ||
| fileSystemSynchronizedGroups = ( | ||
| 7F29CF042E5D71D0006ACFC9 /* SpartBaseBallGame */, | ||
| ); | ||
| name = SpartBaseBallGame; | ||
| packageProductDependencies = ( | ||
| 7F29CF462E5D71FE006ACFC9 /* LogMacro */, | ||
| ); | ||
| productName = SpartBaseBallGame; | ||
| productReference = 7F29CF022E5D71D0006ACFC9 /* SpartBaseBallGame */; | ||
| productType = "com.apple.product-type.tool"; | ||
| }; | ||
| /* End PBXNativeTarget section */ | ||
|
|
||
| /* Begin PBXProject section */ | ||
| 7F29CEFA2E5D71D0006ACFC9 /* Project object */ = { | ||
| isa = PBXProject; | ||
| attributes = { | ||
| BuildIndependentTargetsInParallel = 1; | ||
| LastSwiftUpdateCheck = 1640; | ||
| LastUpgradeCheck = 1640; | ||
| TargetAttributes = { | ||
| 7F29CF012E5D71D0006ACFC9 = { | ||
| CreatedOnToolsVersion = 16.4; | ||
| }; | ||
| }; | ||
| }; | ||
| buildConfigurationList = 7F29CEFD2E5D71D0006ACFC9 /* Build configuration list for PBXProject "SpartBaseBallGame" */; | ||
| developmentRegion = en; | ||
| hasScannedForEncodings = 0; | ||
| knownRegions = ( | ||
| en, | ||
| Base, | ||
| ); | ||
| mainGroup = 7F29CEF92E5D71D0006ACFC9; | ||
| minimizedProjectReferenceProxies = 1; | ||
| packageReferences = ( | ||
| 7F29CF452E5D71FD006ACFC9 /* XCRemoteSwiftPackageReference "LogMacro" */, | ||
| ); | ||
| preferredProjectObjectVersion = 77; | ||
| productRefGroup = 7F29CF032E5D71D0006ACFC9 /* Products */; | ||
| projectDirPath = ""; | ||
| projectRoot = ""; | ||
| targets = ( | ||
| 7F29CF012E5D71D0006ACFC9 /* SpartBaseBallGame */, | ||
| ); | ||
| }; | ||
| /* End PBXProject section */ | ||
|
|
||
| /* Begin PBXSourcesBuildPhase section */ | ||
| 7F29CEFE2E5D71D0006ACFC9 /* Sources */ = { | ||
| isa = PBXSourcesBuildPhase; | ||
| buildActionMask = 2147483647; | ||
| files = ( | ||
| ); | ||
| runOnlyForDeploymentPostprocessing = 0; | ||
| }; | ||
| /* End PBXSourcesBuildPhase section */ | ||
|
|
||
| /* Begin XCBuildConfiguration section */ | ||
| 7F29CF072E5D71D0006ACFC9 /* Debug */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| ALWAYS_SEARCH_USER_PATHS = NO; | ||
| ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; | ||
| CLANG_ANALYZER_NONNULL = YES; | ||
| CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; | ||
| CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; | ||
| CLANG_ENABLE_MODULES = YES; | ||
| CLANG_ENABLE_OBJC_ARC = YES; | ||
| CLANG_ENABLE_OBJC_WEAK = YES; | ||
| CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| CLANG_WARN_BOOL_CONVERSION = YES; | ||
| CLANG_WARN_COMMA = YES; | ||
| CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| CLANG_WARN_DOCUMENTATION_COMMENTS = YES; | ||
| CLANG_WARN_EMPTY_BODY = YES; | ||
| CLANG_WARN_ENUM_CONVERSION = YES; | ||
| CLANG_WARN_INFINITE_RECURSION = YES; | ||
| CLANG_WARN_INT_CONVERSION = YES; | ||
| CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; | ||
| CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; | ||
| CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| COPY_PHASE_STRIP = NO; | ||
| DEBUG_INFORMATION_FORMAT = dwarf; | ||
| DEVELOPMENT_TEAM = N94CS4N6VR; | ||
| ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| ENABLE_TESTABILITY = YES; | ||
| ENABLE_USER_SCRIPT_SANDBOXING = YES; | ||
| GCC_C_LANGUAGE_STANDARD = gnu17; | ||
| GCC_DYNAMIC_NO_PIC = NO; | ||
| GCC_NO_COMMON_BLOCKS = YES; | ||
| GCC_OPTIMIZATION_LEVEL = 0; | ||
| GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| "DEBUG=1", | ||
| "$(inherited)", | ||
| ); | ||
| GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| GCC_WARN_UNUSED_FUNCTION = YES; | ||
| GCC_WARN_UNUSED_VARIABLE = YES; | ||
| LOCALIZATION_PREFERS_STRING_CATALOGS = YES; | ||
| MACOSX_DEPLOYMENT_TARGET = 15.5; | ||
| MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; | ||
| MTL_FAST_MATH = YES; | ||
| ONLY_ACTIVE_ARCH = YES; | ||
| SDKROOT = macosx; | ||
| SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; | ||
| SWIFT_OPTIMIZATION_LEVEL = "-Onone"; | ||
| }; | ||
| name = Debug; | ||
| }; | ||
| 7F29CF082E5D71D0006ACFC9 /* Release */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| ALWAYS_SEARCH_USER_PATHS = NO; | ||
| ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; | ||
| CLANG_ANALYZER_NONNULL = YES; | ||
| CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; | ||
| CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; | ||
| CLANG_ENABLE_MODULES = YES; | ||
| CLANG_ENABLE_OBJC_ARC = YES; | ||
| CLANG_ENABLE_OBJC_WEAK = YES; | ||
| CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| CLANG_WARN_BOOL_CONVERSION = YES; | ||
| CLANG_WARN_COMMA = YES; | ||
| CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| CLANG_WARN_DOCUMENTATION_COMMENTS = YES; | ||
| CLANG_WARN_EMPTY_BODY = YES; | ||
| CLANG_WARN_ENUM_CONVERSION = YES; | ||
| CLANG_WARN_INFINITE_RECURSION = YES; | ||
| CLANG_WARN_INT_CONVERSION = YES; | ||
| CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; | ||
| CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; | ||
| CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| COPY_PHASE_STRIP = NO; | ||
| DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
| DEVELOPMENT_TEAM = N94CS4N6VR; | ||
| ENABLE_NS_ASSERTIONS = NO; | ||
| ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| ENABLE_USER_SCRIPT_SANDBOXING = YES; | ||
| GCC_C_LANGUAGE_STANDARD = gnu17; | ||
| GCC_NO_COMMON_BLOCKS = YES; | ||
| GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| GCC_WARN_UNUSED_FUNCTION = YES; | ||
| GCC_WARN_UNUSED_VARIABLE = YES; | ||
| LOCALIZATION_PREFERS_STRING_CATALOGS = YES; | ||
| MACOSX_DEPLOYMENT_TARGET = 15.5; | ||
| MTL_ENABLE_DEBUG_INFO = NO; | ||
| MTL_FAST_MATH = YES; | ||
| SDKROOT = macosx; | ||
| SWIFT_COMPILATION_MODE = wholemodule; | ||
| }; | ||
| name = Release; | ||
| }; | ||
| 7F29CF0A2E5D71D0006ACFC9 /* Debug */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = N94CS4N6VR; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| SWIFT_VERSION = 5.0; | ||
| }; | ||
| name = Debug; | ||
| }; | ||
| 7F29CF0B2E5D71D0006ACFC9 /* Release */ = { | ||
| isa = XCBuildConfiguration; | ||
| buildSettings = { | ||
| CODE_SIGN_STYLE = Automatic; | ||
| DEVELOPMENT_TEAM = N94CS4N6VR; | ||
| ENABLE_HARDENED_RUNTIME = YES; | ||
| PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| SWIFT_VERSION = 5.0; | ||
| }; | ||
| name = Release; | ||
| }; | ||
| /* End XCBuildConfiguration section */ | ||
|
|
||
| /* Begin XCConfigurationList section */ | ||
| 7F29CEFD2E5D71D0006ACFC9 /* Build configuration list for PBXProject "SpartBaseBallGame" */ = { | ||
| isa = XCConfigurationList; | ||
| buildConfigurations = ( | ||
| 7F29CF072E5D71D0006ACFC9 /* Debug */, | ||
| 7F29CF082E5D71D0006ACFC9 /* Release */, | ||
| ); | ||
| defaultConfigurationIsVisible = 0; | ||
| defaultConfigurationName = Release; | ||
| }; | ||
| 7F29CF092E5D71D0006ACFC9 /* Build configuration list for PBXNativeTarget "SpartBaseBallGame" */ = { | ||
| isa = XCConfigurationList; | ||
| buildConfigurations = ( | ||
| 7F29CF0A2E5D71D0006ACFC9 /* Debug */, | ||
| 7F29CF0B2E5D71D0006ACFC9 /* Release */, | ||
| ); | ||
| defaultConfigurationIsVisible = 0; | ||
| defaultConfigurationName = Release; | ||
| }; | ||
| /* End XCConfigurationList section */ | ||
|
|
||
| /* Begin XCRemoteSwiftPackageReference section */ | ||
| 7F29CF452E5D71FD006ACFC9 /* XCRemoteSwiftPackageReference "LogMacro" */ = { | ||
| isa = XCRemoteSwiftPackageReference; | ||
| repositoryURL = "https://github.com/Roy-wonji/LogMacro.git"; | ||
| requirement = { | ||
| kind = upToNextMajorVersion; | ||
| minimumVersion = 1.1.0; | ||
| }; | ||
| }; | ||
| /* End XCRemoteSwiftPackageReference section */ | ||
|
|
||
| /* Begin XCSwiftPackageProductDependency section */ | ||
| 7F29CF462E5D71FE006ACFC9 /* LogMacro */ = { | ||
| isa = XCSwiftPackageProductDependency; | ||
| package = 7F29CF452E5D71FD006ACFC9 /* XCRemoteSwiftPackageReference "LogMacro" */; | ||
| productName = LogMacro; | ||
| }; | ||
| /* End XCSwiftPackageProductDependency section */ | ||
| }; | ||
| rootObject = 7F29CEFA2E5D71D0006ACFC9 /* Project object */; | ||
| } |
39 changes: 39 additions & 0 deletions
39
SpartBaseBallGame/SpartBaseBallGame/Sources/BaseBall/BaseBallGame.swift
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // | ||
| // BaseBallGame.swift | ||
| // SpartBaseBallGame | ||
| // | ||
| // Created by Wonji Suh on 8/27/25. | ||
| // | ||
|
|
||
| import Foundation | ||
| import LogMacro | ||
|
|
||
| actor BaseBallGame { | ||
| private let digits = 3 | ||
|
|
||
| // MARK: - 게임시작 | ||
| func start() async { | ||
| #logInfo("게임 시작 — 규칙: 1~9, 서로 다른 \(digits)자리") | ||
| _ = makeAnswer() | ||
| } | ||
|
|
||
| // 매 라운드 정답 생성 | ||
| private func makeAnswer() -> [Int] { | ||
| var pool = Array(1...9) | ||
| pool.shuffle() | ||
| #logDebug("랜덤 숫자", Array(pool.prefix(digits))) | ||
| return Array(pool.prefix(digits)) | ||
| } | ||
|
|
||
|
|
||
|
|
||
| // MARK: - realine | ||
| func readLineAsync() async -> String? { | ||
| await withCheckedContinuation { continuation in | ||
| Task.detached(priority: .userInitiated) { | ||
| continuation.resume(returning: readLine()) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
17 changes: 17 additions & 0 deletions
17
SpartBaseBallGame/SpartBaseBallGame/Sources/GameStart/GameManager.swift
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // | ||
| // GameManager.swift | ||
| // SpartBaseBallGame | ||
| // | ||
| // Created by Wonji Suh on 8/27/25. | ||
| // | ||
|
|
||
| import Foundation | ||
| import Combine | ||
|
|
||
| actor GameManager { | ||
| let baseBall = BaseBallGame() | ||
| // MARK: - 야구 게임 시작 | ||
| func baseBallGameStart() async { | ||
| await baseBall.start() | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
SpartBaseBallGame/SpartBaseBallGame/Sources/Main/main.swift
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // | ||
| // main.swift | ||
| // SpartBaseBallGame | ||
| // | ||
| // Created by Wonji Suh on 8/26/25. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| let gameManger = GameManager() | ||
|
|
||
| await gameManger.baseBallGameStart() | ||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 좋네요 ! 저도 수정해야겠어요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Peter1119 그건 지금 단계에서는 요구 사항이 아니어서
정답은 랜덤으로 만듭니다.(1에서 9까지의 서로 다른 임의의 수 3자리)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 그렇네요