이전 주제 보기 :: 다음 주제 보기 |
글쓴이 |
메시지 |
고윤석
가입: 2008년 9월 26일 올린 글: 11
|
올려짐: 2008년9월26일 3:37 주제: 2-3번 testcase입니다. |
|
|
숙제는 잘들 하고 계신가요?
멍청하면 몸이 고생이라고.. 끝없는 삽질의 연속이군요.
혹시라도 콘크리트 바닥에 삽질하는데 도움이 되었으면 하는 바램에
제가 쓰던 testcase를 공개합니다.
2-3 "어울리지 않아"의 testcase입니다.
원 출처는 작년인가 재작년 게시판이며, 저에게 필요한 testcase를 추가로 더 넣었습니다.
전 이제서야 간신히 모두 통과했네요.
잠좀 잡시다. -_-;;;
코드: |
; test set
; 1023 = 10(1)+23
(if (not (match-it '(1 0 2 3) (dot (dot (dot (dot (atom 1) (atom 0)) (plus (atom 1))) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 10 = 10(1)+
(if (not (match-it '(1 0) (dot (dot (atom 1) (atom 0)) (plus (atom 1))))) (display "right!") (display "wrong!")) (newline)
; 101 = 10(1)+
(if (match-it '(1 0 1) (dot (dot (atom 1) (atom 0)) (plus (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1001 = (10)+1
(if (not (match-it '(1 0 0 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1011 = (10)+1
(if (not (match-it '(1 0 1 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1010101 = (10)+1
(if (match-it '(1 0 1 0 1 0 1) (dot (plus (dot (atom 1) (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 1001 = 1(0)+1
(if (match-it '(1 0 0 1) (dot (dot (atom 1) (plus (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 10001 = 1(0)+1
(if (match-it '(1 0 0 0 1) (dot (dot (atom 1) (plus (atom 0))) (atom 1))) (display "right!") (display "wrong!")) (newline)
; 10010 = 1(0)+1
(if (not (match-it '(1 0 0 1 0) (dot (dot (atom 1) (plus (atom 0))) (atom 1)))) (display "right!") (display "wrong!")) (newline)
; 1949410 = ((94|1)+|7)0
(if (match-it '(1 9 4 9 4 1 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0))) (display "right!") (display "wrong!")) (newline)
; 94194170 = ((94|1)+|7)0
(if (not (match-it '(9 4 1 9 4 1 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 70 = ((94|1)+|7)0
(if (match-it '(7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0))) (display "right!") (display "wrong!")) (newline)
; 170 = ((94|1)+|7)0
(if (not (match-it '(1 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 11719470 = ((94|1)+|7)0
(if (not (match-it '(1 1 7 1 9 4 7 0) (dot (bar (plus (bar (dot (atom 9) (atom 4)) (atom 1))) (atom 7)) (atom 0)))) (display "right!") (display "wrong!")) (newline)
; 12313321 = (1|2|3)+
(if (match-it '(1 2 3 1 3 3 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 13313322 = (1|2|3)+
(if (match-it '(1 3 3 1 3 3 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 31113121 = (1|2|3)+
(if (match-it '(3 1 1 1 3 1 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 22123222 = (1|2|3)+
(if (match-it '(2 2 1 2 3 2 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 33333333 = (1|2|3)+
(if (match-it '(3 3 3 3 3 3 3 3) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 12313322 = (1|2|3)+
(if (match-it '(1 2 3 1 3 3 2 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3)))) (display "right!") (display "wrong!")) (newline)
; 12413321 = (1|2|3)+
(if (not (match-it '(1 2 4 1 3 3 2 1) (plus (bar (bar (atom 1) (atom 2)) (atom 3))))) (display "right!") (display "wrong!")) (newline)
; 12310112 = (1|2|3)+
(if (not (match-it '(1 2 3 1 0 1 1 2) (plus (bar (bar (atom 1) (atom 2)) (atom 3))))) (display "right!") (display "wrong!")) (newline)
|
|
|
위로 |
|
|
이남구 손님
|
올려짐: 2008년9월26일 14:59 주제: 감사합니다! |
|
|
테스트셋 감사합니다!
잘 활용하겠습니다~ |
|
위로 |
|
|
이연석
가입: 2008년 9월 5일 올린 글: 17
|
올려짐: 2008년9월26일 19:49 주제: 우와... |
|
|
감사합니다!!!
잘 쓸게요 ㅋㅋ |
|
위로 |
|
|
|