Created
June 7, 2019 08:12
-
-
Save AppleCEO/d2cd7568255da5a1bac0590cb7cdd323 to your computer and use it in GitHub Desktop.
인풋을 담당하는 모듈
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
| import Foundation | |
| struct InputView { | |
| private func printMenuInputGuidance () { | |
| print("카드 게임 종류를 선택하세요.") | |
| print("1. 7카드") | |
| print("2. 5카드") | |
| print("9. 종료") | |
| } | |
| private func printUserCountInputGuidance () { | |
| print("참여할 사람의 인원을 입력하세요.") | |
| } | |
| func readInput () -> (String, String) { | |
| let menu: String | |
| let people: String | |
| printMenuInputGuidance() | |
| print("> ", terminator: "") | |
| menu = readLine() ?? "0" | |
| printUserCountInputGuidance() | |
| print("> ", terminator: "") | |
| people = readLine() ?? "0" | |
| return (menu, people) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment