Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Created June 7, 2019 08:12
Show Gist options
  • Select an option

  • Save AppleCEO/d2cd7568255da5a1bac0590cb7cdd323 to your computer and use it in GitHub Desktop.

Select an option

Save AppleCEO/d2cd7568255da5a1bac0590cb7cdd323 to your computer and use it in GitHub Desktop.
인풋을 담당하는 모듈
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