-
Notifications
You must be signed in to change notification settings - Fork 0
김호성 계산기 과제 #16
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
base: main
Are you sure you want to change the base?
김호성 계산기 과제 #16
Conversation
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.
잘봤습니다!!
스유까지 잘하면 난 어떡하라고... 진짜 문법이 탄탄한건지 뭔지 잘하는 비결좀 알려주세요 제발..
호성시는 항상 제가 리스팩하고 있습니다.. 너무 잘하세요 진짜 제가 배워갑니다.. 맨날 호성시 코드를 보면 걍 어이가 없어요 어떻게 이 방식으로 했지? 이런 의문이 들어서.. 나는 진짜 스택을 써서 계산기 만들줄 몰랐다
근데 저런식으로 네이밍은 좀 오바에여. 테코스에서 네이밍 컨벤션 내가 과제로 줬었는데 좀만 더 신경써주세여~
--편지--
앱잼 같이 하면 재밌을 거 같았는데 아쉽다!
합세 같은 조가 무려 두명이나 가 있어서 플린트는 너무 마음이 쓰인다..
플린트가서도 잘해.. 분명 재밌을 거야 그 조합 맘에 듦..
근데 나 유킷좀 알려줘라
| case erase, clear | ||
| } | ||
|
|
||
| extension CalculatorButtonType { |
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.
감탄스럽다
| guard let last = stack.last else { return } | ||
| switch last { | ||
| case .num(let int): | ||
| _ = stack.popLast() |
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.
너 알고리즘 좀 잘하지
| // sut = nil | ||
| } | ||
|
|
||
| func test_십일더하기육() throws { |
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.
네이밍 실화니?
저는 CalculateState enum을 배열에 보관하는 식으로 계산기 구현했습니다.
로직은 좀 더럽게 짰습니다.
테스트는 총 5개 만들었는데
첫번째 테스트는 두자리수 숫자와 더하기 연산 테스트
두번째 테스트는 연산자도 잘 출력되는지 테스트
세번째는 연산자 두번 연속으로 나오는 illegal한 경우에 연산자 두번째거는 잘 무시가 되는지
네번째는 클리어 잘 되는지
마지막은 지우기가 잘 되는지 테스트입니다.